:root {
  --brand-blue: #0d3b66;
  --brand-orange: #f95738;
  --brand-orange-deep: #df3f22;
  --brand-gold: #f4d35e;
  --brand-amber: #ee964b;
  --brand-cream: #fff4cf;
  --brand-cream-2: #ffe7b0;
  --ink: #19324a;
  --muted: #6e7b87;
  --line: rgba(13, 59, 102, 0.14);
  --surface: #fffaf0;
  --surface-strong: #ffffff;
  --shadow: 0 18px 50px rgba(13, 59, 102, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Niramit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff7e3;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--brand-blue);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  width: min(1040px, 100%);
  min-height: 620px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.95);
  box-shadow: 0 30px 80px rgba(62, 22, 0, 0.32);
}

.login-brand {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 42px;
  color: #ffffff;
  background: var(--brand-blue);
  border-right: 10px solid var(--brand-orange);
}

.login-brand h1 {
  margin: 0;
  font-size: 3rem;
  font-weight: 800;
}

.login-brand p {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 250, 235, 0.9);
  font-size: 1.15rem;
  font-weight: 700;
}

.login-mark {
  width: 86px;
  height: 86px;
}

.login-logo-img {
  width: min(280px, 72vw);
  height: auto;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(62, 22, 0, 0.26);
}

.login-card {
  display: grid;
  align-content: center;
  padding: 38px;
  background: #ffffff;
}

.login-card h2 {
  margin-bottom: 22px;
  font-weight: 800;
}

.login-hint {
  display: grid;
  gap: 3px;
  margin-top: 18px;
  padding: 12px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.9rem;
}

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

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

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  overflow-y: auto;
  color: #ffffff;
  background: var(--brand-blue);
  border-right: 8px solid var(--brand-orange);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px;
  margin-bottom: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 207, 0.28);
}

.brand-mark {
  position: relative;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border: 3px solid var(--brand-cream);
  border-right-color: transparent;
  border-radius: 50%;
}

.brand-logo-img {
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(62, 22, 0, 0.22);
}

.brand-flame {
  position: absolute;
  top: -4px;
  left: 22px;
  width: 18px;
  height: 36px;
  border-radius: 60% 20% 55% 20%;
  background: var(--brand-gold);
  transform: rotate(-18deg);
  animation: flameFlicker 2.8s ease-in-out infinite;
}

.brand-pour {
  position: absolute;
  right: 9px;
  bottom: 8px;
  width: 32px;
  height: 16px;
  border-radius: 50%;
  border: 7px solid var(--brand-cream);
  border-top-color: transparent;
  transform: rotate(12deg);
}

.brand-title,
.brand-subtitle {
  display: block;
  font-weight: 800;
  line-height: 1.05;
}

.brand-title {
  color: #ffffff;
  font-size: 1.5rem;
}

.brand-subtitle {
  color: #ffe77d;
  font-size: 1.25rem;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav-submenu {
  gap: 6px;
  margin: 2px 0 8px;
  padding-left: 10px;
  border-left: 2px solid rgba(255, 243, 216, 0.22);
}

.admin-nav-submenu.collapse.show,
.admin-nav-submenu.collapsing {
  display: grid;
}

.admin-nav-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(13, 59, 102, 0.34);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.admin-nav-group[aria-expanded="true"] {
  background: rgba(244, 211, 94, 0.18);
}

.admin-nav-group:hover {
  color: #fff4cf;
  background: rgba(13, 59, 102, 0.48);
  transform: translateX(3px);
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #fffaf0;
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.admin-nav-link:hover,
.admin-nav-link.active {
  color: var(--brand-blue);
  background: #fff4cf;
  transform: translateX(3px);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: var(--brand-blue);
  background: var(--brand-gold);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
}

.nav-icon .bi {
  line-height: 1;
}

.btn .bi,
.eyebrow .bi,
.card-kicker .bi,
.metric-card span .bi,
.user-chip .bi {
  margin-right: 6px;
}

.admin-nav-group .bi-chevron-down {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 244, 207, 0.14);
  font-size: 0.95rem;
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

.admin-nav-group[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

.sidebar-branch {
  display: grid;
  gap: 4px;
  padding: 14px;
  margin-top: auto;
  border: 1px solid rgba(255, 244, 207, 0.28);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(13, 59, 102, 0.28);
}

.branch-label,
.eyebrow,
.card-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-branch .branch-label,
.sidebar-branch small {
  color: #ffecc0;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 88px;
  padding: 18px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.9);
  backdrop-filter: blur(18px);
}

.page-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
}

.topbar-actions,
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 800;
}

.admin-content {
  display: grid;
  gap: 22px;
  padding: 28px 30px 46px;
}

.btn {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 800;
}

.btn-brand {
  border: 0;
  color: #153552;
  background: var(--brand-gold);
  box-shadow: 0 10px 24px rgba(238, 150, 75, 0.24);
}

.btn-brand:hover {
  color: #1c0b03;
  transform: translateY(-1px);
}

.btn-cream {
  border: 1px solid rgba(13, 59, 102, 0.14);
  color: var(--ink);
  background: #fff6db;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: var(--brand-cream);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
}

.dashboard-hero-grid {
  grid-template-columns: 1fr;
}

.hero-panel,
.gold-price-card,
.metric-card,
.section-panel,
.stock-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.hero-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 190px;
  padding: 24px 28px;
  overflow: hidden;
  color: #ffffff;
  background: var(--brand-blue);
  border-bottom: 10px solid var(--brand-orange);
}

.hero-panel-with-prices {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 560px);
  min-height: 260px;
  border: 10px solid var(--brand-gold);
  border-bottom: 10px solid var(--brand-orange);
}

.hero-panel::after {
  position: absolute;
  right: -4rem;
  bottom: -7rem;
  width: 22rem;
  height: 22rem;
  content: "";
  border: 34px solid rgba(255, 243, 216, 0.18);
  border-right-color: transparent;
  border-radius: 50%;
  animation: slowSpin 18s linear infinite;
}

.hero-panel > * {
  position: relative;
  z-index: 1;
}

.hero-main-copy {
  display: grid;
  gap: 12px;
}

.hero-panel .eyebrow {
  color: rgba(255, 243, 216, 0.82);
}

.hero-panel h2 {
  max-width: 740px;
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 3.05rem);
  font-weight: 800;
  line-height: 1.04;
}

.hero-copy {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.06rem;
}

.hero-panel .hero-actions {
  margin-top: 4px;
}

.gold-price-card {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 24px;
}

.dashboard-price-card {
  display: grid;
  align-content: stretch;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 244, 207, 0.52);
  border-radius: 8px;
  color: #fffaf0;
  background: rgba(255, 250, 240, 0.96);
  box-shadow: 0 24px 60px rgba(13, 59, 102, 0.22);
  backdrop-filter: blur(12px);
}

.dashboard-price-header,
.dashboard-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-price-header {
  justify-content: space-between;
}

.dashboard-price-card .card-kicker {
  color: #6f574a;
}

.dashboard-price-list {
  display: grid;
  gap: 10px;
}

.dashboard-price-row {
  position: relative;
  padding: 12px;
  border: 1px solid rgba(13, 59, 102, 0.10);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.dashboard-price-row-gold {
  border-color: rgba(244, 211, 94, 0.78);
  background: #fff6c8;
}

.dashboard-price-row-silver {
  border-color: rgba(13, 59, 102, 0.16);
  background: #f2f8ff;
}

.dashboard-price-row > div:nth-child(2) {
  min-width: 0;
}

.dashboard-price-row strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.dashboard-price-row small {
  color: var(--muted);
  font-weight: 800;
}

.dashboard-price-value {
  display: grid;
  gap: 2px;
  margin-left: auto;
  text-align: right;
}

.dashboard-price-value span {
  color: var(--brand-blue);
  font-size: 1.22rem;
  font-weight: 900;
  line-height: 1.15;
}

.market-asset-visual {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  font-size: 1.8rem;
  box-shadow: inset 0 0 0 1px rgba(97, 65, 38, 0.10);
}

.market-asset-gold {
  color: #8a5b00;
  background: linear-gradient(135deg, #fff8ce, #f4d35e);
}

.market-asset-silver {
  color: var(--brand-blue);
  background: linear-gradient(135deg, #ffffff, #dce9f7);
}

.dashboard-price-foot {
  display: grid;
  gap: 4px;
}

.gold-price-card strong {
  font-size: 1.1rem;
}

.price-value {
  color: var(--brand-blue);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

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

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-weight: 700;
}

.metric-card strong {
  color: var(--brand-blue);
  font-size: 1.55rem;
  font-weight: 800;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.section-panel,
.stock-band {
  padding: 22px;
}

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

.section-heading h2,
.quick-panel h2 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 800;
}

.admin-table {
  min-width: 760px;
  margin: 0;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  border-bottom-color: var(--line);
}

.admin-table td {
  border-bottom-color: rgba(94, 48, 22, 0.08);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
}

.table-pagination-info {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.table-pagination-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.table-page-button {
  min-width: 36px;
  height: 36px;
  border: 1px solid rgba(86, 38, 15, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 800;
}

.table-page-button:hover,
.table-page-button.active {
  color: var(--brand-blue);
  border-color: transparent;
  background: var(--brand-gold);
}

.table-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-notify-modal .modal-body {
  color: var(--ink);
  font-weight: 700;
}

.badge-soft {
  background: rgba(244, 211, 94, 0.22);
  border: 1px solid rgba(238, 150, 75, 0.24);
  color: var(--brand-blue);
  font-weight: 700;
}

.audit-json {
  background: #23140f;
  border-radius: 8px;
  color: #ffe8ca;
  font-size: 0.86rem;
  margin: 0;
  max-height: 300px;
  overflow: auto;
  padding: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.mini-stat {
  background: rgba(255, 248, 238, 0.88);
  border: 1px solid rgba(255, 105, 0, 0.12);
  border-radius: 8px;
  padding: 0.85rem;
}

.mini-stat span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
}

.mini-stat strong {
  display: block;
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.empty-state {
  height: 92px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.status-pill.completed {
  color: #14633d;
  background: #dff8e8;
}

.status-pill.processing {
  color: #8b4b00;
  background: #fff0c2;
}

.status-pill.draft {
  color: #5d6472;
  background: #edf0f5;
}

.status-pill.cancelled {
  color: #9c1c1c;
  background: #ffe1df;
}

.quick-panel {
  display: none;
  align-content: start;
  gap: 12px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
  background: #ffffff;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.quick-action:hover {
  border-color: rgba(249, 87, 56, 0.32);
  box-shadow: 0 12px 24px rgba(130, 44, 0, 0.12);
  transform: translateY(-2px);
}

.quick-action span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--brand-blue);
  background: var(--brand-cream);
}

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

.inventory-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.inventory-metric-primary {
  border-color: rgba(249, 87, 56, 0.22);
  background: #fff3cf;
}

.inventory-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.inventory-chart-card {
  min-height: 320px;
}

.inventory-bars {
  display: grid;
  gap: 14px;
}

.inventory-bars-compact {
  gap: 11px;
}

.inventory-bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(160px, 1.3fr) minmax(92px, 0.45fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(13, 59, 102, 0.08);
  border-radius: 8px;
  background: #fffdf8;
}

.inventory-bar-label {
  min-width: 0;
}

.inventory-bar-label strong,
.inventory-bar-label span,
.inventory-bar-value {
  display: block;
  white-space: nowrap;
}

.inventory-bar-label strong {
  overflow: hidden;
  color: var(--brand-blue);
  font-size: 0.95rem;
  text-overflow: ellipsis;
}

.inventory-bar-label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.inventory-bar-track {
  position: relative;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef4f9;
}

.inventory-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-gold), var(--brand-coral));
  box-shadow: 0 6px 14px rgba(249, 87, 56, 0.20);
}

.inventory-bar-value {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: right;
}

.stock-chip {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 16px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand-blue);
  border-bottom: 6px solid var(--brand-orange);
}

.stock-chip span {
  color: rgba(255, 243, 216, 0.84);
  font-weight: 800;
}

.stock-chip strong {
  font-size: 1.35rem;
  font-weight: 800;
}

.brand-modal {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(62, 22, 0, 0.28);
}

.brand-modal .modal-header {
  border-bottom-color: var(--line);
}

.brand-modal .modal-footer {
  border-top-color: var(--line);
}

.form-control,
.form-select {
  min-height: 44px;
  border-color: rgba(94, 48, 22, 0.18);
  border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 0.2rem rgba(249, 87, 56, 0.14);
}

.branch-choice {
  display: grid;
  gap: 4px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.branch-choice.active {
  border-color: rgba(249, 87, 56, 0.35);
  background: #fff1d6;
}

.branch-choice span {
  color: var(--muted);
}

.purchase-workspace {
  width: 100%;
  max-width: none;
}

.purchase-create-shell {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.purchase-create-shell > .section-heading {
  position: sticky;
  top: 104px;
  z-index: 4;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid rgba(94, 48, 22, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(130, 44, 0, 0.10);
  backdrop-filter: blur(18px);
}

.purchase-create-shell > .section-heading h2 {
  margin: 2px 0 0;
  font-size: 1.38rem;
  line-height: 1.35;
}

.purchase-create-shell > .section-heading .topbar-actions {
  justify-content: flex-end;
}

.purchase-create-shell > .section-heading .btn {
  min-height: 38px;
  padding-inline: 12px;
  box-shadow: none;
}

.purchase-form {
  display: grid;
  gap: 18px;
}

.purchase-create-shell .purchase-form {
  margin-top: 18px;
}

.metal-price-panel {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(244, 211, 94, 0.68);
  border-left: 5px solid var(--brand-gold);
  border-radius: 8px;
  color: #2f1a0f;
  background: #fff8dd;
  box-shadow: 0 14px 32px rgba(238, 150, 75, 0.12);
}

.metal-price-panel.is-price-stale {
  border-color: rgba(249, 87, 56, 0.42);
  border-left-color: var(--brand-orange);
  background: #fff4ed;
}

.metal-price-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metal-price-panel-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
}

.metal-price-card {
  display: grid;
  gap: 10px;
  min-height: 100%;
  padding: 14px;
  border: 1px solid rgba(97, 65, 38, 0.14);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(36, 20, 13, 0.06);
}

.metal-price-card-gold {
  border-color: rgba(244, 211, 94, 0.72);
  background: #fff8da;
}

.metal-price-card-silver {
  border-color: rgba(13, 59, 102, 0.18);
  background: #f7fbff;
}

.metal-price-card-platinum {
  border-color: rgba(238, 150, 75, 0.34);
  background: #fff7f2;
}

.metal-price-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.metal-price-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  font-size: 1.35rem;
  box-shadow: inset 0 0 0 1px rgba(97, 65, 38, 0.08);
}

.metal-price-icon .bi {
  line-height: 1;
}

.metal-price-card-head strong {
  display: block;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 900;
}

.metal-price-card-head small,
.metal-price-live,
.metal-price-source,
.metal-price-status {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.metal-price-live {
  display: grid;
  gap: 2px;
  min-height: 42px;
}

.metal-price-live span:first-child {
  color: #3d2817;
  font-size: 0.95rem;
  font-weight: 900;
}

.metal-price-status {
  min-height: 20px;
}

.form-band {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.purchase-band {
  position: relative;
  padding: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 42px rgba(130, 44, 0, 0.08);
}

.purchase-band::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: "";
  background: var(--brand-orange);
}

.purchase-band .row {
  --bs-gutter-x: 14px;
  --bs-gutter-y: 14px;
}

.purchase-band .form-label {
  margin-bottom: 5px;
  color: #5d3a23;
  font-size: 0.88rem;
  font-weight: 800;
}

.purchase-band .form-text {
  margin-top: 5px;
  color: #8b725f;
  font-size: 0.78rem;
  line-height: 1.45;
}

.purchase-band .form-control,
.purchase-band .form-select {
  min-height: 42px;
  border-color: rgba(94, 48, 22, 0.16);
  background-color: #fffdf8;
}

.purchase-customer-band .compact-id-card-preview {
  height: 100%;
  min-height: 206px;
  padding: 12px;
  background: #fffaf0;
}

.purchase-customer-band .compact-id-card-preview img {
  aspect-ratio: 3 / 4;
  max-height: 176px;
  object-fit: cover;
}

.customer-evidence-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(94, 48, 22, 0.10);
}

.customer-evidence-inline .camera-panel,
.customer-evidence-inline .evidence-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 304px;
  padding: 12px;
}

.customer-evidence-inline .compact-id-card-preview {
  min-height: 304px;
}

.customer-evidence-inline .camera-panel video,
.customer-evidence-inline .evidence-preview img {
  flex: 0 0 auto;
  width: min(100%, 244px);
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 0;
  max-height: none;
  object-fit: cover;
}

.customer-evidence-inline .compact-id-card-preview img {
  aspect-ratio: 1 / 1;
  max-height: none;
}

.customer-evidence-inline .topbar-actions {
  justify-content: center;
  margin-top: 10px !important;
}

.seller-camera-frame {
  position: relative;
  flex: 0 0 auto;
  width: min(100%, 244px);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
}

.seller-camera-frame video,
.seller-camera-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: cover;
}

.seller-camera-frame img {
  display: none;
}

.seller-camera-panel.has-photo .seller-camera-frame video {
  display: none;
}

.seller-camera-panel.has-photo .seller-camera-frame img {
  display: block;
}

.camera-panel .evidence-title {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.purchase-band textarea.form-control {
  min-height: 76px;
}

.form-band-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.purchase-band .form-band-title {
  margin: -2px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(94, 48, 22, 0.10);
}

.form-band-title span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--brand-orange-deep);
  background: var(--brand-gold);
  font-weight: 800;
}

.purchase-band .form-band-title span {
  width: 36px;
  height: 36px;
  color: #421905;
  box-shadow: 0 10px 20px rgba(255, 210, 26, 0.28);
}

.purchase-band .form-band-title strong {
  font-size: 1.12rem;
}

.purchase-assay-band {
  background: #ffffff;
}

.purchase-assay-band .admin-table {
  border: 1px solid rgba(94, 48, 22, 0.10);
  overflow: hidden;
}

.purchase-evidence-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  border: 1px dashed rgba(249, 87, 56, 0.28);
  border-radius: 8px;
  background: #fffaf0;
}

.purchase-evidence-upload {
  display: grid;
  align-content: start;
  gap: 8px;
}

.purchase-evidence-upload .btn-sm {
  justify-self: start;
  min-height: 34px;
  padding: 6px 12px;
}

.upload-preview {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 154px;
  padding: 10px;
  border: 1px solid rgba(94, 48, 22, 0.12);
  border-radius: 8px;
  background: #ffffff;
}

.upload-preview img {
  display: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface);
}

.upload-preview.has-file img {
  display: block;
}

.upload-preview.has-file:not(.is-pdf):not(.is-invalid) {
  cursor: zoom-in;
}

.upload-preview.has-file:not(.is-pdf):not(.is-invalid):hover {
  border-color: rgba(249, 87, 56, 0.46);
  box-shadow: inset 0 0 0 1px rgba(249, 87, 56, 0.18);
}

.purchase-evidence-strip .upload-preview {
  min-height: 122px;
  padding: 8px;
}

.purchase-evidence-strip .upload-preview img {
  height: 112px;
  aspect-ratio: auto;
  object-fit: contain;
}

.upload-preview.is-pdf {
  place-content: center;
  text-align: center;
}

.upload-preview.is-pdf::before {
  content: "PDF";
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand-orange);
  font-weight: 900;
}

.upload-preview.is-pdf img,
.upload-preview.is-invalid img {
  display: none;
}

.upload-preview span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.upload-preview.is-invalid {
  border-color: rgba(220, 53, 69, 0.45);
  background: rgba(220, 53, 69, 0.05);
}

.upload-preview.is-invalid span {
  color: #b02a37;
}

.evidence-camera-box {
  overflow: hidden;
  border: 1px solid rgba(94, 48, 22, 0.14);
  border-radius: 8px;
  background: #120b08;
}

.evidence-camera-box video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.calculation-card {
  display: grid;
  align-content: center;
  min-height: 100%;
  padding: 18px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand-orange);
  border-left: 10px solid var(--brand-blue);
}

.purchase-assay-band .calculation-card {
  min-height: 130px;
  padding: 22px;
  border: 0;
  box-shadow: 0 18px 36px rgba(13, 59, 102, 0.18);
}

.purchase-assay-band .calculation-card-primary {
  height: 100%;
  min-height: 142px;
}

.purchase-assay-band .calculation-card-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 92px;
  padding: 18px 20px;
}

.calculation-card span,
.calculation-card small {
  color: rgba(255, 243, 216, 0.82);
  font-weight: 800;
}

.calculation-card strong {
  font-size: 2rem;
  font-weight: 800;
}

.purchase-assay-band .calculation-card strong {
  font-size: clamp(2rem, 3.2vw, 2.65rem);
  line-height: 1;
}

.purchase-assay-band .calculation-card-inline strong {
  flex: 0 0 auto;
  text-align: right;
}

.calculation-card .purchase-raw-total {
  display: block;
  margin-top: 5px;
  color: rgba(255, 250, 232, 0.72);
  font-size: 0.82rem;
  font-weight: 700;
}

.purchase-payment-band {
  border-left-color: var(--brand-blue);
}

.payment-balance-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(13, 59, 102, 0.14);
  border-radius: 8px;
  background: var(--brand-blue);
  color: #fffaf0;
  box-shadow: 0 16px 34px rgba(13, 59, 102, 0.15);
}

.payment-balance-card span,
.payment-balance-card small {
  color: rgba(255, 250, 240, 0.78);
  font-weight: 800;
}

.payment-balance-card strong {
  font-size: clamp(1.7rem, 2.6vw, 2.25rem);
  line-height: 1;
}

.payment-balance-card .text-success {
  color: #f4d35e !important;
}

.payment-balance-card .text-danger {
  color: #ffb3a4 !important;
}

.purchase-asset-list {
  padding: 16px;
  border: 1px solid rgba(97, 65, 38, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.76);
}

.purchase-asset-list-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.purchase-asset-list-header-main {
  margin-bottom: 2px;
  padding: 14px 16px;
  border: 1px solid rgba(97, 65, 38, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.purchase-asset-list-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.purchase-asset-list-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.purchase-asset-table {
  margin-bottom: 0;
}

.purchase-asset-table th,
.purchase-asset-table td {
  vertical-align: middle;
}

.metal-market-price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.metal-market-price-grid .form-label {
  margin-bottom: 4px;
  color: var(--ink);
  font-weight: 900;
}

.purchase-item-card-stack {
  display: grid;
  gap: 10px;
}

.purchase-inline-item-card {
  padding: 12px;
  border: 1px dashed rgba(249, 87, 56, 0.34);
  border-radius: 8px;
  background: #ffffff;
}

.purchase-inline-item-card .row {
  --bs-gutter-x: 0.75rem;
  --bs-gutter-y: 0.65rem;
}

.purchase-inline-item-card .form-label {
  margin-bottom: 0.22rem;
  font-size: 0.82rem;
}

.purchase-inline-item-card .form-control,
.purchase-inline-item-card .form-select {
  min-height: 38px;
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
}

.purchase-inline-item-card textarea.form-control {
  min-height: 38px;
}

.purchase-inline-item-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(97, 65, 38, 0.14);
}

.purchase-primary-item-header {
  margin-bottom: 0;
}

.purchase-inline-item-header span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  margin-right: 8px;
  border-radius: 8px;
  color: #2c180c;
  background: var(--brand-gold);
  font-weight: 900;
}

.purchase-inline-item-header strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 900;
}

.purchase-evidence-strip-inline {
  margin-top: 2px;
  gap: 10px;
  padding: 10px;
  border-color: rgba(97, 65, 38, 0.16);
  background: rgba(255, 255, 255, 0.56);
}

.purchase-inline-item-card .purchase-evidence-upload {
  gap: 6px;
}

.purchase-inline-item-card .purchase-evidence-upload .btn-sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 0.82rem;
}

.purchase-inline-item-card .upload-preview span {
  font-size: 0.74rem;
}

.purchase-field-error {
  border-color: #dc3545 !important;
  background-color: #fff5f5 !important;
  box-shadow: 0 0 0 0.18rem rgba(220, 53, 69, 0.12) !important;
}

.image-preview-modal .modal-body {
  display: grid;
  place-items: center;
  min-height: 50vh;
  padding: 12px;
  background: #1d140f;
}

.image-preview-modal img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  border-radius: 8px;
  object-fit: contain;
  background: #1d140f;
}

.evidence-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) repeat(2, minmax(180px, 0.85fr));
  gap: 16px;
}

.purchase-customer-evidence-band .evidence-grid {
  grid-template-columns: minmax(300px, 1.15fr) repeat(2, minmax(210px, 0.9fr));
}

.camera-panel,
.evidence-preview {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.purchase-customer-evidence-band .camera-panel,
.purchase-customer-evidence-band .evidence-preview {
  min-height: 262px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 210, 26, 0.14);
}

.camera-panel video,
.evidence-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
}

.purchase-customer-evidence-band .camera-panel video,
.purchase-customer-evidence-band .evidence-preview img {
  background: #fff7e8;
}

.evidence-preview img:not([src]),
.evidence-preview img[src=""] {
  opacity: 0;
}

.evidence-preview.has-file img {
  opacity: 1;
}

.evidence-preview span {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.purchase-operational-evidence input[type="file"] {
  padding: 9px;
  background: #ffffff;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.purchase-create-shell .form-actions {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(94, 48, 22, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(130, 44, 0, 0.16);
  backdrop-filter: blur(16px);
}

.purchase-action-primary {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.purchase-action-back {
  flex: 0 0 auto;
}

.purchase-action-add {
  border-color: rgba(13, 59, 102, 0.2);
  box-shadow: 0 8px 20px rgba(13, 59, 102, 0.08);
}

.purchase-create-shell .form-actions .btn-brand {
  min-width: min(100%, 270px);
}

.withdrawal-pos-workspace {
  max-width: none;
}

.withdrawal-pos-form {
  display: block;
}

.withdrawal-pos-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 18px;
  align-items: start;
}

.withdrawal-pos-left {
  display: grid;
  gap: 14px;
}

.withdrawal-pos-card,
.withdrawal-pos-cart {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(13, 59, 102, 0.08);
}

.withdrawal-pos-card {
  padding: 18px;
}

.withdrawal-pos-select-grid,
.withdrawal-pos-input-grid {
  display: grid;
  gap: 14px;
}

.withdrawal-pos-select-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.withdrawal-lot-picker {
  margin-top: 14px;
}

.withdrawal-lot-picker .form-select {
  min-height: 56px;
  font-weight: 800;
}

.withdrawal-pos-stock-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.withdrawal-pos-stock-strip > div {
  padding: 16px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand-blue);
}

.withdrawal-pos-stock-strip > div:last-child {
  background: var(--brand-orange);
}

.withdrawal-pos-stock-strip span,
.withdrawal-cart-metrics span,
.withdrawal-cart-item span,
.withdrawal-cart-item-grid span {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 800;
}

.withdrawal-pos-stock-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 1.35rem;
  font-weight: 900;
}

.withdrawal-pos-input-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.withdrawal-weight-only-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: stretch;
}

.withdrawal-primary-input {
  grid-column: span 2;
}

.withdrawal-weight-only-grid .withdrawal-primary-input {
  grid-column: auto;
}

.withdrawal-primary-input .form-control {
  min-height: 74px;
  color: var(--brand-blue);
  font-size: 2rem;
  font-weight: 900;
}

.withdrawal-later-note {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px dashed rgba(13, 59, 102, 0.28);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--brand-blue);
}

.withdrawal-later-note i {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-orange);
  font-size: 1.25rem;
  box-shadow: 0 10px 24px rgba(13, 59, 102, 0.08);
}

.withdrawal-later-note strong,
.withdrawal-later-note span {
  display: block;
}

.withdrawal-later-note span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.withdrawal-pos-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 16px;
}

.withdrawal-pos-actions .btn-brand {
  min-height: 54px;
  font-size: 1.05rem;
}

.withdrawal-pos-cart {
  position: sticky;
  top: 18px;
  overflow: hidden;
}

.withdrawal-cart-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff4cf;
}

.withdrawal-cart-header h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
}

.withdrawal-cart-header > span {
  padding: 8px 12px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand-blue);
  font-weight: 900;
}

.withdrawal-cart-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.withdrawal-cart-metrics > div {
  padding: 14px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand-blue);
}

.withdrawal-cart-metrics > div:last-child {
  background: var(--brand-orange);
}

.withdrawal-cart-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 1.22rem;
  font-weight: 900;
}

.withdrawal-cart-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 410px);
  min-height: 180px;
  overflow: auto;
  padding: 0 14px 14px;
}

.factory-smelt-update-row td {
  border-top: 0;
  background: #fffaf0;
}

.factory-smelt-update {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) repeat(4, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px dashed rgba(13, 59, 102, 0.18);
  border-radius: 8px;
  background: #ffffff;
}

.factory-smelt-update span,
.factory-smelt-update label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.factory-smelt-update strong {
  display: block;
  color: var(--brand-blue);
  font-size: 1rem;
}

.withdrawal-cart-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.withdrawal-cart-item header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.withdrawal-cart-item strong {
  color: var(--ink);
  font-weight: 900;
}

.withdrawal-cart-item span,
.withdrawal-cart-item-grid span {
  color: var(--muted);
}

.withdrawal-cart-item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.withdrawal-cart-item-grid > div {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
}

.withdrawal-cart-item-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 0.98rem;
}

.withdrawal-cart-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
}

.withdrawal-pos-submit {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.withdrawal-pos-submit .btn {
  min-height: 50px;
}

.floating-cart-button {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 1040;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 10px;
  align-items: center;
  min-width: 210px;
  padding: 14px 18px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand-blue);
  box-shadow: 0 18px 46px rgba(13, 59, 102, 0.28);
}

.floating-cart-button i {
  grid-row: span 2;
  font-size: 1.55rem;
}

.floating-cart-button span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: left;
}

.floating-cart-button strong {
  font-size: 1.05rem;
  font-weight: 900;
  text-align: left;
}

.withdrawal-modal-stock-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.8fr));
  gap: 12px;
}

.withdrawal-modal-stock-card > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.withdrawal-modal-stock-card span,
.withdrawal-modal-stock-card small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.withdrawal-modal-stock-card strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.14rem;
  font-weight: 900;
}

.checkout-cart-list {
  max-height: 46vh;
  padding: 0;
}

.checkout-cart-list .withdrawal-cart-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 991.98px) {
  .purchase-create-shell > .section-heading {
    position: static;
  }

  .purchase-customer-evidence-band .evidence-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .customer-evidence-inline,
  .purchase-evidence-strip {
    grid-template-columns: 1fr;
  }

  .purchase-asset-list-header {
    align-items: stretch;
    flex-direction: column;
  }

  .metal-market-price-grid {
    grid-template-columns: 1fr;
  }

  .purchase-inline-item-header {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-create-shell .form-actions {
    position: static;
    justify-content: stretch;
  }

  .purchase-action-primary {
    flex: 1 1 100%;
  }

  .purchase-create-shell .form-actions .btn,
  .purchase-create-shell .form-actions .btn-brand {
    flex: 1 1 100%;
    min-width: 0;
  }

  .purchase-assay-band .calculation-card-inline {
    align-items: flex-start;
    flex-direction: column;
  }

  .purchase-assay-band .calculation-card-inline strong {
    text-align: left;
  }

  .withdrawal-pos-grid,
  .withdrawal-pos-select-grid,
  .withdrawal-pos-input-grid,
  .withdrawal-weight-only-grid,
  .factory-smelt-update {
    grid-template-columns: 1fr;
  }

  .withdrawal-primary-input {
    grid-column: auto;
  }

  .withdrawal-pos-cart {
    position: static;
  }

  .withdrawal-cart-list {
    max-height: none;
  }

  .daily-closing-kpi-grid,
  .daily-closing-card .receipt-info-grid {
    grid-template-columns: 1fr;
  }

  .withdrawal-modal-stock-card {
    grid-template-columns: 1fr;
  }

  .floating-cart-button {
    right: 16px;
    bottom: 16px;
    min-width: 180px;
  }
}

@media (max-width: 575.98px) {
  .purchase-band,
  .purchase-create-shell > .section-heading {
    padding: 14px;
  }

  .gold-price-strip {
    padding: 12px;
  }
}

.report-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.report-filter .form-control,
.report-filter .form-select {
  width: 170px;
}

.daily-trading-filter {
  margin-bottom: 14px;
}

.daily-trading-sheet {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.daily-trading-title {
  padding: 18px 20px;
  color: var(--ink);
  background: #fff4cf;
  border-left: 5px solid var(--brand-orange);
  font-size: 1.2rem;
  font-weight: 900;
  text-align: left;
}

.daily-trading-table-wrap {
  overflow: auto;
  width: 100%;
  background: #ffffff;
}

.daily-trading-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  color: var(--ink);
  table-layout: fixed;
}

.daily-trading-table th,
.daily-trading-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 10px;
  vertical-align: middle;
  font-size: 0.94rem;
  line-height: 1.3;
}

.daily-trading-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #fffaf0;
  font-weight: 900;
  text-align: left;
}

.daily-trading-table tbody td,
.daily-trading-table tfoot th {
  background: #ffffff;
}

.daily-trading-table tbody tr.daily-band td:not(.daily-pink) {
  color: var(--ink);
  background: #fffdf8;
}

.daily-trading-table tbody tr:hover td {
  background: #fff8e4;
}

.daily-trading-table td:nth-child(1),
.daily-trading-table th:nth-child(1) {
  width: 82px;
}

.daily-trading-table td:nth-child(2),
.daily-trading-table th:nth-child(2) {
  width: 240px;
}

.daily-trading-table td:nth-child(3),
.daily-trading-table th:nth-child(3),
.daily-trading-table td:nth-child(4),
.daily-trading-table th:nth-child(4) {
  width: 82px;
}

.daily-trading-table td:nth-child(5),
.daily-trading-table th:nth-child(5),
.daily-trading-table td:nth-child(10),
.daily-trading-table th:nth-child(10) {
  width: 132px;
}

.daily-trading-table td:nth-child(6),
.daily-trading-table th:nth-child(6),
.daily-trading-table td:nth-child(7),
.daily-trading-table th:nth-child(7),
.daily-trading-table td:nth-child(8),
.daily-trading-table th:nth-child(8),
.daily-trading-table td:nth-child(9),
.daily-trading-table th:nth-child(9) {
  width: 90px;
}

.daily-trading-table td:nth-child(11),
.daily-trading-table th:nth-child(11),
.daily-trading-table td:nth-child(12),
.daily-trading-table th:nth-child(12) {
  width: 98px;
}

.daily-trading-table td:nth-child(13),
.daily-trading-table th:nth-child(13) {
  width: 112px;
}

.daily-trading-table small {
  display: block;
  margin-top: 2px;
  color: inherit;
  opacity: 0.72;
  font-size: 0.78rem;
}

.daily-trading-table .daily-pink {
  background: #fff1fb !important;
  color: #4b2345;
  font-weight: 800;
}

.daily-trading-table .daily-amount {
  display: table-cell;
  font-variant-numeric: tabular-nums;
}

.daily-trading-table .daily-amount span {
  float: left;
  font-weight: 800;
}

.daily-trading-table tfoot th {
  color: var(--ink);
  border-top: 2px solid var(--brand-orange);
  font-size: 1rem;
  font-weight: 900;
}

.daily-trading-empty {
  height: 96px;
  color: var(--muted);
  background: #fffaf0 !important;
  font-weight: 900;
  text-align: center;
}

.daily-trading-note {
  width: min(720px, calc(100% - 32px));
  margin: 18px 14px;
  padding: 16px 18px;
  border: 1px solid #e8c46a;
  border-left: 5px solid var(--brand-orange);
  border-radius: 8px;
  color: var(--ink);
  background: #fff8dc;
  font-size: 1.05rem;
  text-align: left;
  box-shadow: none;
}

.daily-trading-note strong,
.daily-trading-note span {
  display: block;
}

.daily-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.daily-summary-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff3cf;
}

.daily-summary-grid span,
.daily-summary-grid small {
  display: block;
  color: #333333;
  font-weight: 800;
}

.daily-summary-grid strong {
  display: block;
  margin: 4px 0;
  color: var(--brand-blue);
  font-size: 1.25rem;
  font-weight: 900;
}

.rate-report-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 22px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand-blue);
  border-bottom: 5px solid var(--brand-orange);
}

.rate-report-hero h2,
.rate-report-hero p {
  margin: 0;
}

.rate-report-hero h2 {
  font-size: 1.55rem;
  font-weight: 900;
}

.rate-report-hero p:not(.eyebrow) {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.78);
}

.rate-report-hero .eyebrow {
  color: #f4d35e;
}

.rate-report-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rate-report-kpis article {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.rate-report-kpis span,
.rate-month-total span,
.rate-month-total small,
.rate-row small,
.rate-date-head span,
.rate-date-block footer span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.rate-report-kpis span,
.rate-month-total span,
.rate-month-total small {
  color: rgba(255, 255, 255, 0.76);
}

.rate-report-kpis strong {
  display: block;
  margin-top: 6px;
  font-size: 1.05rem;
  font-weight: 900;
}

.rate-report-months {
  display: grid;
  gap: 18px;
}

.rate-month-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(13, 59, 102, 0.08);
}

.rate-month-card > header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-left: 5px solid var(--brand-orange);
  background: #fff4cf;
}

.rate-month-card h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
}

.rate-month-total {
  min-width: 250px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand-blue);
  text-align: right;
}

.rate-month-total strong {
  display: inline-block;
  margin-left: 10px;
  font-size: 1.08rem;
}

.rate-date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
  padding: 16px;
}

.rate-date-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.rate-date-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.rate-date-head strong {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
}

.rate-date-head span {
  color: var(--brand-orange-deep);
  font-size: 0.95rem;
}

.rate-row-list {
  display: grid;
}

.rate-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 120px 100px 130px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(123, 98, 84, 0.12);
}

.rate-row:nth-child(even) {
  background: #fff8e4;
}

.rate-row strong {
  color: var(--ink);
  font-weight: 900;
}

.rate-row .rate-price {
  color: var(--brand-blue);
  font-weight: 900;
}

.rate-row > span {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.rate-date-block footer {
  display: grid;
  grid-template-columns: 1fr 100px 130px;
  gap: 10px;
  padding: 11px 14px;
  background: #f4d35e;
  color: var(--ink);
}

.rate-date-block footer strong {
  text-align: right;
  font-weight: 900;
}

.ledger-report-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.ledger-report-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px 22px;
  border-left: 5px solid var(--brand-blue);
  background: #fff4cf;
}

.ledger-report-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 900;
}

.ledger-report-header span {
  color: var(--muted);
  font-weight: 800;
}

.ledger-net-card {
  min-width: 240px;
  padding: 14px 16px;
  border-radius: 8px;
  color: #ffffff;
  text-align: right;
}

.ledger-net-card.positive {
  background: var(--brand-blue);
}

.ledger-net-card.negative {
  background: var(--brand-orange);
}

.ledger-net-card span {
  color: rgba(255, 255, 255, 0.78);
}

.ledger-net-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.45rem;
  font-weight: 900;
}

.ledger-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 0;
}

.ledger-summary-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.ledger-summary-grid span,
.ledger-summary-grid small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.ledger-summary-grid strong {
  display: block;
  margin: 4px 0;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
}

.ledger-report-table-wrap {
  overflow: auto;
  padding: 18px;
}

.ledger-report-table {
  width: 100%;
  min-width: 1240px;
  border-collapse: collapse;
}

.ledger-report-table th,
.ledger-report-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.ledger-report-table thead th {
  color: var(--muted);
  background: #fffaf0;
  font-weight: 900;
  text-align: center;
}

.ledger-report-table thead tr:first-child th:nth-child(3) {
  background: #e8f5e9;
  color: #1b5e20;
}

.ledger-report-table thead tr:first-child th:nth-child(4) {
  background: #fff1f0;
  color: #9d2b16;
}

.ledger-report-table tbody tr:nth-child(even) td {
  background: #fffdf8;
}

.ledger-report-table tbody tr:hover td {
  background: #fff8e4;
}

.ledger-report-table small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ledger-report-table .money-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.ledger-report-table .money-cell.income {
  color: #1b5e20;
}

.ledger-report-table .money-cell.expense {
  color: #9d2b16;
}

.ledger-report-table tfoot th {
  border-top: 2px solid var(--brand-orange);
  background: #fff4cf;
  color: var(--ink);
  font-weight: 900;
}

.receipt-sheet {
  max-width: 1120px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.purchase-details-toolbar {
  margin-bottom: -6px;
}

.purchase-details-toolbar .section-heading {
  margin-bottom: 0;
}

.purchase-details-sheet {
  max-width: none;
  width: 100%;
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--brand-orange);
}

.receipt-header h2 {
  margin: 0 0 8px;
  font-weight: 800;
}

.receipt-header p {
  margin: 0 0 4px;
  color: var(--muted);
}

.receipt-doc {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 220px;
  padding: 14px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand-orange);
}

.receipt-doc strong {
  font-size: 1.25rem;
}

.receipt-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.receipt-info-grid > div,
.receipt-address {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.receipt-info-grid span,
.receipt-address span,
.receipt-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.daily-closing-section {
  border-left: 5px solid rgba(13, 59, 102, 0.18);
}

.daily-closing-overview {
  border-left-color: var(--brand-orange);
}

.daily-closing-overview > .section-heading {
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.daily-closing-section .alert {
  border-radius: 8px;
  font-weight: 800;
}

.daily-closing-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.daily-closing-kpi-grid > div {
  background: #fffdf8;
  box-shadow: 0 10px 28px rgba(13, 59, 102, 0.04);
}

.daily-closing-kpi-grid strong,
.daily-closing-card .receipt-info-grid strong {
  color: var(--brand-blue);
  font-size: 1.08rem;
  font-weight: 900;
}

.daily-closing-kpi-grid .text-success,
.daily-closing-card .text-success {
  color: #087f5b !important;
}

.daily-closing-kpi-grid .text-danger,
.daily-closing-card .text-danger {
  color: #d72600 !important;
}

.daily-closing-card-row {
  margin-top: 6px;
}

.daily-closing-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--brand-blue);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(13, 59, 102, 0.06);
}

.daily-closing-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-blue);
}

.daily-closing-card-title i {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: var(--ink);
  background: var(--brand-gold);
}

.daily-closing-card-title strong {
  font-size: 1.08rem;
  font-weight: 900;
}

.daily-closing-card .receipt-info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.daily-closing-card .receipt-info-grid > div {
  background: #fffaf0;
}

.receipt-address {
  margin-bottom: 18px;
}

.evidence-frame {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.evidence-frame span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.receipt-evidence {
  margin-bottom: 18px;
}

.purchase-proof-card {
  overflow: hidden;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.purchase-proof-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff4cf;
}

.purchase-proof-header h3 {
  margin: 0;
  font-size: clamp(1.25rem, 1rem + 0.8vw, 2rem);
  font-weight: 800;
  letter-spacing: 0;
}

.purchase-proof-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
  padding: 22px 24px 12px;
}

.purchase-proof-metrics div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.purchase-proof-metrics span {
  color: var(--muted);
  font-size: clamp(1rem, 0.92rem + 0.35vw, 1.35rem);
  white-space: nowrap;
}

.purchase-proof-metrics strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: clamp(1.12rem, 1rem + 0.55vw, 1.6rem);
  font-weight: 800;
}

.purchase-proof-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 18px 24px 24px;
}

.purchase-proof-image {
  display: grid;
  gap: 10px;
  text-align: center;
}

.purchase-proof-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
}

.purchase-proof-image span {
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 800;
}

.purchase-proof-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 24px 24px;
}

.purchase-proof-extra a {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-orange-deep);
  background: var(--surface);
  font-weight: 800;
  text-decoration: none;
}

.purchase-item-detail-list {
  display: grid;
  gap: 18px;
  margin: 24px 0;
}

.purchase-detail-section-title h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 900;
}

.purchase-item-detail-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(13, 59, 102, 0.08);
}

.purchase-item-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-left: 5px solid var(--brand-orange);
  background: #fff4cf;
}

.purchase-item-detail-header span,
.purchase-item-detail-header p,
.purchase-item-detail-metrics span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.purchase-item-detail-header h3,
.purchase-item-detail-header p {
  margin: 0;
}

.purchase-item-detail-header h3 {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
}

.purchase-item-detail-header > strong {
  flex: 0 0 auto;
  color: var(--brand-orange-deep);
  font-size: 1.45rem;
  font-weight: 900;
}

.purchase-item-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 6px;
}

.purchase-item-detail-metrics > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(94, 48, 22, 0.10);
  border-radius: 8px;
  background: var(--surface);
}

.purchase-item-detail-metrics strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 900;
}

.purchase-item-detail-metrics .purchase-item-note {
  grid-column: span 2;
}

.purchase-item-gallery {
  padding: 12px 18px 18px;
}

.purchase-item-gallery .purchase-proof-image img,
.purchase-proof-placeholder {
  aspect-ratio: 4 / 3;
}

.purchase-item-gallery .purchase-proof-image img {
  object-fit: contain;
}

.purchase-proof-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  border: 1px dashed rgba(94, 48, 22, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 900;
}

.receipt-address p {
  margin: 4px 0 0;
}

.receipt-table {
  min-width: 900px;
}

.receipt-table th {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

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

.receipt-summary > div {
  padding: 14px;
  border-radius: 8px;
  background: var(--surface);
}

.receipt-total {
  color: #ffffff;
  background: var(--brand-orange) !important;
}

.receipt-total span {
  color: rgba(255, 243, 216, 0.84);
}

.receipt-total strong {
  font-size: 1.35rem;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 52px;
}

.signature-grid > div {
  min-height: 72px;
  border-top: 1px solid var(--ink);
  text-align: center;
}

.signature-grid span {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.document-body {
  min-height: 100vh;
  padding: 28px;
  background: #ece5da;
}

.document-page {
  max-width: 980px;
  margin: 0 auto;
}

.document-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

.document-sheet {
  background: #ffffff;
}

.receipt-payment-box {
  margin-top: 22px;
  padding: 28px;
  border: 2px solid var(--brand-orange);
  border-radius: 8px;
  text-align: center;
}

.receipt-payment-box span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.receipt-payment-box strong {
  display: block;
  margin: 10px 0;
  color: var(--brand-orange);
  font-size: 2.5rem;
  font-weight: 900;
}

.receipt-payment-box p {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.purchase-doc-payment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(13, 59, 102, 0.16);
  border-radius: 8px;
  background: #fffaf0;
  font-weight: 800;
}

.purchase-doc-payment-list span {
  color: #473025;
}

.purchase-template-doc {
  max-width: 900px;
  color: #111111;
}

.purchase-doc-title {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid #222222;
  text-align: center;
}

.purchase-doc-title h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 900;
}

.purchase-doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  font-weight: 700;
}

.purchase-doc-statement,
.purchase-doc-certify {
  margin: 16px 0;
  line-height: 1.75;
  font-size: 0.98rem;
}

.purchase-doc-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.purchase-doc-info-grid > div {
  padding: 8px 10px;
  border: 1px solid #222222;
  border-radius: 4px;
}

.purchase-doc-info-grid span {
  display: block;
  color: #555555;
  font-size: 0.78rem;
  font-weight: 800;
}

.purchase-doc-info-grid strong {
  overflow-wrap: anywhere;
}

.purchase-doc-section-title {
  margin: 16px 0 8px;
  font-size: 1.05rem;
  font-weight: 900;
}

.purchase-doc-table {
  min-width: 760px;
  border: 1px solid #222222;
}

.purchase-doc-table th,
.purchase-doc-table td {
  height: 38px;
  border: 1px solid #222222;
  vertical-align: middle;
}

.purchase-doc-table thead th,
.purchase-doc-table tfoot th {
  background: #f3f3f3;
  font-weight: 900;
}

.purchase-doc-amount,
.purchase-doc-transfer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #222222;
}

.purchase-doc-amount strong {
  font-size: 1.15rem;
}

.purchase-doc-amount em {
  font-style: normal;
  font-weight: 800;
}

.purchase-doc-transfer {
  border-bottom: 1px solid #222222;
}

.purchase-doc-signatures {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.purchase-doc-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  color: #444444;
  font-size: 0.9rem;
  font-weight: 700;
}

.receipt-classic-doc {
  width: 210mm;
  max-width: 210mm;
  min-height: 297mm;
  padding: 8mm 24mm 12mm;
  border: 0;
  border-radius: 0;
  color: #000000;
  font-family: "Niramit", "TH Sarabun New", "Sarabun", serif;
  box-shadow: none;
}

.classic-receipt-header {
  position: relative;
  display: grid;
  justify-items: center;
  min-height: 40px;
}

.classic-receipt-header h1 {
  margin: 0;
  padding-right: 72px;
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 1.05;
  text-align: center;
}

.classic-receipt-header img {
  position: absolute;
  top: -5px;
  right: 0;
  width: 84px;
  height: auto;
}

.classic-receipt-meta {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 18px;
  align-items: baseline;
  width: 72%;
  margin: 14px 0 8px 18px;
  font-size: 1.08rem;
}

.classic-receipt-meta strong {
  font-weight: 500;
}

.classic-receipt-statement,
.classic-receipt-certify {
  margin: 8px 0 10px;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.65;
  text-align: center;
}

.classic-receipt-statement strong {
  font-weight: 600;
}

.classic-receipt-subhead {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  margin: 4px 0 2px;
  font-size: 1.08rem;
  font-weight: 700;
  text-align: center;
}

.classic-receipt-subhead > strong {
  text-decoration: underline;
}

.classic-receipt-subhead mark {
  padding: 1px 16px;
  color: #000000;
  background: #f4ded4;
  font-weight: 800;
}

.classic-receipt-table,
.classic-payment-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  color: #000000;
  table-layout: fixed;
}

.classic-receipt-table {
  overflow: hidden;
}

.classic-col-no {
  width: 8%;
}

.classic-col-item {
  width: 35%;
}

.classic-col-price {
  width: 16%;
}

.classic-col-percent {
  width: 16%;
}

.classic-col-weight {
  width: 15%;
}

.classic-col-total {
  width: 10%;
}

.classic-receipt-table th,
.classic-receipt-table td,
.classic-payment-table th,
.classic-payment-table td {
  border: 2px solid #000000;
  vertical-align: middle;
}

.classic-receipt-table th {
  padding: 5px 6px;
  background: #d9d9d9;
  font-size: 0.98rem;
  font-weight: 700;
  text-align: center;
}

.classic-receipt-table td {
  height: 23px;
  padding: 1px 5px;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.classic-receipt-table tfoot th {
  height: 24px;
  padding: 1px 5px;
  background: #d9d9d9;
  font-size: 0.95rem;
  line-height: 1.15;
  text-align: center;
}

.classic-receipt-table tfoot th:last-child {
  padding-right: 6px;
  font-size: 1rem;
  font-weight: 800;
}

.classic-baht-symbol {
  width: 34px;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  text-align: center !important;
}

.classic-receipt-certify {
  margin-top: 28px;
  text-align: center;
}

.classic-receipt-consent {
  margin: 48px 0 54px;
  font-size: 1rem;
  line-height: 1.55;
  text-align: center;
  transform: rotate(-30deg);
  transform-origin: center;
}

.classic-id-card-proof {
  width: 76mm;
  height: 48mm;
  margin: 14px auto 12px;
  padding: 4px;
  border: 1px solid #222222;
  background: #ffffff;
  text-align: center;
  page-break-inside: avoid;
  break-inside: avoid;
}

.classic-id-card-proof span {
  display: block;
  margin-bottom: 3px;
  font-size: 0.8rem;
  font-weight: 600;
}

.classic-id-card-proof img {
  display: block;
  width: 100%;
  height: calc(100% - 20px);
  object-fit: contain;
}

.classic-payment-table {
  margin-top: 0;
  page-break-inside: avoid;
  break-inside: avoid;
}

.classic-payment-table th,
.classic-payment-table td {
  height: 28px;
  padding: 3px 8px;
  font-size: 0.98rem;
  font-weight: 400;
}

.classic-payment-table th {
  width: 35%;
  text-align: center;
}

.classic-payment-table .classic-payment-amount {
  width: 145px;
  font-size: 1.42rem;
  font-weight: 500;
  text-align: center;
}

.classic-signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  margin: 32px 0 10px;
  page-break-inside: avoid;
  break-inside: avoid;
}

.classic-signature-grid > div {
  padding-top: 8px;
  border-top: 2px dashed #000000;
  font-size: 1rem;
  text-align: center;
}

.classic-receipt-footer {
  display: flex;
  gap: 20px;
  align-items: baseline;
  margin-top: 4px;
  font-size: 1rem;
  page-break-inside: avoid;
  break-inside: avoid;
}

.classic-receipt-footer span,
.classic-receipt-footer strong {
  font-weight: 800;
}

.metal-master-grid {
  display: grid;
  gap: 18px;
}

.metal-master-block {
  padding: 18px;
  border: 1px solid rgba(123, 98, 84, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.metal-master-block header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.metal-master-block h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.mobile-sidebar {
  color: #ffffff;
  background: var(--brand-blue);
}

.fade-up {
  animation: fadeUp 520ms ease both;
}

.delay-1 {
  animation-delay: 80ms;
}

.delay-2 {
  animation-delay: 140ms;
}

.delay-3 {
  animation-delay: 200ms;
}

.delay-4 {
  animation-delay: 260ms;
}

.delay-5 {
  animation-delay: 320ms;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes flameFlicker {
  0%,
  100% {
    transform: rotate(-18deg) scale(1);
  }
  50% {
    transform: rotate(-12deg) scale(1.08);
  }
}

@keyframes slowSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .dashboard-grid,
  .workbench-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel-with-prices {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .inventory-overview,
  .stock-grid,
  .evidence-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-chart-grid {
    grid-template-columns: 1fr;
  }

  .purchase-proof-gallery {
    gap: 14px;
  }
}

@media (max-width: 991.98px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    display: none;
  }
}

@media (max-width: 720px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 260px;
  }

  .admin-topbar,
  .hero-panel,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-panel-with-prices {
    display: grid;
    min-height: 0;
    padding: 18px;
  }

  .dashboard-price-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-price-value {
    margin-left: 0;
    text-align: left;
  }

  .admin-topbar,
  .admin-content {
    padding-right: 16px;
    padding-left: 16px;
  }

  .metric-grid,
  .inventory-overview,
  .stock-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .inventory-bar-row {
    grid-template-columns: 1fr;
  }

  .inventory-bar-value {
    text-align: left;
  }

  .purchase-proof-header,
  .purchase-proof-metrics,
  .purchase-proof-gallery,
  .purchase-proof-extra,
  .purchase-item-detail-header,
  .purchase-item-detail-metrics,
  .purchase-item-gallery {
    padding-right: 16px;
    padding-left: 16px;
  }

  .purchase-proof-metrics,
  .purchase-proof-gallery,
  .purchase-item-detail-metrics {
    grid-template-columns: 1fr;
  }

  .purchase-item-detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .purchase-item-detail-metrics .purchase-item-note {
    grid-column: auto;
  }

  .purchase-proof-metrics div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .table-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .table-pagination-pages {
    justify-content: flex-start;
  }

  .hero-panel h2 {
    font-size: 2rem;
  }
}

.dashboard-hero-v2 {
  align-items: stretch;
  background: var(--brand-blue);
  border-bottom: 8px solid var(--brand-coral);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  color: #fff;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  margin-bottom: 22px;
  min-height: 300px;
  overflow: hidden;
  padding: 36px;
  position: relative;
}

.dashboard-hero-v2::after {
  border: 34px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  bottom: -90px;
  content: "";
  height: 280px;
  position: absolute;
  right: -72px;
  width: 280px;
}

.dashboard-hero-copy {
  align-self: center;
  max-width: 760px;
  position: relative;
  z-index: 1;
}

.dashboard-hero-copy h2 {
  color: #fff;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.05;
  margin-bottom: 14px;
}

.dashboard-hero-copy p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  margin-bottom: 24px;
  max-width: 720px;
}

.dashboard-price-card-v2 {
  align-self: center;
  backdrop-filter: blur(8px);
  background: rgba(255, 250, 240, 0.96);
  position: relative;
  z-index: 1;
}

.dashboard-insight-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-bottom: 22px;
}

.dashboard-chart-card {
  min-height: 320px;
}

.dashboard-donut-wrap {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: 210px minmax(0, 1fr);
}

.dashboard-donut {
  align-items: center;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at center, var(--panel-bg) 0 48%, transparent 49%),
    conic-gradient(var(--brand-yellow) 0 45%, var(--brand-coral) 45% 75%, var(--brand-blue) 75% 100%);
  border-radius: 999px;
  display: grid;
  justify-items: center;
  margin: 0 auto;
  max-width: 210px;
  width: 100%;
}

.dashboard-donut div {
  text-align: center;
}

.dashboard-donut strong {
  color: var(--brand-blue);
  display: block;
  font-size: 1.35rem;
}

.dashboard-donut span {
  color: var(--muted-text);
  font-size: 0.9rem;
}

.dashboard-chart-list,
.dashboard-bar-list {
  display: grid;
  gap: 12px;
}

.dashboard-chart-row {
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 12px;
}

.dashboard-chart-row div {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.dashboard-chart-row small,
.dashboard-bar-row small {
  color: var(--muted-text);
}

.dashboard-chart-dot {
  background: var(--brand-yellow);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(244, 211, 94, 0.22);
  display: inline-flex;
  height: 10px;
  width: 10px;
}

.dashboard-chart-row:nth-child(2) .dashboard-chart-dot {
  background: var(--brand-coral);
  box-shadow: 0 0 0 4px rgba(249, 87, 56, 0.18);
}

.dashboard-chart-row:nth-child(3) .dashboard-chart-dot {
  background: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(13, 59, 102, 0.18);
}

.dashboard-bar-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 150px minmax(0, 1fr) 64px;
  padding: 10px 0;
}

.dashboard-bar-label strong,
.dashboard-bar-label span {
  display: block;
}

.dashboard-bar-label span {
  color: var(--muted-text);
  font-size: 0.9rem;
}

.dashboard-bar-track {
  background: #edf2f7;
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
}

.dashboard-bar-track span {
  background: linear-gradient(90deg, var(--brand-yellow), var(--brand-coral));
  border-radius: inherit;
  display: block;
  height: 100%;
}

.dashboard-chart-empty {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 210px;
}

.dashboard-workbench-clean {
  align-items: stretch;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.6fr);
}

.dashboard-stock-grid {
  grid-template-columns: 1fr;
}

@media (max-width: 1200px) {
  .dashboard-hero-v2,
  .dashboard-insight-grid,
  .dashboard-workbench-clean {
    grid-template-columns: 1fr;
  }

  .dashboard-donut-wrap {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-hero-v2 {
    padding: 24px;
  }

  .dashboard-donut-wrap,
  .dashboard-bar-row {
    grid-template-columns: 1fr;
  }

  .dashboard-donut {
    max-width: 180px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 1cm;
  }

  body {
    background: #ffffff;
  }

  .admin-sidebar,
  .admin-topbar,
  .no-print,
  .mobile-sidebar {
    display: none !important;
  }

  .admin-shell,
  .admin-main {
    display: block;
    min-height: auto;
  }

  .admin-content {
    padding: 0;
  }

  .document-body,
  .document-page {
    padding: 0;
    max-width: none;
    background: #ffffff;
  }

  .receipt-sheet {
    max-width: none;
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .receipt-classic-doc {
    width: 170mm;
    max-width: 100%;
    min-height: calc(297mm - 2cm);
    margin: 0 auto;
    padding: 0 !important;
  }

  .classic-payment-table,
  .classic-signature-grid,
  .classic-receipt-footer {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}
