:root {
  --erp-bg: #f3f6fb;
  --erp-surface: #ffffff;
  --erp-sidebar: #102238;
  --erp-sidebar-deep: #071829;
  --erp-sidebar-text: #cbd8ea;
  --erp-sidebar-muted: #7890ad;
  --erp-primary: #2f73f6;
  --erp-primary-strong: #1d5fd7;
  --erp-primary-soft: #edf4ff;
  --erp-success: #20b26b;
  --erp-warning: #f59e0b;
  --erp-danger: #ef4444;
  --erp-purple: #8b5cf6;
  --erp-text: #182230;
  --erp-muted: #667085;
  --erp-border: #e6ebf2;
  --erp-border-strong: #d8e0eb;
  --erp-table-row-divider: #cbd5e1;
  --erp-table-row-alt: #fbfdff;
  --erp-shadow: 0 10px 28px rgba(15, 23, 42, .07);
  --erp-shadow-sm: 0 4px 14px rgba(15, 23, 42, .05);
  --erp-radius: 8px;
  --erp-sidebar-width: 220px;
  --erp-topbar-height: 54px;
  --bottom-nav-h: 62px;
}
* {
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--erp-bg);
}

body {
  min-height: 100vh;
  background: var(--erp-bg);
  color: var(--erp-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: .875rem;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--erp-primary);
}

a:hover {
  color: var(--erp-primary-strong);
}

.erp-topbar {
  left: var(--erp-sidebar-width);
  min-height: var(--erp-topbar-height);
  padding: 0 22px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--erp-border);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-user {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.topbar-left {
  color: var(--erp-text);
}

.sidebar-trigger {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--erp-text);
  font-size: 1.15rem;
  line-height: 1;
}

.sidebar-trigger:hover {
  background: var(--erp-primary-soft);
  color: var(--erp-primary);
}

.topbar-title {
  color: var(--erp-primary);
  font-weight: 700;
}

.welcome-text {
  color: #344054;
  font-size: .82rem;
}

.topbar-logout {
  padding: 0;
  color: #344054;
  font-size: .82rem;
  text-decoration: none;
}

.topbar-logout:hover {
  color: var(--erp-primary);
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  width: var(--erp-sidebar-width);
  overflow-y: auto;
  padding: 14px 10px 18px;
  background: linear-gradient(180deg, var(--erp-sidebar) 0%, var(--erp-sidebar-deep) 100%);
  box-shadow: 8px 0 24px rgba(7, 24, 41, .12);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  margin: 0 8px 18px;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.sidebar-logo {
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #4b91ff, #1d5fd7);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(47, 115, 246, .32);
}

.sidebar-logo .brand-mark-icon {
  width: 18px;
  height: 18px;
}

.sidebar .nav {
  gap: 2px;
}

.sidebar .nav-section {
  margin: 16px 8px 5px;
  color: var(--erp-sidebar-muted);
  font-size: .75rem;
  font-weight: 700;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 1px 0;
  padding: .42rem .72rem;
  border-radius: 7px;
  color: var(--erp-sidebar-text);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.sidebar .nav-link.active {
  background: linear-gradient(135deg, #347bff, #1d5fd7);
  color: #fff;
  box-shadow: 0 8px 20px rgba(47, 115, 246, .32);
}

.erp-main {
  min-height: 100vh;
  margin-top: var(--erp-topbar-height);
  margin-left: var(--erp-sidebar-width);
  padding: 18px 22px 28px !important;
}

.erp-main > h5:first-child,
.erp-main > .d-flex:first-child h5,
.page-title {
  color: var(--erp-text);
  font-size: 1.05rem;
  font-weight: 800;
}

.erp-main > h5:first-child,
.erp-main > .d-flex.justify-content-between.align-items-center.mb-3:first-child {
  min-height: 42px;
  margin-bottom: 14px !important;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--erp-border);
}

.erp-main > h6,
.erp-main > .h6 {
  color: #344054;
  font-size: 1rem;
  font-weight: 800;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 14px;
}

.page-kicker {
  color: var(--erp-primary);
  font-size: .75rem;
  font-weight: 800;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
}

.erp-panel,
.card,
.erp-main > table.table,
.table-responsive,
main > form.row,
.erp-main > form.row,
.erp-main > form.d-flex {
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  background: var(--erp-surface);
  box-shadow: var(--erp-shadow-sm);
}

main > form.row,
.erp-main > form.row,
.erp-main > form.d-flex {
  margin-right: 0;
  margin-left: 0;
  padding: 12px;
}

.erp-panel {
  padding: 16px;
}

.erp-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 12px;
  color: var(--erp-text);
  font-size: .95rem;
  font-weight: 800;
}

.card {
  border-color: var(--erp-border);
}

.card .card-body {
  padding: 1rem;
}

.btn {
  border-radius: 6px;
  font-weight: 700;
}

.btn-primary,
.btn-success,
.btn-info {
  border-color: var(--erp-primary);
  background: var(--erp-primary);
  box-shadow: 0 8px 18px rgba(47, 115, 246, .18);
}

.btn-primary:hover,
.btn-success:hover,
.btn-info:hover,
.btn-primary:focus,
.btn-success:focus,
.btn-info:focus {
  border-color: var(--erp-primary-strong);
  background: var(--erp-primary-strong);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-info {
  border-color: var(--erp-border-strong);
  color: var(--erp-primary);
  background: #fff;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-success:hover,
.btn-outline-info:hover {
  border-color: var(--erp-primary);
  background: var(--erp-primary-soft);
  color: var(--erp-primary);
}

.btn-outline-danger {
  border-color: #fecaca;
  color: var(--erp-danger);
}

.btn-outline-danger:hover {
  border-color: var(--erp-danger);
  background: #fff1f2;
  color: var(--erp-danger);
}

.form-control,
.form-select {
  border-color: var(--erp-border-strong);
  border-radius: 6px;
  color: var(--erp-text);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--erp-primary);
  box-shadow: 0 0 0 3px rgba(47, 115, 246, .12);
}

.nav-pills {
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  background: #fff;
  box-shadow: var(--erp-shadow-sm);
}

.nav-pills .nav-link {
  border-radius: 6px;
  color: var(--erp-muted);
  font-weight: 700;
}

.nav-pills .nav-link.active {
  background: var(--erp-primary);
  color: #fff;
}

.table {
  margin-bottom: 0;
  overflow: hidden;
  border-color: var(--erp-border);
  background: #fff;
  color: var(--erp-text);
  vertical-align: middle;
}

.erp-main > table.table {
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  border-bottom: 1px solid var(--erp-table-row-divider);
  background: #fbfcfe;
  color: #475467;
  font-size: 1rem;
  font-weight: 900;
  white-space: nowrap;
}

.table tbody td,
.table tbody th {
  border-color: var(--erp-table-row-divider);
}

.table > :not(caption) > * > * {
  border-bottom: 1px solid var(--erp-table-row-divider);
}

.table tbody tr:nth-child(even) > * {
  background-color: var(--erp-table-row-alt);
}

.table tbody tr[class*="table-"] > * {
  background-color: var(--bs-table-bg);
}

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

.table-bordered > :not(caption) > * {
  border-color: var(--erp-border);
}

.table-bordered > :not(caption) > * > * {
  border-color: var(--erp-table-row-divider);
}

.badge {
  border-radius: 999px;
  padding: .35em .65em;
  font-weight: 700;
}

.bg-warning {
  background: #fff7ed !important;
  color: #b45309 !important;
}

.bg-success {
  background: #ecfdf3 !important;
  color: #067647 !important;
}

.bg-danger {
  background: #fff1f2 !important;
  color: #c01048 !important;
}

.bg-secondary {
  background: #f2f4f7 !important;
  color: #475467 !important;
}

.bg-info {
  background: #eff8ff !important;
  color: #175cd3 !important;
}

.bg-dark {
  background: #344054 !important;
}

.alert {
  border: 0;
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow-sm);
}

.pagination .page-link {
  margin: 0 2px;
  border-color: var(--erp-border);
  border-radius: 6px;
  color: var(--erp-primary);
}

.pagination .active .page-link {
  border-color: var(--erp-primary);
  background: var(--erp-primary);
}

.site-record-footer {
  margin-top: 2rem;
  padding: 1rem 0;
  color: var(--erp-muted);
  font-size: .75rem;
}

.site-record-footer a {
  color: inherit;
  text-decoration: none;
}

.site-record-footer a:hover {
  text-decoration: underline;
}

.public-security-beian {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.public-security-beian-icon {
  width: 14px;
  height: 14px;
}

.erp-dashboard-page {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.erp-main-dashboard {
  height: calc(100vh - var(--erp-topbar-height));
  min-height: 0;
  overflow: hidden;
  padding: 10px 14px !important;
}

.erp-main-dashboard .site-record-footer {
  display: none;
}

.erp-dashboard {
  display: grid;
  grid-template-rows: auto auto minmax(174px, 1fr) minmax(205px, 1.1fr) auto;
  height: 100%;
  min-height: 0;
  gap: 8px;
}

.erp-dashboard .page-header {
  min-height: 20px;
  margin: 0;
}

.erp-dashboard .page-header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.erp-dashboard .page-title {
  font-size: .95rem;
}

.erp-dashboard .page-kicker {
  font-size: .68rem;
}

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

.metric-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  background: #fff;
  color: var(--erp-text);
  text-decoration: none;
  box-shadow: var(--erp-shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}

.metric-card:hover {
  color: var(--erp-text);
  transform: translateY(-1px);
  box-shadow: var(--erp-shadow);
}

.metric-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--erp-primary-soft);
  color: var(--erp-primary);
  font-size: 1rem;
  font-weight: 900;
}

.metric-icon-svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-card:nth-child(2) .metric-icon {
  background: #fff7ed;
  color: var(--erp-warning);
}

.metric-card:nth-child(3) .metric-icon {
  background: #ecfdf3;
  color: var(--erp-success);
}

.metric-card:nth-child(4) .metric-icon {
  background: #f5f3ff;
  color: var(--erp-purple);
}

.metric-icon-draft {
  background: #eff8ff;
  color: #0e7090;
}

.metric-icon-rejected {
  background: #fff1f2;
  color: var(--erp-danger);
}

.metric-label {
  margin-bottom: 1px;
  color: #344054;
  font-size: .74rem;
  font-weight: 800;
}

.metric-value {
  margin: 0;
  color: var(--erp-primary);
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1.1;
}

.metric-hint {
  display: none;
  margin-top: 2px;
  color: var(--erp-muted);
  font-size: .75rem;
}

.stock-summary-panel .table {
  border-radius: 0;
  box-shadow: none;
}

.erp-dashboard .table-responsive {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.dashboard-overview-grid,
.dashboard-detail-grid,
.dashboard-tools-grid {
  display: grid;
  min-height: 0;
  gap: 8px;
}

.dashboard-overview-grid {
  grid-template-columns: minmax(120px, .7fr) minmax(250px, 1.7fr) minmax(160px, 1fr) minmax(220px, 1.25fr);
}

.dashboard-detail-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
}

.dashboard-tools-grid {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}

.erp-dashboard .erp-panel {
  min-width: 0;
  min-height: 0;
  padding: 10px;
}

.erp-dashboard .erp-panel-title {
  margin-bottom: 6px;
  font-size: .82rem;
}

.dashboard-value-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(145deg, #fff 45%, #f4f8ff 100%);
}

.dashboard-section-kicker {
  margin-bottom: 4px;
  color: #475467;
  font-size: .7rem;
  font-weight: 800;
}

.dashboard-money-value {
  margin: 0;
  color: var(--erp-primary);
  font-size: clamp(1.15rem, 1.55vw, 1.65rem);
  font-weight: 900;
  letter-spacing: -.03em;
}

.dashboard-change,
.dashboard-value-caption {
  margin-top: 4px;
  font-size: .68rem;
  font-weight: 700;
}

.dashboard-change-up {
  color: var(--erp-danger);
}

.dashboard-change-down {
  color: var(--erp-success);
}

.dashboard-change-neutral,
.dashboard-value-caption,
.dashboard-panel-meta {
  color: var(--erp-muted);
}

.dashboard-panel-link {
  margin-top: auto;
  padding-top: 6px;
  font-size: .68rem;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-chart-panel,
.dashboard-ranking-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dashboard-chart-wrap {
  position: relative;
  min-height: 0;
  height: auto;
  flex: 1;
}

.dashboard-doughnut-wrap {
  min-height: 78px;
}

.dashboard-inventory-panel {
  display: flex;
  flex-direction: column;
}

.dashboard-inventory-content {
  display: grid;
  grid-template-rows: auto minmax(78px, 1fr);
  min-height: 0;
  flex: 1;
}

.dashboard-inventory-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 8px;
  padding-bottom: 3px;
}

.dashboard-inventory-value .dashboard-section-kicker,
.dashboard-inventory-value .dashboard-value-caption {
  grid-column: 1;
}

.dashboard-inventory-value .dashboard-money-value {
  grid-column: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-inventory-value .dashboard-panel-link {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  padding-top: 0;
  white-space: nowrap;
}

.dashboard-chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px dashed var(--erp-border-strong);
  border-radius: 6px;
  background: #fbfcfe;
  color: var(--erp-muted);
  font-size: .82rem;
}

.dashboard-period-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 6px;
  background: #f2f4f7;
}

.dashboard-period-switch button {
  padding: 3px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--erp-muted);
  font-size: .72rem;
  font-weight: 800;
}

.dashboard-period-switch button.active {
  background: #fff;
  color: var(--erp-primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .1);
}

.dashboard-ranking-list {
  display: grid;
  min-height: 0;
  gap: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-ranking-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 25px;
  border-bottom: 1px solid var(--erp-border);
  font-size: .7rem;
}

.dashboard-ranking-list li:last-child {
  border-bottom: 0;
}

.dashboard-ranking-list li.dashboard-empty-list {
  grid-template-columns: 1fr;
  place-items: center;
}

.dashboard-rank-index {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #f2f4f7;
  color: var(--erp-muted);
  font-size: .68rem;
  font-weight: 800;
}

.dashboard-ranking-list li:first-child .dashboard-rank-index {
  background: #fff7ed;
  color: #c2410c;
}

.dashboard-rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-ranking-list strong {
  color: #344054;
  font-size: .68rem;
}

.dashboard-tabs {
  gap: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--erp-border);
  border-radius: 0;
  box-shadow: none;
}

.dashboard-tabs .nav-link {
  margin-bottom: -1px;
  padding: .35rem .55rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--erp-muted);
  font-size: .7rem;
}

.dashboard-tabs .nav-link.active {
  border-bottom-color: var(--erp-primary);
  background: transparent;
  color: var(--erp-primary);
}

.dashboard-pending-panel,
.stock-summary-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dashboard-pending-panel .tab-content {
  min-height: 0;
  padding-top: 4px;
  overflow: hidden;
}

.dashboard-pending-panel .tab-pane,
.dashboard-pending-panel .table-responsive,
.stock-summary-panel .table-responsive {
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.dashboard-pending-table th,
.dashboard-pending-table td {
  padding: .3rem .4rem;
  font-size: .68rem;
  white-space: nowrap;
}

.dashboard-pending-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: .68rem;
}

.dashboard-table-empty,
.dashboard-empty-list {
  padding: 14px !important;
  color: var(--erp-muted);
  text-align: center !important;
}

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

.dashboard-action {
  display: grid;
  min-height: 50px;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 1px solid var(--erp-border);
  border-radius: 7px;
  background: #fbfcfe;
  color: #344054;
  font-size: .68rem;
  font-weight: 800;
  text-decoration: none;
}

.dashboard-action:hover {
  border-color: #bfd4ff;
  background: var(--erp-primary-soft);
  color: var(--erp-primary);
}

.dashboard-action-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: var(--erp-primary-soft);
  color: var(--erp-primary);
  font-size: .72rem;
}

.stock-summary-table th,
.stock-summary-table td {
  padding: .3rem .35rem;
  font-size: .68rem;
  text-align: center;
  vertical-align: middle;
}

.stock-summary-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: .68rem;
}

.stock-summary-locked-col {
  width: 8%;
  max-width: 8rem;
  white-space: normal !important;
}

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

.dashboard-alert-card {
  display: grid;
  min-height: 50px;
  align-content: center;
  padding: 6px 8px;
  border: 1px solid var(--erp-border);
  border-radius: 7px;
  background: #fbfcfe;
  color: var(--erp-text);
  text-decoration: none;
}

.dashboard-alert-card:hover {
  border-color: #bfd4ff;
  background: var(--erp-primary-soft);
  color: var(--erp-text);
}

.dashboard-alert-label {
  color: var(--erp-muted);
  overflow: hidden;
  font-size: .66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.dashboard-alert-card strong {
  margin-top: 1px;
  color: var(--erp-primary);
  font-size: 1rem;
  font-weight: 900;
}

.dashboard-alert-card strong small {
  color: var(--erp-muted);
  font-size: .7rem;
}

.dashboard-alert-link {
  display: none;
}

.stock-summary-total td {
  color: var(--erp-text);
  font-weight: 800;
}

.erp-workbench {
  display: grid;
  gap: 14px;
}

.document-form-page .document-form-toolbar,
.document-form-page #lines-section {
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  background: #fff;
  box-shadow: var(--erp-shadow-sm);
}

.document-form-page .document-form-toolbar {
  padding: 12px;
}

.document-form-page #lines-section {
  padding: 14px;
}

.document-form-page #lines-table,
.document-form-page #lines-table td {
  /* Keep SKU dropdowns from being clipped by the mobile table scroll container. */
  overflow: visible;
}

.sku-dd {
  border-color: var(--erp-border-strong) !important;
  border-radius: 6px;
  box-shadow: var(--erp-shadow);
}

.sku-dd div:hover,
.sku-dd div.hl {
  background: var(--erp-primary) !important;
  color: #fff;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  height: var(--bottom-nav-h);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid var(--erp-border);
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, .08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.bottom-nav a {
  flex: 1;
  padding: .35rem 0;
  color: var(--erp-muted);
  font-size: .68rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.bottom-nav a .icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  margin: 0 auto 2px;
  border-radius: 7px;
  background: #eef2f7;
  color: var(--erp-muted);
  font-size: .78rem;
}

.bottom-nav a.active {
  color: var(--erp-primary);
}

.bottom-nav a.active .icon {
  background: var(--erp-primary-soft);
  color: var(--erp-primary);
}

.mobile-only-block,
.mobile-only-flex {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 28px 14px;
  background:
    linear-gradient(135deg, rgba(47, 115, 246, .12), transparent 34%),
    linear-gradient(225deg, rgba(32, 178, 107, .10), transparent 34%),
    var(--erp-bg);
}

.login-card {
  width: min(100%, 400px);
  padding: 28px;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  background: #fff;
  box-shadow: var(--erp-shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--erp-text);
  font-size: 1.15rem;
  font-weight: 900;
}

@media (max-width: 991.98px) {
  .erp-dashboard-page {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .erp-main-dashboard {
    height: auto;
    min-height: calc(100vh - var(--erp-topbar-height));
    overflow: visible;
    padding: 18px 22px 28px !important;
  }

  .erp-main-dashboard .site-record-footer {
    display: block;
  }

  .erp-dashboard {
    grid-template-rows: none;
    height: auto;
    gap: 14px;
  }

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

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

  .dashboard-value-panel,
  .dashboard-chart-panel,
  .dashboard-ranking-panel,
  .dashboard-inventory-panel {
    min-height: 220px;
  }

  .dashboard-detail-grid,
  .dashboard-tools-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-pending-panel,
  .stock-summary-panel {
    min-height: 300px;
  }

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

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

@media (min-width: 768px) {
  .erp-topbar {
    justify-content: flex-end;
  }

  .erp-topbar .topbar-left {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .sidebar {
    display: none !important;
  }

  .erp-topbar {
    left: 0;
    min-height: 50px;
    padding: 0 12px;
  }

  .topbar-title {
    color: var(--erp-text);
  }

  .welcome-text {
    display: none;
  }

  .erp-main {
    margin-left: 0;
    margin-bottom: calc(var(--bottom-nav-h) + 1rem);
    padding: 12px 10px 18px !important;
  }

  .mobile-only-block {
    display: block !important;
  }

  .mobile-only-flex {
    display: flex !important;
  }

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

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 86px;
  }

  .dashboard-overview-grid,
  .dashboard-detail-grid,
  .dashboard-tools-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-value-panel,
  .dashboard-chart-panel,
  .dashboard-ranking-panel,
  .dashboard-inventory-panel {
    min-height: 190px;
  }

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

  .table {
    min-width: 680px;
  }

  .erp-main table.table {
    display: block;
    overflow-x: auto;
  }

  main > form.row,
  .erp-main > form.row {
    gap: .5rem;
  }

  .site-record-footer {
    padding-bottom: calc(var(--bottom-nav-h) + 1rem);
  }
}
