:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 5%);
  --shadow-md: 0 10px 30px rgb(15 23 42 / 8%);
  --sidebar-width: 256px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

svg {
  flex: 0 0 auto;
}

.hidden {
  display: none !important;
}

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

/* Login */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 15% 15%, rgb(219 234 254 / 60%), transparent 32%),
    radial-gradient(circle at 85% 80%, rgb(224 231 255 / 55%), transparent 30%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 26px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 6px 16px rgb(37 99 235 / 22%);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
}

.input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  transition: border-color 160ms, box-shadow 160ms;
}

.input::placeholder {
  color: var(--muted-light);
}

.input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px #dbeafe;
}

.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.checkbox-label input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.text-link {
  color: var(--primary);
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 650;
  transition: background 160ms, border-color 160ms, color 160ms, box-shadow 160ms;
}

.button:focus-visible,
.icon-button:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.button-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: var(--shadow-sm);
}

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

.button-secondary {
  border-color: var(--line);
  color: var(--text-soft);
  background: var(--surface);
}

.button-secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.button-danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.button-block {
  width: 100%;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.demo-hint {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-header {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

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

.sidebar-brand .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.sidebar-brand .brand-mark svg {
  width: 19px;
}

.sidebar-brand-copy {
  min-width: 0;
}

.sidebar-brand-copy .brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 18px 12px;
  overflow-y: auto;
}

.nav-section + .nav-section {
  margin-top: 22px;
}

.nav-section-title {
  margin: 0 10px 8px;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 550;
  text-align: left;
  transition: color 160ms, background 160ms;
}

.nav-link svg {
  width: 18px;
  height: 18px;
}

.nav-link:hover {
  color: var(--text-soft);
  background: var(--surface-soft);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-badge {
  min-width: 20px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.user-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  font-size: 13px;
  font-weight: 700;
}

.user-copy {
  min-width: 0;
  flex: 1;
}

.user-name {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-email {
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(12px);
}

.mobile-menu-button {
  display: none;
}

.topbar-spacer {
  flex: 1;
}

.topbar-search {
  position: relative;
  width: min(340px, 36vw);
}

.topbar-search svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  height: 40px;
  padding: 9px 12px 9px 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--surface-soft);
  font-size: 13px;
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
}

.topbar-search input:focus {
  border-color: #93c5fd;
  background: var(--surface);
  box-shadow: 0 0 0 3px #eff6ff;
}

.icon-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  transition: color 160ms, background 160ms, border-color 160ms;
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--text-soft);
  background: var(--surface-soft);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ef4444;
}

.popover-wrap {
  position: relative;
}

.popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  width: 280px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.popover-title {
  padding: 8px 10px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.popover-item {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  color: var(--text-soft);
  background: transparent;
  font-size: 13px;
  text-align: left;
}

.popover-item:hover {
  background: var(--surface-soft);
}

.popover-item svg {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--muted);
}

.notification-item strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 13px;
}

.notification-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.content {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.page-description {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Cards and metrics */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.metric-card,
.card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.metric-card::after {
  position: absolute;
  top: -32px;
  right: -32px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--tint, #eff6ff);
  content: "";
  opacity: 0.8;
}

.metric-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.metric-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: var(--accent, var(--primary));
  background: var(--tint, var(--primary-soft));
}

.metric-icon svg {
  width: 19px;
  height: 19px;
}

.metric-value {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.metric-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 700;
}

.trend.up {
  color: var(--success);
}

.trend.down {
  color: var(--danger);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.85fr);
  gap: 20px;
  margin-bottom: 20px;
}

.card {
  min-width: 0;
  border-radius: var(--radius-lg);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 20px;
  border-bottom: 1px solid var(--line);
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.card-body {
  padding: 20px;
}

.chart {
  width: 100%;
  height: 250px;
  overflow: visible;
}

.chart-grid {
  stroke: #e2e8f0;
  stroke-dasharray: 4 5;
  stroke-width: 1;
}

.chart-area {
  fill: url("#areaGradient");
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-dot {
  fill: #fff;
  stroke: var(--primary);
  stroke-width: 3;
}

.chart-label {
  fill: var(--muted);
  font-size: 11px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.donut-wrap {
  display: grid;
  place-items: center;
  padding: 24px 20px 14px;
}

.donut {
  position: relative;
  display: grid;
  width: 164px;
  height: 164px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0 48%, #22c55e 48% 74%, #f59e0b 74% 89%, #e2e8f0 89% 100%);
}

.donut::before {
  position: absolute;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 25px;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.donut-center span {
  color: var(--muted);
  font-size: 11px;
}

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

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.donut-legend-item i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color);
}

.donut-legend-item strong {
  margin-left: auto;
  color: var(--text-soft);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fbfdff;
}

.primary-cell {
  color: var(--text);
  font-weight: 650;
}

.cell-with-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}

.cell-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 750;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-success {
  color: var(--success);
  background: var(--success-soft);
}

.status-warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-info {
  color: var(--primary);
  background: var(--primary-soft);
}

.status-neutral {
  color: var(--muted);
  background: #f1f5f9;
}

.table-action {
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--primary);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.table-action:hover {
  background: var(--primary-soft);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.toolbar-search {
  position: relative;
  width: min(320px, 100%);
}

.toolbar-search svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
}

.toolbar-search .input {
  min-height: 38px;
  padding-left: 35px;
}

.toolbar-spacer {
  flex: 1;
}

.select {
  min-height: 38px;
  padding: 8px 32px 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  font-size: 13px;
}

.select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px #eff6ff;
}

.empty-state {
  padding: 54px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  color: var(--muted-light);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.page-buttons {
  display: flex;
  gap: 5px;
}

.page-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

.page-button.active {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

/* Products and reports */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms, box-shadow 160ms;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-visual {
  display: grid;
  height: 128px;
  place-items: center;
  color: var(--primary);
  background:
    linear-gradient(135deg, rgb(255 255 255 / 60%), rgb(255 255 255 / 0%)),
    var(--product-bg, #eff6ff);
}

.product-visual svg {
  width: 44px;
  height: 44px;
}

.product-info {
  padding: 17px;
}

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

.product-name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.product-sku {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.product-price {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.bar-chart {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  height: 220px;
  padding: 10px 4px 0;
}

.bar-column {
  display: flex;
  height: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 8px;
}

.bar-track {
  display: flex;
  width: 100%;
  max-width: 36px;
  height: 100%;
  align-items: end;
  border-radius: 7px 7px 3px 3px;
  background: #f1f5f9;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #60a5fa, var(--primary));
}

.bar-label {
  color: var(--muted);
  font-size: 11px;
}

.progress-list {
  display: grid;
  gap: 19px;
}

.progress-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 13px;
}

.progress-item-head strong {
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--fill, var(--primary));
}

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 20px;
}

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

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

.form-grid .field-full {
  grid-column: 1 / -1;
}

.textarea {
  min-height: 104px;
  resize: vertical;
}

.settings-note {
  padding: 18px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  color: #1e40af;
  background: #eff6ff;
  font-size: 13px;
  line-height: 1.65;
}

.settings-note strong {
  display: block;
  margin-bottom: 6px;
  color: #1e3a8a;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.toggle-row:last-child {
  border-bottom: 0;
}

.toggle-copy strong {
  display: block;
  font-size: 13px;
}

.toggle-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 160ms;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 25%);
  content: "";
  transition: transform 160ms;
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(18px);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  padding: 13px 16px;
  border: 1px solid #bbf7d0;
  border-radius: 11px;
  color: #166534;
  background: #f0fdf4;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 600;
  animation: toast-in 180ms ease-out;
}

.toast svg {
  width: 18px;
  height: 18px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    width: min(286px, 88vw);
    box-shadow: var(--shadow-md);
    transition: transform 200ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    background: rgb(15 23 42 / 38%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms;
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-button {
    display: grid;
  }

  .topbar {
    padding: 12px 16px;
  }

  .topbar-search {
    display: none;
  }

  .content {
    padding: 22px 16px 34px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 20px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .button {
    flex: 1;
  }

  .metric-grid,
  .product-grid,
  .report-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid .field-full {
    grid-column: auto;
  }

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

  .toolbar-search {
    width: 100%;
  }

  .toolbar .select {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .login-card {
    padding: 22px 20px;
  }

  .content {
    padding-inline: 13px;
  }

  .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-value {
    font-size: 25px;
  }

  .card-header,
  .card-body,
  .toolbar {
    padding-inline: 16px;
  }

  .page-title {
    font-size: 22px;
  }
}



/* Purchase requisition */
.purchase-sheet-card {
  overflow: hidden;
}

.purchase-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.purchase-sheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.purchase-sheet-table {
  width: 100%;
  min-width: 1540px;
  border-collapse: collapse;
  table-layout: fixed;
}

.purchase-sheet-table th,
.purchase-sheet-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.purchase-sheet-table th:last-child,
.purchase-sheet-table td:last-child {
  border-right: 0;
}

.purchase-sheet-table tbody tr:last-child td {
  border-bottom: 0;
}

.purchase-sheet-table th {
  height: 44px;
  padding: 10px 9px;
  color: var(--text-soft);
  background: #f8fafc;
  font-size: 11px;
  font-weight: 750;
  text-align: left;
  white-space: nowrap;
}

.purchase-sheet-table td {
  height: 50px;
  padding: 6px 7px;
  background: var(--surface);
}

.purchase-sheet-table tbody tr:hover td {
  background: #fbfdff;
}

.purchase-sheet-table th:nth-child(1),
.purchase-sheet-table td:nth-child(1) {
  width: 136px;
}

.purchase-sheet-table th:nth-child(2),
.purchase-sheet-table td:nth-child(2) {
  width: 136px;
}

.purchase-sheet-table th:nth-child(3),
.purchase-sheet-table td:nth-child(3) {
  width: 170px;
}

.purchase-sheet-table th:nth-child(4),
.purchase-sheet-table td:nth-child(4),
.purchase-sheet-table th:nth-child(8),
.purchase-sheet-table td:nth-child(8),
.purchase-sheet-table th:nth-child(10),
.purchase-sheet-table td:nth-child(10) {
  width: 92px;
}

.purchase-sheet-table th:nth-child(5),
.purchase-sheet-table td:nth-child(5) {
  width: 126px;
}

.purchase-sheet-table th:nth-child(6),
.purchase-sheet-table td:nth-child(6) {
  width: 170px;
}

.purchase-sheet-table th:nth-child(7),
.purchase-sheet-table td:nth-child(7),
.purchase-sheet-table th:nth-child(9),
.purchase-sheet-table td:nth-child(9) {
  width: 136px;
}

.purchase-sheet-table th:nth-child(11),
.purchase-sheet-table td:nth-child(11) {
  width: 220px;
}

.purchase-cell-input {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  outline: none;
  color: var(--text-soft);
  background: transparent;
  font-size: 12px;
  transition: border-color 150ms, background 150ms, box-shadow 150ms;
}

.purchase-cell-input::placeholder {
  color: #b6c0cd;
}

.purchase-cell-input:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.purchase-cell-input:focus {
  border-color: #93c5fd;
  background: var(--surface);
  box-shadow: 0 0 0 3px #eff6ff;
}

.purchase-cell-number {
  text-align: right;
}

.purchase-cell-input[type="date"] {
  color-scheme: light;
}

.purchase-image-column {
  padding: 5px !important;
  text-align: center;
}

.purchase-sku-image {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-light);
  background: var(--surface-soft);
}

.purchase-sku-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.purchase-image-empty {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #b6c0cd;
}

.purchase-image-missing {
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
}

@media (max-width: 820px) {
  .purchase-sheet-header {
    align-items: stretch;
    flex-direction: column;
    padding-inline: 16px;
  }

  .purchase-sheet-actions,
  .purchase-sheet-actions .button {
    width: 100%;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  body {
    background: #fff;
  }

  .app-shell {
    display: block;
  }

  .sidebar,
  .topbar,
  .page-header,
  .purchase-sheet-actions,
  .no-print {
    display: none !important;
  }

  .content {
    max-width: none;
    padding: 0;
  }

  .purchase-sheet-card {
    border: 0;
    box-shadow: none;
  }

  .purchase-sheet-wrap {
    overflow: visible;
  }

  .purchase-sheet-table {
    min-width: 0;
    font-size: 8px;
  }

  .purchase-sheet-table th,
  .purchase-sheet-table td {
    padding: 4px 3px;
  }

  .purchase-cell-input {
    min-height: 26px;
    padding: 3px;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 8px;
  }

  .purchase-cell-input::placeholder {
    color: transparent;
  }

  .purchase-sku-image {
    border: 0;
    background: transparent;
  }
}


/* SKU image library */
.sku-library-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.62fr) minmax(0, 1.38fr);
  gap: 20px;
  align-items: start;
}

.sku-upload-form {
  display: grid;
  gap: 16px;
}

.file-input {
  padding: 8px 10px;
}

.file-input::file-selector-button {
  margin-right: 10px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--primary);
  background: var(--primary-soft);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.sku-upload-preview {
  display: grid;
  min-height: 170px;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 16px;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
}

.sku-upload-preview img {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.sku-upload-preview strong {
  color: var(--text-soft);
  font-size: 13px;
}

.sku-upload-preview span {
  color: var(--muted);
  font-size: 11px;
}

.sku-library-table {
  min-width: 680px;
}

.sku-code {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
}

.sku-library-thumb {
  width: 50px;
  height: 50px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.sku-library-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sku-image-path {
  display: block;
  max-width: 290px;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-delete-action {
  color: var(--danger);
}

.sku-delete-action:hover {
  background: var(--danger-soft);
}

@media (max-width: 1050px) {
  .sku-library-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Roles and permissions */
.demo-hint strong,
.demo-hint span {
  display: block;
}

.demo-hint strong {
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.demo-hint span + span {
  margin-top: 3px;
}

.button:disabled,
.icon-button:disabled,
.purchase-cell-input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.purchase-cell-input:disabled {
  background: #f8fafc;
}

.team-layout {
  display: grid;
  gap: 20px;
}

.team-table {
  min-width: 780px;
}

.team-select {
  min-width: 150px;
}

.current-user-badge {
  margin-left: 6px;
}

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

.permission-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 17px;
}

.permission-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-soft);
}

.permission-card h3 {
  margin: 1px 0 0;
  font-size: 14px;
  font-weight: 750;
}

.permission-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.permission-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 13px 15px;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  color: #92400e;
  background: #fffbeb;
  font-size: 12px;
  line-height: 1.6;
}

.permission-note svg {
  margin-top: 1px;
  flex: 0 0 auto;
}

@media (max-width: 1100px) {
  .permission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .permission-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Updated purchase columns */
.purchase-sheet-table {
  min-width: 1840px;
}

.purchase-sheet-table th:nth-child(1),
.purchase-sheet-table td:nth-child(1) {
  width: 76px;
}

.purchase-sheet-table th:nth-child(2),
.purchase-sheet-table td:nth-child(2) {
  width: 130px;
}

.purchase-sheet-table th:nth-child(3),
.purchase-sheet-table td:nth-child(3) {
  width: 160px;
}

.purchase-sheet-table th:nth-child(4),
.purchase-sheet-table td:nth-child(4),
.purchase-sheet-table th:nth-child(6),
.purchase-sheet-table td:nth-child(6) {
  width: 220px;
}

.purchase-sheet-table th:nth-child(5),
.purchase-sheet-table td:nth-child(5),
.purchase-sheet-table th:nth-child(10),
.purchase-sheet-table td:nth-child(10),
.purchase-sheet-table th:nth-child(11),
.purchase-sheet-table td:nth-child(11) {
  width: 100px;
}

.purchase-sheet-table th:nth-child(7),
.purchase-sheet-table td:nth-child(7) {
  width: 150px;
}

.purchase-sheet-table th:nth-child(8),
.purchase-sheet-table td:nth-child(8) {
  width: 180px;
}

.purchase-sheet-table th:nth-child(9),
.purchase-sheet-table td:nth-child(9) {
  width: 160px;
}

.purchase-sheet-table th:nth-child(12),
.purchase-sheet-table td:nth-child(12) {
  width: 240px;
}

@media print {
  .purchase-sheet-table,
  .purchase-cell-input {
    font-size: 7px;
  }
}


/* SKU library product fields */
.sku-library-page {
  display: grid;
  gap: 20px;
}

.sku-upload-form-inline {
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1fr) minmax(180px, 0.7fr) auto;
  align-items: end;
}

.sku-upload-preview-inline {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-style: solid;
}

.sku-library-table-wrap {
  border-top: 1px solid var(--line);
}

.sku-library-fields-table {
  min-width: 1840px;
}

.sku-library-fields-table .purchase-cell-input {
  min-width: 0;
}

@media (max-width: 1100px) {
  .sku-upload-form-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sku-upload-form-inline {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Keep the brand subtitle on a single line below the English name. */
.brand-name,
.brand-subtitle {
  display: block;
  width: 100%;
  white-space: nowrap;
}

.sidebar-brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: visible;
}

.sidebar-brand-copy .brand-name {
  order: 1;
}

.sidebar-brand-copy .brand-subtitle {
  order: 2;
}


/* Image paste hint is shown directly in the upload preview. */


.file-picker-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  gap: 9px;
  padding: 6px 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.file-picker-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-picker-button {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 650;
}

.file-picker-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-paste-hint {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .file-picker-shell {
    flex-wrap: wrap;
  }

  .file-picker-name {
    flex-basis: calc(100% - 90px);
  }

  .file-paste-hint {
    flex-basis: 100%;
    padding-left: 58px;
  }
}


/* Consistent typography in SKU image upload controls */
.sku-upload-form .input,
.file-picker-button,
.file-picker-name,
.file-paste-hint,
.sku-upload-preview-inline span {
  font-size: 13px;
}

.file-picker-button {
  font-weight: 650;
}

.file-picker-name,
.file-paste-hint,
.sku-upload-preview-inline span {
  line-height: 1.4;
}


/* SKU image preview */
.sku-image-preview-button {
  padding: 0;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.sku-image-preview-button img {
  transition: transform 160ms ease;
}

.sku-image-preview-button:hover img {
  transform: scale(1.06);
}

.image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(15 23 42 / 62%);
  backdrop-filter: blur(6px);
}

.image-preview-dialog {
  position: relative;
  display: grid;
  max-width: min(920px, 92vw);
  max-height: 92vh;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgb(15 23 42 / 35%);
}

.image-preview-dialog img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 100px);
  object-fit: contain;
  border-radius: 12px;
  background: var(--surface-soft);
}

.image-preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-soft);
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow-sm);
}

.image-preview-caption {
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}


/* Simplified purchase request columns */
#purchase-form .purchase-sheet-table {
  min-width: 1200px;
}

#purchase-form .purchase-sheet-table th:nth-child(1),
#purchase-form .purchase-sheet-table td:nth-child(1) {
  width: 76px;
}

#purchase-form .purchase-sheet-table th:nth-child(2),
#purchase-form .purchase-sheet-table td:nth-child(2) {
  width: 140px;
}

#purchase-form .purchase-sheet-table th:nth-child(3),
#purchase-form .purchase-sheet-table td:nth-child(3) {
  width: 260px;
}

#purchase-form .purchase-sheet-table th:nth-child(4),
#purchase-form .purchase-sheet-table td:nth-child(4) {
  width: 120px;
}

#purchase-form .purchase-sheet-table th:nth-child(5),
#purchase-form .purchase-sheet-table td:nth-child(5) {
  width: 320px;
}

#purchase-form .purchase-sheet-table th:nth-child(6),
#purchase-form .purchase-sheet-table td:nth-child(6) {
  width: 284px;
}


/* Purchase quantity column */
#purchase-form .purchase-sheet-table {
  min-width: 1320px;
}

#purchase-form .purchase-sheet-table th:nth-child(4),
#purchase-form .purchase-sheet-table td:nth-child(4) {
  width: 100px;
}

#purchase-form .purchase-sheet-table th:nth-child(5),
#purchase-form .purchase-sheet-table td:nth-child(5) {
  width: 120px;
}

#purchase-form .purchase-sheet-table th:nth-child(6),
#purchase-form .purchase-sheet-table td:nth-child(6) {
  width: 300px;
}

#purchase-form .purchase-sheet-table th:nth-child(7),
#purchase-form .purchase-sheet-table td:nth-child(7) {
  width: 284px;
}


/* Purchase amount column */
#purchase-form .purchase-sheet-table {
  min-width: 1410px;
}

#purchase-form .purchase-sheet-table th:nth-child(6),
#purchase-form .purchase-sheet-table td:nth-child(6) {
  width: 130px;
  text-align: left;
}

#purchase-form .purchase-sheet-table th:nth-child(7),
#purchase-form .purchase-sheet-table td:nth-child(7) {
  width: 300px;
}

#purchase-form .purchase-sheet-table th:nth-child(8),
#purchase-form .purchase-sheet-table td:nth-child(8) {
  width: 284px;
}

.purchase-amount-cell {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}


/* Left-align all purchase request detail content */
#purchase-form .purchase-sheet-table th,
#purchase-form .purchase-sheet-table td,
#purchase-form .purchase-cell-number,
#purchase-form .purchase-amount-cell {
  text-align: left;
}


.purchase-synced-cell {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}


/* Purchase supplier name column */
#purchase-form .purchase-sheet-table {
  min-width: 1640px;
}

#purchase-form .purchase-sheet-table th:nth-child(7),
#purchase-form .purchase-sheet-table td:nth-child(7) {
  width: 200px;
}

#purchase-form .purchase-sheet-table th:nth-child(8),
#purchase-form .purchase-sheet-table td:nth-child(8) {
  width: 300px;
}

#purchase-form .purchase-sheet-table th:nth-child(9),
#purchase-form .purchase-sheet-table td:nth-child(9) {
  width: 284px;
}

/* Supplier name in SKU library */
.sku-library-fields-table {
  min-width: 2000px;
}


/* Purchase request without price and amount */
#purchase-form .purchase-sheet-table {
  min-width: 1380px;
}

#purchase-form .purchase-sheet-table th:nth-child(4),
#purchase-form .purchase-sheet-table td:nth-child(4) {
  width: 100px;
}

#purchase-form .purchase-sheet-table th:nth-child(5),
#purchase-form .purchase-sheet-table td:nth-child(5) {
  width: 200px;
}

#purchase-form .purchase-sheet-table th:nth-child(6),
#purchase-form .purchase-sheet-table td:nth-child(6) {
  width: 320px;
  text-align: left;
}

#purchase-form .purchase-sheet-table th:nth-child(7),
#purchase-form .purchase-sheet-table td:nth-child(7) {
  width: 284px;
}


/* Create user dialog */
.create-user-dialog {
  width: min(680px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgb(15 23 42 / 35%);
}

.create-user-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.create-user-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
}

.create-user-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.create-user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}


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

.muted-text {
  color: var(--muted-light);
}


/* Purchase workflow */
.workflow-table {
  min-width: 800px;
}

.empty-notifications {
  padding: 22px 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}


.sku-clear-action {
  color: var(--danger);
  white-space: nowrap;
}

.sku-clear-action:hover {
  background: var(--danger-soft);
}


.sku-library-fields-table {
  min-width: 2090px;
}


/* Purchase application tabs and date column */
.purchase-page {
  display: grid;
  gap: 16px;
}

.purchase-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.purchase-tab {
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.purchase-tab.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.purchase-tab span {
  margin-left: 4px;
  font-size: 11px;
}

#purchase-form .purchase-sheet-table {
  min-width: 1520px;
}

#purchase-form .purchase-sheet-table th:nth-child(1),
#purchase-form .purchase-sheet-table td:nth-child(1) {
  width: 136px;
}

#purchase-form .purchase-sheet-table th:nth-child(2),
#purchase-form .purchase-sheet-table td:nth-child(2) {
  width: 76px;
}

#purchase-form .purchase-sheet-table th:nth-child(3),
#purchase-form .purchase-sheet-table td:nth-child(3) {
  width: 140px;
}

#purchase-form .purchase-sheet-table th:nth-child(4),
#purchase-form .purchase-sheet-table td:nth-child(4) {
  width: 260px;
}

#purchase-form .purchase-sheet-table th:nth-child(5),
#purchase-form .purchase-sheet-table td:nth-child(5) {
  width: 100px;
}

#purchase-form .purchase-sheet-table th:nth-child(6),
#purchase-form .purchase-sheet-table td:nth-child(6) {
  width: 200px;
}

#purchase-form .purchase-sheet-table th:nth-child(7),
#purchase-form .purchase-sheet-table td:nth-child(7) {
  width: 300px;
}

#purchase-form .purchase-sheet-table th:nth-child(8),
#purchase-form .purchase-sheet-table td:nth-child(8) {
  width: 284px;
}


/* SKU library row number */
.sku-library-fields-table {
  min-width: 2140px;
}

.sku-row-number {
  width: 54px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}


/* Purchase request detail modal */
.request-detail-dialog {
  width: min(1120px, 94vw);
  max-height: 92vh;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgb(15 23 42 / 35%);
}

.request-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.request-detail-header h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 750;
}

.request-detail-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.request-detail-table-wrap {
  max-height: calc(92vh - 90px);
  overflow: auto;
}

.request-detail-table {
  min-width: 980px;
}


.sku-library-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}


/* Final SKU library column sizing */
.sku-library-fields-table {
  min-width: 2070px;
  table-layout: fixed;
}

.sku-library-fields-table th,
.sku-library-fields-table td {
  padding-inline: 8px;
}

.sku-library-fields-table th:nth-child(1),
.sku-library-fields-table td:nth-child(1) {
  width: 52px;
}

.sku-library-fields-table th:nth-child(2),
.sku-library-fields-table td:nth-child(2) {
  width: 72px;
}

.sku-library-fields-table th:nth-child(3),
.sku-library-fields-table td:nth-child(3) {
  width: 120px;
}

.sku-library-fields-table th:nth-child(4),
.sku-library-fields-table td:nth-child(4) {
  width: 140px;
}

.sku-library-fields-table th:nth-child(5),
.sku-library-fields-table td:nth-child(5) {
  width: 220px;
}

.sku-library-fields-table th:nth-child(6),
.sku-library-fields-table td:nth-child(6) {
  width: 82px;
}

.sku-library-fields-table th:nth-child(7),
.sku-library-fields-table td:nth-child(7) {
  width: 160px;
}

.sku-library-fields-table th:nth-child(8),
.sku-library-fields-table td:nth-child(8) {
  width: 220px;
}

.sku-library-fields-table th:nth-child(9),
.sku-library-fields-table td:nth-child(9) {
  width: 130px;
}

.sku-library-fields-table th:nth-child(10),
.sku-library-fields-table td:nth-child(10) {
  width: 180px;
}

.sku-library-fields-table th:nth-child(11),
.sku-library-fields-table td:nth-child(11) {
  width: 130px;
}

.sku-library-fields-table th:nth-child(12),
.sku-library-fields-table td:nth-child(12),
.sku-library-fields-table th:nth-child(13),
.sku-library-fields-table td:nth-child(13) {
  width: 90px;
}

.sku-library-fields-table th:nth-child(14),
.sku-library-fields-table td:nth-child(14) {
  width: 200px;
}

.sku-library-fields-table th:nth-child(15),
.sku-library-fields-table td:nth-child(15) {
  width: 200px;
}

.sku-approval-actions {
  white-space: normal;
}


/* SKU library with store column */
.sku-library-fields-table {
  min-width: 2250px;
}

.sku-library-fields-table th:nth-child(1),
.sku-library-fields-table td:nth-child(1) { width: 52px; }
.sku-library-fields-table th:nth-child(2),
.sku-library-fields-table td:nth-child(2) { width: 72px; }
.sku-library-fields-table th:nth-child(3),
.sku-library-fields-table td:nth-child(3) { width: 120px; }
.sku-library-fields-table th:nth-child(4),
.sku-library-fields-table td:nth-child(4) { width: 120px; }
.sku-library-fields-table th:nth-child(5),
.sku-library-fields-table td:nth-child(5) { width: 140px; }
.sku-library-fields-table th:nth-child(6),
.sku-library-fields-table td:nth-child(6) { width: 220px; }
.sku-library-fields-table th:nth-child(7),
.sku-library-fields-table td:nth-child(7) { width: 82px; }
.sku-library-fields-table th:nth-child(8),
.sku-library-fields-table td:nth-child(8) { width: 160px; }
.sku-library-fields-table th:nth-child(9),
.sku-library-fields-table td:nth-child(9) { width: 220px; }
.sku-library-fields-table th:nth-child(10),
.sku-library-fields-table td:nth-child(10) { width: 130px; }
.sku-library-fields-table th:nth-child(11),
.sku-library-fields-table td:nth-child(11) { width: 180px; }
.sku-library-fields-table th:nth-child(12),
.sku-library-fields-table td:nth-child(12) { width: 130px; }
.sku-library-fields-table th:nth-child(13),
.sku-library-fields-table td:nth-child(13),
.sku-library-fields-table th:nth-child(14),
.sku-library-fields-table td:nth-child(14) { width: 90px; }
.sku-library-fields-table th:nth-child(15),
.sku-library-fields-table td:nth-child(15) { width: 200px; }
.sku-library-fields-table th:nth-child(16),
.sku-library-fields-table td:nth-child(16) { width: 200px; }


.team-department-input {
  min-width: 130px;
  min-height: 36px;
  padding: 7px 9px;
  font-size: 12px;
}


/* SKU store filter */
.sku-library-header-actions .select {
  min-width: 140px;
}


/* Compact final layout for SKU library */
.sku-library-fields-table {
  min-width: 1810px;
}

.sku-library-fields-table th {
  white-space: normal;
  line-height: 1.35;
  vertical-align: middle;
}

.sku-library-fields-table th:nth-child(1),
.sku-library-fields-table td:nth-child(1) { width: 46px; }
.sku-library-fields-table th:nth-child(2),
.sku-library-fields-table td:nth-child(2) { width: 64px; }
.sku-library-fields-table th:nth-child(3),
.sku-library-fields-table td:nth-child(3) { width: 110px; }
.sku-library-fields-table th:nth-child(4),
.sku-library-fields-table td:nth-child(4) { width: 100px; }
.sku-library-fields-table th:nth-child(5),
.sku-library-fields-table td:nth-child(5) { width: 130px; }
.sku-library-fields-table th:nth-child(6),
.sku-library-fields-table td:nth-child(6) { width: 190px; }
.sku-library-fields-table th:nth-child(7),
.sku-library-fields-table td:nth-child(7) { width: 70px; }
.sku-library-fields-table th:nth-child(8),
.sku-library-fields-table td:nth-child(8) { width: 140px; }
.sku-library-fields-table th:nth-child(9),
.sku-library-fields-table td:nth-child(9) { width: 170px; }
.sku-library-fields-table th:nth-child(10),
.sku-library-fields-table td:nth-child(10) { width: 110px; }
.sku-library-fields-table th:nth-child(11),
.sku-library-fields-table td:nth-child(11) { width: 150px; }
.sku-library-fields-table th:nth-child(12),
.sku-library-fields-table td:nth-child(12) { width: 110px; }
.sku-library-fields-table th:nth-child(13),
.sku-library-fields-table td:nth-child(13),
.sku-library-fields-table th:nth-child(14),
.sku-library-fields-table td:nth-child(14) { width: 80px; }
.sku-library-fields-table th:nth-child(15),
.sku-library-fields-table td:nth-child(15) { width: 170px; }
.sku-library-fields-table th:nth-child(16),
.sku-library-fields-table td:nth-child(16) { width: 190px; }

.sku-library-fields-table .purchase-cell-input {
  padding-inline: 6px;
  font-size: 11px;
}


/* Store-colored SKU rows */
.sku-library-fields-table tbody tr td {
  background: var(--store-row-bg, var(--surface));
  transition: background 140ms ease;
}

.sku-library-fields-table tbody tr:hover td {
  background: var(--store-row-bg, #fbfdff);
  filter: brightness(0.985);
}


/* Improve SKU table readability */
.sku-library-fields-table th {
  color: #334155;
  font-weight: 750;
}

.sku-library-fields-table td,
.sku-library-fields-table .purchase-cell-input {
  color: #1e293b;
}

.sku-library-fields-table .purchase-cell-input {
  font-size: 12px;
  font-weight: 500;
  background: rgb(255 255 255 / 48%);
}

.sku-library-fields-table .purchase-cell-input:disabled {
  color: #334155;
  -webkit-text-fill-color: #334155;
  opacity: 1;
  background: rgb(255 255 255 / 58%);
}

.sku-library-fields-table .sku-code {
  color: #0f172a;
  font-weight: 750;
}


/* Flat SKU table fields and store accent bars */
.sku-library-fields-table tbody tr td {
  background: var(--surface);
}

.sku-library-fields-table tbody tr td:first-child {
  box-shadow: inset 4px 0 0 var(--store-row-bg, transparent);
}

.sku-library-fields-table tbody tr:hover td {
  background: #fbfdff;
  filter: none;
}

.sku-library-fields-table .purchase-cell-input,
.sku-library-fields-table .purchase-cell-input:hover,
.sku-library-fields-table .purchase-cell-input:focus,
.sku-library-fields-table .purchase-cell-input:disabled {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sku-library-fields-table .purchase-cell-input:focus {
  box-shadow: inset 0 -2px 0 #60a5fa;
}

.sku-library-fields-table .purchase-cell-input:disabled {
  color: #334155;
  -webkit-text-fill-color: #334155;
  opacity: 1;
}


/* Procurement execution */
.procurement-execution {
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.procurement-execution-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
}

.procurement-execution-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
}

.procurement-execution-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.procurement-form-section {
  padding: 0 0 18px;
}

.procurement-table {
  min-width: 1500px;
  background: var(--surface);
}

.procurement-table th:nth-child(1),
.procurement-table td:nth-child(1) { width: 120px; }
.procurement-table th:nth-child(2),
.procurement-table td:nth-child(2) { width: 160px; }
.procurement-table th:nth-child(3),
.procurement-table td:nth-child(3) { width: 180px; }
.procurement-table th:nth-child(4),
.procurement-table td:nth-child(4),
.procurement-table th:nth-child(5),
.procurement-table td:nth-child(5) { width: 100px; }
.procurement-table th:nth-child(6),
.procurement-table td:nth-child(6),
.procurement-table th:nth-child(9),
.procurement-table td:nth-child(9) { width: 126px; }
.procurement-table th:nth-child(7),
.procurement-table td:nth-child(7),
.procurement-table th:nth-child(8),
.procurement-table td:nth-child(8) { width: 150px; }
.procurement-table th:nth-child(10),
.procurement-table td:nth-child(10) { width: 180px; }

.procurement-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 0;
}


/* Allow the request detail modal to scroll through both sections */
.request-detail-dialog {
  overflow-y: auto;
}

.request-detail-dialog > .request-detail-table-wrap {
  max-height: 44vh;
}


/* Procurement table without expected arrival */
.procurement-table {
  min-width: 1320px;
}

.procurement-table th:nth-child(1),
.procurement-table td:nth-child(1) { width: 120px; }
.procurement-table th:nth-child(2),
.procurement-table td:nth-child(2) { width: 160px; }
.procurement-table th:nth-child(3),
.procurement-table td:nth-child(3) { width: 180px; }
.procurement-table th:nth-child(4),
.procurement-table td:nth-child(4),
.procurement-table th:nth-child(5),
.procurement-table td:nth-child(5) { width: 100px; }
.procurement-table th:nth-child(6),
.procurement-table td:nth-child(6) { width: 126px; }
.procurement-table th:nth-child(7),
.procurement-table td:nth-child(7),
.procurement-table th:nth-child(8),
.procurement-table td:nth-child(8) { width: 150px; }
.procurement-table th:nth-child(9),
.procurement-table td:nth-child(9) { width: 180px; }


/* Simplified procurement execution fields */
.procurement-table {
  min-width: 1380px;
}

.procurement-table th:nth-child(1),
.procurement-table td:nth-child(1) { width: 126px; }
.procurement-table th:nth-child(2),
.procurement-table td:nth-child(2) { width: 120px; }
.procurement-table th:nth-child(3),
.procurement-table td:nth-child(3) { width: 220px; }
.procurement-table th:nth-child(4),
.procurement-table td:nth-child(4) { width: 90px; }
.procurement-table th:nth-child(5),
.procurement-table td:nth-child(5) { width: 100px; }
.procurement-table th:nth-child(6),
.procurement-table td:nth-child(6) { width: 110px; }
.procurement-table th:nth-child(7),
.procurement-table td:nth-child(7) { width: 100px; }
.procurement-table th:nth-child(8),
.procurement-table td:nth-child(8) { width: 120px; }
.procurement-table th:nth-child(9),
.procurement-table td:nth-child(9) { width: 130px; }
.procurement-table th:nth-child(10),
.procurement-table td:nth-child(10) { width: 180px; }

.procurement-money {
  color: var(--text-soft);
  font-size: 12px;
  white-space: nowrap;
}


/* Procurement table with supplier */
.procurement-table {
  min-width: 1480px;
}

.procurement-table th:nth-child(1),
.procurement-table td:nth-child(1) { width: 126px; }
.procurement-table th:nth-child(2),
.procurement-table td:nth-child(2) { width: 120px; }
.procurement-table th:nth-child(3),
.procurement-table td:nth-child(3) { width: 220px; }
.procurement-table th:nth-child(4),
.procurement-table td:nth-child(4) { width: 160px; }
.procurement-table th:nth-child(5),
.procurement-table td:nth-child(5) { width: 90px; }
.procurement-table th:nth-child(6),
.procurement-table td:nth-child(6) { width: 100px; }
.procurement-table th:nth-child(7),
.procurement-table td:nth-child(7) { width: 110px; }
.procurement-table th:nth-child(8),
.procurement-table td:nth-child(8) { width: 100px; }
.procurement-table th:nth-child(9),
.procurement-table td:nth-child(9) { width: 120px; }
.procurement-table th:nth-child(10),
.procurement-table td:nth-child(10) { width: 130px; }
.procurement-table th:nth-child(11),
.procurement-table td:nth-child(11) { width: 180px; }


/* Full-screen procurement execution only */
.image-preview-modal.procurement-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  display: block !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  overflow: auto !important;
}

.image-preview-modal.procurement-fullscreen .request-detail-dialog {
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  overflow-y: auto !important;
}

.procurement-fullscreen .request-detail-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
}


/* Supplier summary above the date table */
.procurement-groups {
  display: grid;
  gap: 18px;
  padding: 16px 22px;
}

.procurement-supplier-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.procurement-group-fields {
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.procurement-group-fields label {
  display: grid;
  min-width: 0;
  flex: 1 1 0;
  gap: 6px;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
}

.procurement-group-fields .purchase-cell-input {
  border: 1px solid #cbd5e1;
  background: #fff;
}

.procurement-group-total {
  flex: 0 0 auto;
  padding-bottom: 9px;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.procurement-group-total strong {
  margin-left: 5px;
  color: #0f172a;
  font-weight: 750;
}

@media (max-width: 900px) {
  .procurement-group-fields {
    align-items: stretch;
    flex-direction: column;
  }
}


/* Compact supplier group controls */
.procurement-group-main {
  flex: 0 0 auto;
  display: flex;
  align-items: end;
  gap: 12px;
}

.procurement-group-main label {
  flex: 0 0 auto;
}

.procurement-group-main label:nth-child(1) .purchase-cell-input {
  width: 180px;
}

.procurement-group-main label:nth-child(2) .purchase-cell-input {
  width: 90px;
}

.procurement-group-main label:nth-child(3) .purchase-cell-input {
  width: 120px;
}

.procurement-group-summary {
  margin-left: auto;
}


/* Strong visible boxes in procurement execution */
.procurement-table th,
.procurement-table td {
  border: 1px solid #cbd5e1 !important;
  background: #ffffff;
}

.procurement-table th {
  color: #334155;
  font-weight: 750;
}

.procurement-table td {
  padding: 7px !important;
}

.procurement-table .purchase-cell-input {
  min-height: 38px;
  border: 1px solid #94a3b8 !important;
  border-radius: 6px;
  background: #ffffff !important;
  color: #0f172a;
  box-shadow: 0 1px 2px rgb(15 23 42 / 8%);
}

.procurement-table .purchase-cell-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px #dbeafe !important;
}

.procurement-money {
  display: block;
  min-height: 38px;
  padding: 8px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  color: #0f172a;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 650;
  line-height: 20px;
  text-align: right;
}


/* Clean procurement table appearance */
.procurement-table {
  border-collapse: separate;
  border-spacing: 0 8px;
}

.procurement-table thead th {
  padding: 10px 12px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  background: transparent !important;
  color: #475569;
  font-size: 11px;
  font-weight: 750;
}

.procurement-table tbody tr {
  box-shadow: 0 1px 3px rgb(15 23 42 / 6%);
}

.procurement-table tbody td {
  padding: 9px 10px !important;
  border: 0 !important;
  border-top: 1px solid #e8edf4 !important;
  border-bottom: 1px solid #e8edf4 !important;
  background: #ffffff !important;
}

.procurement-table tbody td:first-child {
  border-left: 1px solid #e8edf4 !important;
  border-radius: 8px 0 0 8px;
}

.procurement-table tbody td:last-child {
  border-right: 1px solid #e8edf4 !important;
  border-radius: 0 8px 8px 0;
}

.procurement-table .purchase-cell-input {
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid transparent !important;
  border-radius: 7px;
  background: transparent !important;
  box-shadow: none !important;
  color: #0f172a;
}

.procurement-table .purchase-cell-input:hover {
  border-color: #dbe2ea !important;
  background: #f8fafc !important;
}

.procurement-table .purchase-cell-input:focus {
  border-color: #93c5fd !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px #eff6ff !important;
}

.procurement-money {
  min-height: auto;
  padding: 8px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0f172a;
  font-size: 12px;
  font-weight: 650;
  text-align: right;
}


/* Fixed widths for the actual supplier summary row */
.procurement-group-fields {
  display: flex;
  align-items: end;
  gap: 12px;
}

.procurement-group-fields > label {
  flex: 0 0 auto;
  min-width: 0;
}

.procurement-group-fields > label:nth-child(1) .purchase-cell-input {
  width: 260px;
}

.procurement-group-fields > label:nth-child(2) .purchase-cell-input {
  width: 82px;
}

.procurement-group-fields > label:nth-child(3) .purchase-cell-input {
  width: 120px;
}

.procurement-group-fields > .procurement-group-total:first-of-type {
  margin-left: auto;
}

@media (max-width: 900px) {
  .procurement-group-fields {
    align-items: stretch;
    flex-direction: column;
  }

  .procurement-group-fields > label .purchase-cell-input {
    width: 100% !important;
  }

  .procurement-group-fields > .procurement-group-total:first-of-type {
    margin-left: 0;
  }
}


/* Align procurement amounts with input rows */
.procurement-table td {
  vertical-align: middle;
}

.procurement-money {
  display: table-cell;
  height: auto;
  padding: 9px 10px;
  vertical-align: middle;
  line-height: normal;
  text-align: left;
  white-space: nowrap;
}


/* Narrow quantity and move total under remarks */
.procurement-table th:nth-child(4),
.procurement-table td:nth-child(4) {
  width: 72px;
}

.procurement-table th:nth-child(4) .purchase-cell-input,
.procurement-table td:nth-child(4) .purchase-cell-input {
  max-width: 62px;
}

.procurement-group-footer-spacer {
  border: 0 !important;
  background: transparent !important;
}

.procurement-group-footer-total {
  color: #475569;
  background: #f8fafc !important;
  font-size: 12px;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.procurement-group-footer-total strong {
  margin-left: 6px;
  color: #0f172a;
  font-size: 13px;
}


/* Narrow unit price column */
.procurement-table th:nth-child(5),
.procurement-table td:nth-child(5) {
  width: 76px;
}

.procurement-table th:nth-child(5) .purchase-cell-input,
.procurement-table td:nth-child(5) .purchase-cell-input {
  max-width: 66px;
}


/* Narrow procurement date and SKU columns */
.procurement-table th:nth-child(1),
.procurement-table td:nth-child(1) {
  width: 98px;
  white-space: nowrap;
}

.procurement-table th:nth-child(2),
.procurement-table td:nth-child(2) {
  width: 88px;
  white-space: nowrap;
}


/* Fixed procurement table columns */
.procurement-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

.procurement-table th:nth-child(1),
.procurement-table td:nth-child(1) {
  width: 100px;
}

.procurement-table th:nth-child(2),
.procurement-table td:nth-child(2) {
  width: 88px;
}

.procurement-table th:nth-child(3),
.procurement-table td:nth-child(3) {
  width: 300px;
}

.procurement-table th:nth-child(4),
.procurement-table td:nth-child(4) {
  width: 72px;
}

.procurement-table th:nth-child(5),
.procurement-table td:nth-child(5) {
  width: 76px;
}

.procurement-table th:nth-child(6),
.procurement-table td:nth-child(6) {
  width: 130px;
}

.procurement-table th:nth-child(7),
.procurement-table td:nth-child(7) {
  width: 190px;
}


/* Plain total amount footer */
.procurement-table tfoot td,
.procurement-group-footer-total {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.procurement-table tfoot tr {
  box-shadow: none !important;
}


/* Compact logistics tracking field */
.procurement-group-fields > label[for],
.procurement-group-fields > label {
  min-width: 0;
}

.procurement-group-fields > label:nth-child(2) .purchase-cell-input {
  width: 150px;
}


/* Receipt verification dialog */
.receipt-check-dialog {
  width: min(720px, 94vw);
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgb(15 23 42 / 35%);
}

.receipt-check-body {
  padding: 20px 22px;
}

.receipt-check-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px;
  border-radius: 10px;
  background: #f8fafc;
}

.receipt-check-info > div {
  display: grid;
  gap: 4px;
}

.receipt-check-info dt {
  color: var(--muted);
  font-size: 11px;
}

.receipt-check-info dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.receipt-check-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}


/* Clickable received status */
.receipt-status-button {
  border: 0;
  cursor: pointer;
}

.receipt-status-button:hover {
  filter: brightness(0.97);
}


/* Receipt check information layout */
.receipt-check-info {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 640px) {
  .receipt-check-info {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Put receipt verification content on one row */
.receipt-check-dialog {
  width: min(1100px, 96vw);
}

.receipt-check-info {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.receipt-check-body .form-grid {
  grid-template-columns: minmax(160px, 0.35fr) minmax(0, 1fr);
}

.receipt-check-body .form-grid .field-full {
  grid-column: auto;
}

@media (max-width: 800px) {
  .receipt-check-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .receipt-check-body .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Compact receipt verification inputs */
.receipt-check-dialog {
  width: min(980px, 94vw);
}

.receipt-check-body .form-grid {
  display: flex;
  align-items: end;
  gap: 16px;
}

.receipt-check-body .form-grid .field {
  flex: 0 0 auto;
}

.receipt-check-body .form-grid .field:first-child {
  width: 150px;
}

.receipt-check-body .form-grid .field:last-child {
  width: min(520px, calc(100% - 166px));
}

#receipt-quantity {
  width: 150px;
}

#receipt-note {
  width: 100%;
  min-height: 72px;
}

@media (max-width: 640px) {
  .receipt-check-body .form-grid {
    align-items: stretch;
    flex-direction: column;
  }

  .receipt-check-body .form-grid .field:first-child,
  .receipt-check-body .form-grid .field:last-child {
    width: 100%;
  }
}


/* Put receipt quantity in the summary row */
.receipt-check-info {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.receipt-quantity-field .input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.receipt-check-body .form-grid {
  display: block;
}

.receipt-check-body .form-grid .field,
.receipt-check-body .form-grid .field-full {
  width: min(560px, 100%);
  grid-column: auto;
}

@media (max-width: 900px) {
  .receipt-check-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* All receipt fields in one summary row */
.receipt-check-dialog {
  width: min(1280px, 96vw);
}

.receipt-check-info {
  grid-template-columns: 70px minmax(150px, 1.5fr) 90px 90px 100px 140px 110px minmax(180px, 1.3fr);
}

.receipt-quantity-field .input,
.receipt-note-field .input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .receipt-check-info {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .receipt-check-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Make receipt note match the other one-line fields */
#receipt-note {
  width: 100%;
  height: 34px;
  min-height: 34px;
  padding: 6px 8px;
  resize: none;
}


/* Separate receipt quantity and note fields */
.receipt-check-info {
  column-gap: 20px;
}

.receipt-quantity-field {
  padding-right: 12px;
}

.receipt-note-field {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

@media (max-width: 640px) {
  .receipt-quantity-field {
    padding-right: 0;
  }

  .receipt-note-field {
    padding-left: 0;
    border-left: 0;
  }
}


/* Final compact receipt verification layout */
.receipt-check-dialog {
  width: min(1240px, 96vw);
  background: #ffffff;
}

.receipt-check-body {
  padding: 18px 22px 22px;
}

.receipt-check-info {
  display: grid;
  grid-template-columns: 72px minmax(170px, 1.45fr) 90px 90px 100px 150px 118px minmax(200px, 1.2fr);
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 5%);
}

.receipt-check-info > div {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid #e8edf4;
}

.receipt-check-info > div:last-child {
  border-right: 0;
}

.receipt-check-info dt {
  margin-bottom: 6px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.receipt-check-info dd {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-check-info .input {
  width: 100%;
  height: 34px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.receipt-note-field {
  padding-left: 12px;
  border-left: 0 !important;
}

.receipt-check-actions {
  padding: 16px 0 0;
  border-top: 1px solid #e8edf4;
  background: transparent;
}

@media (max-width: 1000px) {
  .receipt-check-info {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .receipt-check-info > div:nth-child(4n) {
    border-right: 0;
  }

  .receipt-check-info > div:nth-child(-n + 4) {
    border-bottom: 1px solid #e8edf4;
  }
}

@media (max-width: 640px) {
  .receipt-check-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .receipt-check-info > div {
    border-bottom: 1px solid #e8edf4;
  }

  .receipt-check-info > div:nth-child(2n) {
    border-right: 0;
  }
}


/* Final compact single-row receipt fields */
.receipt-check-info {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 0;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.receipt-check-info > div,
.receipt-check-info > div:nth-child(4n),
.receipt-check-info > div:nth-child(-n + 4) {
  flex: 0 0 auto;
  min-width: 0;
  padding: 0 0 2px;
  border: 0 !important;
}

.receipt-check-info > div:nth-child(1) { width: 72px; }
.receipt-check-info > div:nth-child(2) { width: 220px; }
.receipt-check-info > div:nth-child(3) { width: 82px; }
.receipt-check-info > div:nth-child(4) { width: 84px; }
.receipt-check-info > div:nth-child(5) { width: 96px; }
.receipt-check-info > div:nth-child(6) { width: 145px; }
.receipt-check-info > div:nth-child(7) { width: 110px; }
.receipt-check-info > div:nth-child(8) { width: 240px; }

.receipt-check-info .input,
#receipt-quantity,
#receipt-note {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  box-sizing: border-box;
}

#receipt-quantity {
  width: 110px;
}

#receipt-note {
  width: 240px;
}

@media (max-width: 900px) {
  .receipt-check-info {
    align-items: stretch;
    flex-wrap: wrap;
  }
}


/* Stable one-row receipt verification table */
.receipt-check-dialog {
  width: min(1240px, 96vw);
}

.receipt-check-body {
  padding: 18px 22px 22px;
}

.receipt-check-table-wrap {
  overflow-x: auto;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #fff;
}

.receipt-check-table {
  width: 100%;
  min-width: 1078px;
  border-collapse: collapse;
  table-layout: fixed;
}

.receipt-check-table th {
  padding: 10px 10px;
  border-bottom: 1px solid #dbe2ea;
  color: #475569;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 750;
  text-align: left;
  white-space: nowrap;
}

.receipt-check-table td {
  height: 58px;
  padding: 10px;
  border-right: 1px solid #e8edf4;
  color: #334155;
  font-size: 12px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-check-table td:last-child {
  border-right: 0;
}

.receipt-check-table .input,
#receipt-quantity,
#receipt-note {
  width: 100%;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 6px 8px;
  box-sizing: border-box;
  font-size: 12px;
}


/* Receipt fields after removing purchase price and amount */
.receipt-check-info > div:nth-child(4) {
  width: 145px;
}

.receipt-check-info > div:nth-child(5) {
  width: 110px;
}

.receipt-check-info > div:nth-child(6) {
  width: 240px;
}


/* Never wrap receipt verification fields */
.receipt-check-info {
  flex-wrap: nowrap !important;
  overflow-x: auto;
}

.receipt-check-info > div {
  flex-shrink: 0 !important;
}

@media (max-width: 900px) {
  .receipt-check-info {
    align-items: flex-end;
    flex-wrap: nowrap !important;
  }
}


/* FINAL receipt verification: one data row, fixed table columns */
.receipt-check-dialog {
  width: min(1240px, 96vw) !important;
}

.receipt-check-body {
  padding: 18px 22px 22px !important;
}

.receipt-check-table-wrap {
  overflow-x: auto !important;
  border: 1px solid #dbe2ea !important;
  border-radius: 12px !important;
  background: #fff !important;
}

.receipt-check-table {
  width: 100% !important;
  min-width: 1132px !important;
  border-collapse: collapse !important;
  table-layout: fixed !important;
}

.receipt-check-table col.receipt-col-sku { width: 72px !important; }
.receipt-check-table col.receipt-col-product { width: 220px !important; }
.receipt-check-table col.receipt-col-quantity { width: 86px !important; }
.receipt-check-table col.receipt-col-tracking { width: 150px !important; }
.receipt-check-table col.receipt-col-received { width: 120px !important; }
.receipt-check-table col.receipt-col-note { width: 240px !important; }

.receipt-check-table th,
.receipt-check-table td {
  white-space: nowrap !important;
  vertical-align: middle !important;
}

.receipt-check-table th {
  padding: 10px !important;
  border-bottom: 1px solid #dbe2ea !important;
  color: #475569 !important;
  background: #f8fafc !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  text-align: left !important;
}

.receipt-check-table td {
  height: 58px !important;
  padding: 10px !important;
  border-right: 1px solid #e8edf4 !important;
  color: #334155 !important;
  font-size: 12px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.receipt-check-table td:last-child {
  border-right: 0 !important;
}

.receipt-check-table .input,
#receipt-quantity,
#receipt-note {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 6px 8px !important;
  box-sizing: border-box !important;
  font-size: 12px !important;
}


/* Receipt SKU thumbnail */
.receipt-check-table col.receipt-col-image { width: 64px !important; }

.receipt-check-table .receipt-sku-image-cell {
  padding: 5px !important;
  text-align: center !important;
}

.receipt-check-table .receipt-sku-image {
  width: 40px !important;
  height: 40px !important;
  margin: 0 auto !important;
}

.receipt-check-table .receipt-sku-image img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}


/* Keep one tracking number per supplier group in completed procurement */
.procurement-history-table .procurement-history-tracking-cell {
  vertical-align: middle !important;
  white-space: nowrap !important;
}


/* Receipt supplier column */
.receipt-check-table col.receipt-col-supplier { width: 180px !important; }


/* Compact supplier and tracking line above SKU rows */
.receipt-supplier-summary {
  display: flex !important;
  align-items: center !important;
  gap: 28px !important;
  margin: 0 0 10px !important;
  padding: 0 2px !important;
}

.receipt-supplier-summary > div {
  display: flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.receipt-supplier-summary span {
  flex: 0 0 auto !important;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.receipt-supplier-summary strong {
  max-width: 420px !important;
  overflow: hidden !important;
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.receipt-check-table {
  min-width: 802px !important;
}


/* Keep receipt actions visible and fully inside the dialog */
.image-preview-modal.receipt-check-modal {
  overflow: auto !important;
}

.receipt-check-dialog {
  display: flex !important;
  flex-direction: column !important;
  max-height: calc(100vh - 32px) !important;
  overflow: hidden !important;
}

.receipt-check-dialog .request-detail-header {
  flex: 0 0 auto !important;
}

.receipt-check-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

.receipt-check-actions {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 2 !important;
  display: flex !important;
  flex: 0 0 auto !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  padding: 14px 22px !important;
  border-top: 1px solid #e8edf4 !important;
  background: #ffffff !important;
}

.receipt-check-actions .button {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}


/* Sidebar brand name uses the primary brand color */
.sidebar-brand-copy .brand-name {
  color: var(--primary) !important;
}


/* Image preview must layer above and preserve the receipt dialog */
.sku-image-preview-modal {
  z-index: 300 !important;
}


/* Sidebar and login marks use the exact same logo as the browser tab */
.brand-mark img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: inherit !important;
}
