:root {
  --erp-primary: #e91e8c;
  --erp-primary-dark: #c21875;
  --erp-primary-light: #fce4f3;
  --erp-primary-soft: rgba(233, 30, 140, 0.12);
  --erp-bg: #f3f4f8;
  --erp-surface: #ffffff;
  --erp-border: #eceef4;
  --erp-text: #1a1d26;
  --erp-text-muted: #8b90a0;
  --erp-sidebar-icon: #f0f1f6;
  --erp-radius: 1.25rem;
  --erp-radius-sm: 0.875rem;
  --erp-shadow: 0 8px 24px rgba(26, 29, 38, 0.06);
  --erp-shadow-sm: 0 2px 12px rgba(26, 29, 38, 0.04);
}

* {
  box-sizing: border-box;
}

body.erp-body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--erp-bg);
  color: var(--erp-text);
  font-size: 0.9375rem;
}

/* Icon rail */
.erp-icon-rail {
  width: 72px;
  min-height: 100vh;
  background: var(--erp-surface);
  border-right: 1px solid var(--erp-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0;
  gap: 0.35rem;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1030;
}

.erp-icon-rail .brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--erp-primary), #ff6eb4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 20px rgba(233, 30, 140, 0.35);
  overflow: hidden;
}

.erp-icon-rail .brand-icon--logo {
  background: #fff;
  border: 1px solid var(--erp-border);
  box-shadow: 0 4px 14px rgba(26, 26, 46, 0.1);
  padding: 4px;
}

.erp-icon-rail .brand-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.25rem;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  transition: background 0.15s ease;
}

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

.sidebar-brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--erp-border);
  background: #fff;
  padding: 4px;
}

.sidebar-brand-text {
  min-width: 0;
  line-height: 1.25;
}

.sidebar-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-tagline {
  font-size: 0.68rem;
  color: var(--erp-text-muted);
  margin-top: 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.erp-icon-rail a {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--erp-text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 1.15rem;
}

.erp-icon-rail a:hover,
.erp-icon-rail a.active {
  background: var(--erp-primary-soft);
  color: var(--erp-primary);
}

/* Secondary sidebar */
.erp-sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--erp-surface);
  border-right: 1px solid var(--erp-border);
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.22s ease, padding 0.22s ease, border-color 0.22s ease, opacity 0.22s ease;
}

.erp-sidebar .sidebar-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--erp-text-muted);
  padding: 0.75rem 0.75rem 0.35rem;
  margin: 0;
}

.erp-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--erp-radius-sm);
  color: var(--erp-text);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  margin-bottom: 2px;
  transition: all 0.15s ease;
}

.erp-sidebar .nav-link i {
  font-size: 1rem;
  color: var(--erp-text-muted);
  width: 1.25rem;
}

.erp-sidebar .nav-link:hover {
  background: var(--erp-bg);
  color: var(--erp-text);
}

.erp-sidebar .nav-link.active {
  background: var(--erp-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(233, 30, 140, 0.35);
}

.erp-sidebar .nav-link.active i {
  color: #fff;
}

.erp-sidebar .badge-count {
  margin-left: auto;
  background: var(--erp-primary-light);
  color: var(--erp-primary);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.erp-sidebar .nav-link.active .badge-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Main wrapper */
.erp-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top header */
.erp-topbar {
  background: var(--erp-surface);
  border-bottom: 1px solid var(--erp-border);
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.erp-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.erp-search input {
  width: 100%;
  border: 1px solid var(--erp-border);
  border-radius: 999px;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  background: var(--erp-bg);
  font-size: 0.875rem;
}

.erp-search input:focus {
  outline: none;
  border-color: var(--erp-primary);
  box-shadow: 0 0 0 3px var(--erp-primary-soft);
}

.erp-search i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--erp-text-muted);
}

.erp-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.erp-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--erp-border);
  background: var(--erp-surface);
  color: var(--erp-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* Collapsed sidebar mode for more workspace */
body.erp-body.sidebar-collapsed .erp-sidebar {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  opacity: 0;
  overflow: hidden;
}

.erp-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.85rem 0.4rem 0.4rem;
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  background: var(--erp-bg);
  max-width: 280px;
}

.erp-topbar-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.2;
}

.erp-user-company {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.erp-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.erp-logout-form {
  margin: 0;
  padding: 0;
}

.erp-btn-logout {
  border: none;
  background: none;
  padding: 0;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--erp-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.erp-btn-logout:hover {
  color: var(--erp-primary-dark);
  text-decoration: underline;
}

.erp-btn-change-password {
  margin-top: 0.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--erp-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.erp-btn-change-password:hover {
  color: var(--erp-primary);
  text-decoration: underline;
}

.erp-footer {
  padding: 0.85rem 1.75rem;
  border-top: 1px solid var(--erp-border);
  background: var(--erp-surface);
  font-size: 0.8rem;
  color: var(--erp-text-muted);
  text-align: center;
}

.erp-footer strong {
  color: #1a1a2e;
  font-weight: 600;
}

.erp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #a78bfa, var(--erp-primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.btn-erp-primary {
  background: var(--erp-primary);
  border: none;
  color: #fff;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(233, 30, 140, 0.3);
}

.btn-erp-primary:hover {
  background: var(--erp-primary-dark);
  color: #fff;
}

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

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

.erp-pagination .page-item.disabled .page-link {
  color: #adb5bd;
}

.btn-erp-fab {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--erp-primary);
  color: #fff;
  border: none;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(233, 30, 140, 0.4);
}

/* Main content */
.erp-main {
  padding: 1.5rem 1.75rem 2rem;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.page-header .subtitle {
  color: var(--erp-text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Cards */
.erp-card {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow-sm);
}

.erp-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--erp-border);
  font-weight: 600;
  font-size: 0.95rem;
}

.erp-card-body {
  padding: 1.25rem;
}

/* Hero KPI */
.kpi-hero {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--erp-shadow-sm);
  height: 100%;
}

.kpi-hero .label {
  color: var(--erp-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-hero .value {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.35rem 0;
}

.kpi-hero .badge-growth {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--erp-primary-light);
  color: var(--erp-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

/* Mini KPI pills */
.kpi-mini {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  padding: 1rem 1.15rem;
  height: 100%;
  box-shadow: var(--erp-shadow-sm);
}

.kpi-mini .kpi-label {
  font-size: 0.75rem;
  color: var(--erp-text-muted);
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.kpi-mini .kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
}

.kpi-mini .kpi-sub {
  font-size: 0.7rem;
  color: var(--erp-text-muted);
  margin-top: 0.15rem;
}

/* Payment account cards — equal height, buttons aligned at bottom */
.account-card {
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.account-card-sub {
  font-size: 0.8rem;
  min-height: 1.25rem;
  line-height: 1.25rem;
  margin-bottom: 0.25rem;
}

.account-card-actions {
  margin-top: auto;
  padding-top: 0.75rem;
}

.account-card-actions .btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Pink accent card */
.card-accent-pink {
  background: linear-gradient(135deg, var(--erp-primary) 0%, #ff5cae 100%);
  border: none;
  border-radius: var(--erp-radius);
  color: #fff;
  padding: 1.25rem;
  height: 100%;
}

.card-accent-pink .accent-label {
  opacity: 0.9;
  font-size: 0.8rem;
}

.card-accent-pink .accent-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

/* Tables */
.erp-table {
  margin: 0;
  font-size: 0.875rem;
}

.erp-table thead th {
  background: var(--erp-bg);
  border-bottom: 1px solid var(--erp-border);
  color: var(--erp-text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
}

.erp-table tbody td {
  padding: 0.85rem 1rem;
  border-color: var(--erp-border);
  vertical-align: middle;
}

.badge-erp {
  background: var(--erp-primary-light);
  color: var(--erp-primary);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
}

.badge-erp-warning {
  background: #fff3e0;
  color: #e65100;
}

/* Toggle pills */
.erp-pills {
  display: inline-flex;
  background: var(--erp-bg);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--erp-border);
}

.erp-pills .pill {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--erp-text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
}

.erp-pills .pill.active {
  background: var(--erp-surface);
  color: var(--erp-text);
  box-shadow: var(--erp-shadow-sm);
}

/* Forms in content pages */
.erp-main .form-control,
.erp-main .form-select {
  border-radius: var(--erp-radius-sm);
  border-color: var(--erp-border);
  padding: 0.55rem 0.85rem;
}

.erp-main .form-control:focus,
.erp-main .form-select:focus {
  border-color: var(--erp-primary);
  box-shadow: 0 0 0 3px var(--erp-primary-soft);
}

.erp-main .btn-primary {
  background: var(--erp-primary);
  border-color: var(--erp-primary);
  border-radius: var(--erp-radius-sm);
  font-weight: 600;
}

.erp-main .btn-primary:hover {
  background: var(--erp-primary-dark);
  border-color: var(--erp-primary-dark);
}

.erp-main .btn-outline-primary {
  color: var(--erp-primary);
  border-color: var(--erp-primary);
  border-radius: var(--erp-radius-sm);
}

.erp-main .btn-outline-primary:hover {
  background: var(--erp-primary);
  border-color: var(--erp-primary);
}

.erp-main .table {
  --bs-table-bg: transparent;
}

.erp-main .alert-success {
  border-radius: var(--erp-radius-sm);
  border: none;
  background: #e8f8ef;
  color: #1b7a3e;
}

/* Login */
.login-page {
  min-height: 100vh;
  background: var(--erp-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
}

.login-card {
  border: 1px solid var(--erp-border);
  border-radius: 1.5rem;
  box-shadow: var(--erp-shadow);
  overflow: hidden;
}

.login-card .login-header {
  background: linear-gradient(135deg, var(--erp-primary), #ff6eb4);
  color: #fff;
  padding: 2rem;
  text-align: center;
}

.login-card .login-header i {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.login-card .card-body {
  padding: 2rem;
}

.login-card .btn-primary {
  background: var(--erp-primary);
  border: none;
  border-radius: 12px;
  padding: 0.65rem;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(233, 30, 140, 0.35);
}

.login-card .btn-primary:hover {
  background: var(--erp-primary-dark);
}

/* Sidebar user footer */
.sidebar-user {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--erp-border);
}

.sidebar-user .user-email {
  font-size: 0.75rem;
  color: var(--erp-text-muted);
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.sidebar-user .btn-logout {
  width: 100%;
  border-radius: var(--erp-radius-sm);
  border: 1px solid var(--erp-border);
  background: var(--erp-bg);
  color: var(--erp-text);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.45rem;
}

.chart-wrap {
  position: relative;
  height: 220px;
}

.platform-list .item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--erp-border);
}

.platform-list .item:last-child {
  border-bottom: none;
}

.platform-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.65rem;
  flex-shrink: 0;
}

@media (max-width: 991px) {
  .erp-sidebar {
    display: none;
  }
  .erp-icon-rail {
    width: 56px;
  }
}

.lookup-field {
  display: flex;
  gap: 0.35rem;
}

.lookup-field .form-select {
  flex: 1;
}

.btn-lookup {
  border: 1px solid var(--erp-border);
  background: var(--erp-bg);
  color: var(--erp-text-muted);
  border-radius: var(--erp-radius-sm);
  width: 38px;
  padding: 0;
  flex-shrink: 0;
}

.btn-lookup:hover {
  background: var(--erp-primary-light);
  color: var(--erp-primary);
  border-color: var(--erp-primary);
}

.lookup-list {
  max-height: 280px;
  overflow-y: auto;
}

/* Wider lookup modals */
.erp-modal-wide {
  max-width: 620px;
  width: 92%;
}

.erp-modal-content {
  border: 1px solid var(--erp-border);
  border-radius: 1.25rem !important;
  box-shadow: var(--erp-shadow);
}

/* Input with left icon */
.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .input-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--erp-text-muted);
  pointer-events: none;
  z-index: 4;
  font-size: 1rem;
}

.input-icon-wrap .form-control,
.input-icon-wrap .form-select {
  padding-left: 2.65rem;
}

.input-icon-wrap-textarea .input-icon {
  top: 0.85rem;
  transform: none;
}

.input-icon-wrap-textarea .form-control {
  padding-top: 0.55rem;
  min-height: 4.5rem;
}

.input-icon-wrap-password .form-control {
  padding-right: 2.75rem;
}

.input-icon-wrap-password .btn-toggle-pw {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  padding: 0.2rem 0.45rem;
  color: var(--erp-text-muted);
  text-decoration: none;
  line-height: 1;
}

.input-icon-wrap-password .btn-toggle-pw:hover {
  color: var(--erp-primary);
}

.change-password-form .erp-form-section {
  padding-bottom: 0.25rem;
}

.change-password-tips .tip-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.45rem 0;
  font-size: 0.9rem;
  color: var(--erp-text-muted);
}

.change-password-tips .tip-row i {
  color: var(--erp-primary);
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.error-page-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.error-page-icon.error-status-5xx {
  background: rgba(220, 53, 69, 0.12);
  color: #dc3545;
}

.error-page-icon.error-status-4xx {
  background: rgba(255, 193, 7, 0.15);
  color: #b8860b;
}

.error-page-icon.error-status-other {
  background: rgba(233, 30, 140, 0.12);
  color: var(--erp-primary);
}

.error-reference-box {
  background: var(--erp-surface-alt, #f8f9fa);
  border: 1px dashed var(--erp-border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.error-reference-box code {
  font-size: 0.85rem;
  word-break: break-all;
}

.lookup-field .input-icon-wrap {
  min-width: 0;
}

/* Modal list rows */
.lookup-list .list-group-item {
  padding: 0.75rem 0;
  border-color: var(--erp-border);
}

.lookup-item-name {
  font-weight: 500;
  padding-right: 0.5rem;
}

.lookup-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
}

.lookup-actions .btn i {
  font-size: 0.95rem;
}

.lookup-actions .btn-outline-primary {
  color: var(--erp-primary);
  border-color: var(--erp-primary);
}

.lookup-actions .btn-outline-primary:hover {
  background: var(--erp-primary);
  color: #fff;
}

.lookup-actions .btn-outline-danger:hover {
  background: #dc3545;
  color: #fff;
}

/* SweetAlert2 — ERP theme */
.erp-swal-popup {
  border-radius: 1rem !important;
  font-family: var(--erp-font, 'Inter', sans-serif);
}

.swal2-styled.swal2-confirm {
  border-radius: 8px !important;
  font-weight: 600;
  padding: 0.5rem 1.25rem !important;
}

.swal2-styled.swal2-cancel {
  border-radius: 8px !important;
}

body.erp-action-locked {
  overflow: hidden;
}

body.erp-action-locked .erp-card,
body.erp-action-locked .modal.show {
  pointer-events: none;
  user-select: none;
}

/* Product filter compact layout */
.product-filter-form .form-control-sm,
.product-filter-form .form-select-sm {
  min-height: 34px;
  font-size: 0.84rem;
}

.product-filter-form .btn-sm {
  min-height: 34px;
  padding-inline: 0.9rem;
}

.product-filter-actions {
  align-items: center;
}

@media (min-width: 992px) {
  .product-filter-actions {
    margin-left: auto;
  }
}

.product-actions-cell {
  width: 132px;
  white-space: nowrap;
}

.product-row-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.product-row-actions .action-btn-icon {
  width: 32px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
}

.product-row-actions .action-btn-icon i {
  font-size: 0.86rem;
}

.product-row-actions .action-form {
  margin: 0;
}

/* PO lines — bulk entry (100+ items) */
.po-lines-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.po-lines-toolbar .po-line-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--erp-primary);
  background: var(--erp-primary-soft);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.po-lines-scroll {
  max-height: min(560px, 58vh);
  overflow: auto;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
  background: var(--erp-surface);
}

.po-lines-scroll .table {
  margin-bottom: 0;
}

.po-lines-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8f9fc;
  box-shadow: 0 1px 0 var(--erp-border);
  font-size: 0.8rem;
  white-space: nowrap;
}

.po-line-no-cell {
  width: 42px;
  font-size: 0.8rem;
  vertical-align: middle;
}

.po-line-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  font-weight: 600;
}

.po-product-cell {
  min-width: 300px;
}

.po-form-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--erp-primary);
  margin: 0;
}

.po-form-section-body {
  padding: 0.85rem 1rem;
  background: #fafbfc;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
}

.po-product-cell .product-picker-input,
#poLinesTable .line-qty,
#poLinesTable .line-price {
  min-height: 38px;
}

/* Product search — floating panel (not clipped by table) */
.product-picker-menu.product-picker-menu--floating {
  display: none;
  position: fixed;
  z-index: 1080;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--erp-radius-sm);
  border: 1px solid var(--erp-border);
  background: var(--erp-surface);
  box-shadow: 0 12px 40px rgba(26, 29, 38, 0.18);
}

.product-picker-menu.product-picker-menu--floating.show {
  display: flex;
  flex-direction: column;
}

.product-picker-menu-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  background: #f8f9fc;
  border-bottom: 1px solid var(--erp-border);
  flex-shrink: 0;
}

.product-picker-menu-body {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.product-picker-option {
  padding: 0.65rem 0.85rem !important;
  border-left: none;
  border-right: none;
  text-align: left;
}

.product-picker-option-label {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
  word-break: break-word;
}

.product-picker-option-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.78rem;
  color: var(--erp-text-muted);
  margin-top: 0.15rem;
}

.product-picker-option:hover,
.product-picker-option:focus,
.product-picker-option.active {
  background: var(--erp-primary-light) !important;
  color: var(--erp-text);
  border-color: var(--erp-border);
}

/* Employee form — aligned 2-column layout */
.employee-form .erp-form-section {
  height: 100%;
  padding: 1.1rem 1.25rem;
  background: #fafbfc;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
}

.employee-form .erp-form-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--erp-primary);
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--erp-border);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.employee-form .form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--erp-text-muted);
  margin-bottom: 0.35rem;
}

.employee-form .form-control,
.employee-form .form-select {
  min-height: 38px;
}

.employee-form textarea.form-control {
  min-height: 72px;
  resize: vertical;
}

.employee-form .input-icon-wrap .form-control {
  padding-left: 2.35rem;
}

.employee-form .form-control[type="file"] {
  padding: 0.4rem 0.65rem;
  min-height: 38px;
}

.employee-form .erp-form-actions {
  background: #f8f9fb;
}

.employee-form .field-validation-error,
.employee-form .text-danger.small {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

.employee-form .input-validation-error {
  border-color: #dc3545 !important;
}

.employee-form .validation-summary-errors {
  margin-bottom: 0;
}

.designation-form .field-validation-error,
.designation-form .text-danger.small {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

.designation-form .input-validation-error {
  border-color: #dc3545 !important;
}

.attendance-form .field-validation-error,
.attendance-form .text-danger.small {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

.attendance-form .input-validation-error {
  border-color: #dc3545 !important;
}

.salary-advance-form .field-validation-error,
.salary-advance-form .text-danger.small {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

.salary-advance-form .input-validation-error {
  border-color: #dc3545 !important;
}

/* HR Reports hub */
.hr-reports-hub {
  margin-bottom: 2rem;
}

.hr-report-category {
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.hr-report-category:hover {
  box-shadow: var(--erp-shadow-md, 0 8px 24px rgba(26, 26, 46, 0.08));
}

.hr-report-category-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-bottom: 1px solid var(--erp-border);
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.hr-report-category-icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
}

.hr-report-category[data-category="employees"] .hr-report-category-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.hr-report-category[data-category="attendance"] .hr-report-category-icon {
  background: linear-gradient(135deg, #10b981, #059669);
}

.hr-report-category[data-category="payroll"] .hr-report-category-icon {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.hr-report-category[data-category="advance"] .hr-report-category-icon {
  background: linear-gradient(135deg, var(--erp-primary), #ff6eb4);
}

.hr-report-category[data-category="purchase"] .hr-report-category-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.hr-report-category[data-category="sales"] .hr-report-category-icon {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.hr-report-category[data-category="inventory"] .hr-report-category-icon {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.hr-report-category[data-category="warranty"] .hr-report-category-icon {
  background: linear-gradient(135deg, var(--erp-primary), #ff6eb4);
}

.hr-report-category[data-category="repair"] .hr-report-category-icon {
  background: linear-gradient(135deg, #64748b, #475569);
}

.hr-report-category[data-category="financial"] .hr-report-category-icon {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.hr-report-category-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  letter-spacing: -0.02em;
}

.hr-report-category-desc {
  font-size: 0.8rem;
  color: var(--erp-text-muted);
}

.hr-report-links {
  padding: 0.5rem;
}

.hr-report-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.25rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.hr-report-link:last-child {
  margin-bottom: 0;
}

.hr-report-link:hover {
  background: var(--erp-primary-soft);
  border-color: rgba(233, 30, 140, 0.15);
  color: inherit;
}

.hr-report-link:hover .hr-report-link-arrow {
  color: var(--erp-primary);
  transform: translateX(3px);
}

.hr-report-link-icon {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 8px;
  background: #f1f3f8;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.hr-report-link:hover .hr-report-link-icon {
  background: var(--erp-primary-light);
  color: var(--erp-primary);
}

.hr-report-link-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.hr-report-link-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a1a2e;
}

.hr-report-link-hint {
  font-size: 0.75rem;
  color: var(--erp-text-muted);
  line-height: 1.3;
}

.hr-report-link-arrow {
  flex-shrink: 0;
  font-size: 0.9rem;
  color: #9ca3af;
  transition: color 0.15s ease, transform 0.15s ease;
}

/* Dashboard stat cards */
.dash-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--erp-text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-section-title i {
  color: var(--erp-primary);
  font-size: 1rem;
}

.dash-stat-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow-sm);
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dash-stat-card:hover {
  border-color: rgba(233, 30, 140, 0.35);
  box-shadow: 0 6px 20px rgba(26, 26, 46, 0.08);
  color: inherit;
  transform: translateY(-2px);
}

.dash-stat-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #fff;
}

.dash-stat-icon.tone-pink { background: linear-gradient(135deg, #e91e8c, #ff6eb4); }
.dash-stat-icon.tone-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.dash-stat-icon.tone-teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.dash-stat-icon.tone-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.dash-stat-icon.tone-amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.dash-stat-icon.tone-warning { background: linear-gradient(135deg, #f97316, #ea580c); }
.dash-stat-icon.tone-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.dash-stat-icon.tone-success { background: linear-gradient(135deg, #22c55e, #16a34a); }
.dash-stat-icon.tone-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.dash-stat-icon.tone-cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.dash-stat-icon.tone-orange { background: linear-gradient(135deg, #fb923c, #f97316); }
.dash-stat-icon.tone-slate { background: linear-gradient(135deg, #64748b, #475569); }

.dash-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.dash-stat-label {
  font-size: 0.68rem;
  color: var(--erp-text-muted);
  font-weight: 500;
  margin-top: 0.15rem;
  line-height: 1.25;
}

.dash-hero-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: var(--erp-primary-soft);
  color: var(--erp-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.erp-card-header .btn.ms-auto {
  margin-left: auto;
}

.erp-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Platform admin — company provisioning overlay */
.platform-provision-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}

.platform-provision-overlay[hidden] {
  display: none !important;
}

.platform-provision-panel {
  text-align: center;
  max-width: 420px;
  width: 90%;
  padding: 2rem;
}

.platform-provision-progress {
  height: 1.25rem;
  background: rgba(255, 255, 255, 0.15);
}

.platform-provision-progress .progress-bar {
  font-size: 0.75rem;
  font-weight: 600;
}

body.platform-provision-lock {
  overflow: hidden;
  pointer-events: none;
}

body.platform-provision-lock .platform-provision-overlay {
  pointer-events: all;
}

.platform-tenant-logo-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--erp-border);
  background: #fff;
}

.platform-tenant-logo-preview {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--erp-border);
  background: #fff;
}
