:root,
[data-erp-theme="modern"] {
  --erp-sidebar: #1e3a8a;
  --erp-sidebar-hover: #1d4ed8;
  --erp-sidebar-active: #a5b4fc;
  --erp-header: #4338ca;
  --erp-header-dark: #3730a3;
  --erp-bg: #f1f5f9;
  --erp-primary: #6366f1;
  --erp-primary-hover: #4f46e5;
  --erp-success: #10B981;
  --erp-warning: #F59E0B;
  --erp-danger: #EF4444;
  --erp-text: #0f172a;
  --erp-text-muted: #64748b;
  --erp-border: #e2e8f0;
  --erp-card-shadow: 0 4px 24px rgba(99, 102, 241, 0.1), 0 1px 3px rgba(15, 23, 42, 0.06);
  --erp-right-column-width: 140px;
  --bs-primary: #6366f1;
  --bs-primary-rgb: 99, 102, 241;
  --bs-success: #10B981;
  --bs-success-rgb: 16, 185, 129;
  --bs-warning: #F59E0B;
  --bs-warning-rgb: 245, 158, 11;
  --bs-danger: #EF4444;
  --bs-danger-rgb: 239, 68, 68;
  --bs-body-color: #0f172a;
  --bs-body-bg: #f1f5f9;
  --bs-border-color: #e2e8f0;
  --bs-link-color: #4338ca;
  --bs-link-hover-color: #6366f1;
  --erp-radius-card: 14px;
  --erp-radius-btn: 10px;
  --erp-radius-nav: 10px;
  --erp-font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --erp-font-xs: 11px;
  --erp-font-sm: 14px;
  --erp-font-md: 15px;
  --erp-menu-font-size: 15px;
  --erp-menu-section-size: 12px;
  --erp-menu-color-dark: #111827;
  --erp-menu-color-light: #f1f5f9;
  --erp-header-height: 48px;
  --erp-sidebar-width: 260px;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--erp-text);
  background: var(--erp-bg);
  font-family: var(--erp-font-family);
  font-size: var(--erp-font-sm);
  -webkit-font-smoothing: antialiased;
}

/* ── App shell (3-column dashboard layout) ── */
.erp-app {
  display: flex;
  min-height: 100vh;
  background: var(--erp-bg);
}

.erp-shell {
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.erp-body {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.erp-workspace {
  flex: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.erp-workspace.has-right-column .erp-content,
.erp-workspace.has-right-panel .erp-content {
  flex: 1;
  min-width: 0;
}

/* ── Right column (menu + dashboard widgets) ── */
.erp-right-column {
  width: var(--erp-right-column-width);
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid var(--erp-border);
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  flex-direction: column;
}

.erp-workspace.has-right-column .erp-right-column {
  display: flex;
}

/* ── Right panel widgets (clock, calendar, calc, apps) ── */
.erp-right-widgets {
  flex-shrink: 0;
  padding: 0.75rem 0.75rem 0.25rem;
  border-bottom: 1px solid var(--erp-border);
  background: linear-gradient(180deg, #F0FDFA 0%, #fff 100%);
  position: relative;
}

.erp-right-widgets-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
}

.erp-widget {
  margin-bottom: 0.85rem;
  border-radius: 10px;
  overflow: hidden;
}

.erp-widget-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--erp-text-muted);
  margin: 0 0 0.5rem;
}

.erp-widget-clock {
  background: linear-gradient(135deg, #0F766E 0%, #134E4A 100%);
  color: #fff;
  text-align: center;
  padding: 0.85rem 0.5rem;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.25);
}

.erp-digital-time {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

.erp-digital-date {
  font-size: 0.72rem;
  opacity: 0.9;
  margin-top: 0.35rem;
  line-height: 1.3;
}

.erp-widget-calc {
  background: #fff;
  border: 1px solid var(--erp-border);
  padding: 0.5rem;
}

.erp-calc-display {
  background: #111827;
  color: #5EEAD4;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: right;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.45rem;
  min-height: 2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.erp-calc-key {
  border: 1px solid var(--erp-border);
  background: #F9FAFB;
  border-radius: 6px;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--erp-text);
  transition: background 0.12s;
}

.erp-calc-key:hover { background: #E5E7EB; }

.erp-calc-key.op {
  background: rgba(20, 184, 166, 0.12);
  color: var(--erp-header);
  border-color: rgba(20, 184, 166, 0.25);
}

.erp-calc-key.eq {
  background: var(--erp-header);
  color: #fff;
  border-color: var(--erp-header);
  grid-row: span 2;
}

.erp-calc-key.wide {
  grid-column: span 2;
}

.erp-right-menu {
  flex-shrink: 0;
  padding: 0.75rem 0.65rem 0.5rem;
}

.erp-right-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem 0.75rem;
  border-bottom: 1px solid var(--erp-border);
  margin-bottom: 0.5rem;
}

.erp-right-menu-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--erp-text-muted);
}

.erp-right-sidebar-close {
  background: none;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--erp-text-muted);
  cursor: pointer;
  padding: 0 0.25rem;
}

.erp-right-nav-section {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--erp-text-muted);
  padding: 0.75rem 0.5rem 0.35rem;
  margin: 0;
}

.erp-right-nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.55rem;
  color: var(--erp-text);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}

.erp-right-nav-link:hover {
  background: rgba(20, 184, 166, 0.08);
  color: var(--erp-header);
}

.erp-right-nav-link.active {
  background: rgba(20, 184, 166, 0.14);
  color: var(--erp-header);
  font-weight: 600;
}

.erp-right-nav-link .nav-icon {
  width: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.erp-right-menu-footer {
  padding: 0.75rem 0.5rem 0.25rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--erp-border);
}

.erp-right-menu-footer small { color: var(--erp-text-muted) !important; }

/* ── Right panel (dashboard widgets) ── */
.erp-right-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
  display: none;
}

.erp-right-panel--widgets {
  display: block;
  border-top: 1px solid var(--erp-border);
  background: #FAFAFA;
}

.erp-workspace.has-right-panel .erp-right-panel {
  display: block;
}
.erp-topbar {
  height: var(--erp-header-height);
  background: var(--erp-header);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1050;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.2);
}

.erp-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.erp-topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
}

.erp-logo-mark {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.erp-global-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  gap: 0.5rem;
  margin: 0 auto;
}

.erp-global-search .form-control {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  font-size: 0.875rem;
}

.erp-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

.erp-topbar-icon {
  position: relative;
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  line-height: 1;
}

.erp-topbar-icon:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }

.erp-topbar-icon.is-active { background: rgba(255, 255, 255, 0.22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }

.erp-topbar-icon.is-muted { opacity: 0.55; }

.erp-badge-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--erp-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.erp-topbar-user,
.erp-topbar-branch {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.erp-topbar-user:hover,
.erp-topbar-branch:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }

.erp-avatar {
  width: 28px;
  height: 28px;
  background: #fff;
  color: var(--erp-header);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.erp-topbar-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.05rem;
  line-height: 1;
  transition: background 0.15s;
}

.erp-topbar-menu:hover {
  background: rgba(255, 255, 255, 0.25);
}

.erp-topbar .erp-theme-switcher .erp-theme-trigger {
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
}

/* ── Sidebar ── */
.erp-sidebar {
  width: var(--erp-sidebar-width);
  background: linear-gradient(180deg, #1e3a8a 0%, #1e293b 48%, #0f172a 100%);
  color: #E5E7EB;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 2px 0 18px rgba(15, 23, 42, 0.12);
  height: calc(100vh - var(--erp-header-height));
  max-height: calc(100vh - var(--erp-header-height));
  position: sticky;
  top: var(--erp-header-height);
  align-self: flex-start;
}

.erp-sidebar-footer {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
}

.erp-sidebar-footer small { color: #9CA3AF !important; }

/* ── Top bar (full width) ── */

.erp-panel-block {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--erp-border);
}

.erp-panel-block:last-child { border-bottom: none; }

.erp-panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--erp-text-muted);
  margin-bottom: 0.65rem;
}

.erp-panel-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  font-size: 0.875rem;
  color: var(--erp-text);
  text-decoration: none;
}

.erp-panel-item:hover { color: var(--erp-primary); }

.erp-panel-stat strong { color: var(--erp-header); }

.erp-panel-empty {
  font-size: 0.82rem;
  color: var(--erp-text-muted);
  margin: 0;
}

.erp-kpi-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.erp-stat-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--erp-border);
  font-size: 0.875rem;
}

.erp-stat-list li:last-child { border-bottom: none; }

.erp-page-title-bar h2 { color: var(--erp-text); font-weight: 600; }

/* ── Menu hide / show (desktop) ── */
@media (min-width: 992px) {
  .erp-shell.erp-left-collapsed .erp-sidebar {
    width: 0;
    min-width: 0;
    padding: 0;
    border-right: none;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
  }
}

@media (min-width: 1200px) {
  .erp-shell.erp-right-collapsed .erp-right-column {
    display: none !important;
  }
}

/* ── Compact right panel (50% width) ── */
.erp-right-widgets { padding: 0.5rem 0.45rem 0.15rem; }

.erp-digital-time { font-size: 1.05rem; letter-spacing: 0.04em; }

.erp-digital-date { font-size: 0.58rem; }

.erp-widget-clock { padding: 0.6rem 0.35rem; }

.erp-widget { margin-bottom: 0.6rem; }

.erp-calc-display { font-size: 1rem; padding: 0.35rem 0.4rem; }

.erp-calc-key { padding: 0.28rem 0; font-size: 0.68rem; }

.erp-right-menu { padding: 0.5rem 0.45rem; }

.erp-right-nav-link { font-size: 0.72rem; padding: 0.4rem 0.4rem; gap: 0.35rem; }

.erp-right-nav-section { font-size: 0.62rem; padding: 0.5rem 0.35rem 0.25rem; }

.erp-right-panel { padding: 0.5rem 0.45rem 0.75rem; }

.erp-panel-item { font-size: 0.72rem; }

.erp-panel-title { font-size: 0.62rem; }

@media (max-width: 1199.98px) {
  .erp-workspace.has-right-column .erp-right-column {
    position: fixed;
    top: var(--erp-header-height);
    right: 0;
    bottom: 0;
    z-index: 1040;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  }
  .erp-right-column.open {
    transform: translateX(0);
  }
  .erp-kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991.98px) {
  .erp-sidebar {
    position: fixed;
    top: var(--erp-header-height);
    left: 0;
    bottom: 0;
    height: auto;
    max-height: none;
    width: min(280px, 88vw);
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .erp-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.35);
  }
  .erp-kpi-grid-4 { grid-template-columns: 1fr; }
  .erp-topbar-menu {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
}

.erp-sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.erp-sidebar-brand a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.erp-sidebar-brand small {
  display: block;
  color: #9CA3AF;
  font-size: 0.72rem;
  font-weight: 400;
  margin-top: 0.15rem;
}

.erp-sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: scroll;
  overflow-x: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.45rem 0.15rem 0.65rem 0.4rem;
  scrollbar-width: auto;
  scrollbar-color: #818cf8 rgba(255, 255, 255, 0.1);
}

.erp-sidebar-nav::-webkit-scrollbar:horizontal {
  height: 8px;
}

.erp-sidebar-nav::-webkit-scrollbar:horizontal-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  margin: 0 6px;
}

.erp-sidebar-nav::-webkit-scrollbar:horizontal-thumb {
  background: linear-gradient(90deg, #a5b4fc 0%, #6366f1 100%);
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.35);
}

.erp-sidebar-nav::-webkit-scrollbar {
  width: 10px;
}

.erp-sidebar-nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  margin: 6px 2px;
}

.erp-sidebar-nav::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #a5b4fc 0%, #6366f1 100%);
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.35);
  min-height: 40px;
}

.erp-sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #c7d2fe 0%, #818cf8 100%);
}

.erp-sidebar-nav::-webkit-scrollbar-thumb:active {
  background: #e0e7ff;
}

.erp-nav-section {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9CA3AF;
  padding: 0.85rem 0.75rem 0.35rem;
  margin: 0;
}

.erp-nav-link {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.38rem 0.55rem;
  color: #D1D5DB;
  text-decoration: none;
  border-radius: var(--erp-radius-nav);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.28;
  white-space: normal;
  word-break: break-word;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 1px;
  border-left: 3px solid transparent;
  max-width: 100%;
}

.erp-nav-link:hover {
  background: rgba(29, 78, 216, 0.35);
  color: #fff;
}

.erp-nav-link.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.28) 0%, rgba(99, 102, 241, 0.08) 100%);
  color: #c7d2fe;
  border-left-color: #818cf8;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.22);
  font-weight: 600;
}

.erp-nav-link .nav-icon {
  width: 1.1rem;
  text-align: center;
  opacity: 0.9;
  font-size: 0.88rem;
  flex-shrink: 0;
  margin-top: 0.08rem;
}

.erp-nav-link.active .nav-icon {
  opacity: 1;
  color: #a5b4fc;
}

.erp-nav-toggle {
  width: 100%;
  background: none;
  border: none;
  color: #D1D5DB;
  text-align: left;
  padding: 0.42rem 0.55rem;
  border-radius: var(--erp-radius-nav);
  font-size: 0.8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 0.4rem;
  border-left: 3px solid transparent;
  line-height: 1.28;
}

.erp-nav-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.erp-nav-toggle:hover {
  background: rgba(29, 78, 216, 0.35);
  color: #fff;
}

.erp-nav-toggle.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.28) 0%, rgba(99, 102, 241, 0.08) 100%);
  color: #c7d2fe;
  border-left-color: #818cf8;
}

.erp-nav-chevron {
  font-size: 0.75rem;
  opacity: 0.75;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.erp-nav-group.collapsed .erp-nav-sub { display: none; }

.erp-nav-group.collapsed .erp-nav-chevron { transform: rotate(-90deg); }

.erp-nav-group { margin-bottom: 0.08rem; }

.erp-nav-subgroup { margin-bottom: 0.06rem; }

.erp-nav-section-toggle {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: none;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 0.38rem 0.5rem 0.38rem 0.85rem;
  margin: 0.12rem 0 0.06rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  cursor: pointer;
  text-align: left;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}

.erp-nav-section-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.erp-nav-section-toggle.active {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
}

.erp-nav-section-toggle.erp-nav-section-chain {
  margin-top: 0.2rem;
  color: #93c5fd;
}

.erp-nav-subgroup.collapsed .erp-nav-subgroup-items { display: none; }

.erp-nav-subgroup.collapsed .erp-nav-section-toggle .erp-nav-chevron { transform: rotate(-90deg); }

.erp-nav-subgroup-items .erp-nav-link {
  font-size: 0.775rem;
  padding: 0.3rem 0.45rem 0.3rem 0.95rem;
  font-weight: 400;
}

.erp-nav-sub {
  padding-left: 0.2rem;
  margin-bottom: 0.15rem;
}

.erp-nav-sub .erp-nav-section {
  padding-left: 0.95rem;
  padding-top: 0.25rem;
}

.erp-nav-sub .erp-nav-link {
  font-size: 0.775rem;
  padding: 0.3rem 0.45rem 0.3rem 0.95rem;
  font-weight: 400;
}

.erp-nav-section-chain {
  margin-top: 0.35rem;
  color: #93c5fd;
}

.erp-nav-chain-item {
  padding-left: 1.15rem !important;
  margin-left: 0.35rem;
  border-left: 2px solid rgba(148, 163, 184, 0.25);
  border-radius: 0 8px 8px 0;
  font-size: 0.75rem !important;
}

.erp-nav-chain-arrow {
  display: block;
  text-align: left;
  color: #64748b;
  font-size: 0.6rem;
  line-height: 1;
  margin: 0;
  padding: 0.05rem 0 0.05rem 1.1rem;
  user-select: none;
  white-space: nowrap;
}

.erp-nav-chain-section-label {
  display: block;
  padding: 0.28rem 0.45rem 0.15rem 1.15rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5EEAD4;
}

.erp-type-radio-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: 10px;
}

.erp-type-radio {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--erp-text);
}

.erp-type-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.erp-type-radio-mark {
  width: 1rem;
  height: 1rem;
  border: 2px solid #9CA3AF;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.erp-type-radio input:checked ~ .erp-type-radio-mark {
  border-color: var(--erp-primary);
}

.erp-type-radio input:checked ~ .erp-type-radio-mark::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--erp-primary);
  border-radius: 50%;
}

.erp-type-radio-add span:last-child {
  color: var(--erp-header);
  font-weight: 600;
}

.erp-type-new-box {
  max-width: 320px;
}

.erp-master-new-box {
  max-width: 100%;
}

.erp-master-new-box .form-control-sm {
  max-width: 320px;
}

[data-erp-theme="dark"] .erp-type-radio-list {
  background: #111827;
  border-color: #374151;
}

.erp-price-block {
  background: var(--erp-surface, #f8fafc);
  border: 1px solid var(--erp-border, #e2e8f0);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
}

.erp-price-block-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--erp-muted, #64748b);
  margin-bottom: 0.65rem;
}

.erp-price-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
}

.erp-price-line label,
.erp-price-line span:first-child {
  flex: 1;
  min-width: 0;
}

.erp-price-line .form-control {
  width: 7.5rem;
  text-align: right;
}

.erp-price-add label::before {
  content: "";
}

.erp-price-divider {
  border-top: 1px dashed var(--erp-border, #cbd5e1);
  margin: 0.35rem 0;
}

.erp-price-result {
  font-size: 0.95rem;
  padding-top: 0.5rem;
}

.erp-price-result strong {
  font-size: 1.05rem;
}

.erp-price-mrp {
  background: #fffbeb;
  border-color: #fcd34d;
}

.erp-price-summary {
  background: #f0fdf4;
  border-color: #86efac;
}

.erp-price-table th,
.erp-price-table td {
  min-width: 6.5rem;
  white-space: nowrap;
  vertical-align: middle;
}

.erp-price-table th:first-child,
.erp-price-table td:first-child {
  min-width: 9rem;
}

.erp-price-table th {
  font-size: 0.78rem;
  font-weight: 600;
}

.erp-nav-soon {
  opacity: 0.55;
  cursor: default;
}
.erp-nav-soon:hover {
  background: transparent;
}
.erp-nav-soon .erp-soon-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid currentColor;
  border-radius: 0.5rem;
  padding: 0 0.3rem;
  margin-left: auto;
  opacity: 0.8;
}

.erp-price-table .form-control,
.erp-price-table .form-select {
  min-width: 5rem;
}

.erp-price-dp strong {
  color: #15803d;
}

[data-erp-theme="dark"] .erp-price-block {
  background: #111827;
  border-color: #374151;
}

[data-erp-theme="dark"] .erp-price-mrp {
  background: #1c1917;
  border-color: #854d0e;
}

[data-erp-theme="dark"] .erp-price-summary {
  background: #052e16;
  border-color: #166534;
}

.erp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.erp-header {
  height: var(--erp-header-height);
  background: var(--erp-header);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
  gap: 0.5rem;
  min-width: 0;
}

.erp-header-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.erp-header-badge {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-left: 0.75rem;
}

.erp-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.erp-header-user {
  font-size: 0.875rem;
  opacity: 0.95;
}

.erp-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
}

/* ── Horizontal scroll (pricing grids, wide tables) ── */
.erp-h-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: auto;
  scrollbar-color: #6366f1 #e2e8f0;
}

.erp-h-scroll::-webkit-scrollbar {
  height: 10px;
}

.erp-h-scroll::-webkit-scrollbar-track {
  background: #e2e8f0;
}

.erp-h-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #6366f1 0%, #818cf8 100%);
  border-radius: 999px;
  border: 2px solid #e2e8f0;
  min-width: 48px;
}

.erp-h-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #818cf8 0%, #a5b4fc 100%);
}

.erp-h-scroll table {
  min-width: max-content;
  margin-bottom: 0;
  white-space: nowrap;
}

.erp-h-scroll td,
.erp-h-scroll th {
  white-space: nowrap;
}

#batchTierGrids .erp-h-scroll {
  border-top: 1px solid var(--erp-border);
}

/* Allow horizontal scroll inside Bootstrap grid columns */
.erp-col-min {
  min-width: 0;
}

.erp-sidebar-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  margin-right: 0.75rem;
  cursor: pointer;
}

@media (max-width: 991.98px) {
  .erp-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--erp-header-height);
    background: rgba(31, 41, 55, 0.5);
    z-index: 1035;
  }
  .erp-sidebar-overlay.show { display: block; }
}

/* ── Page header ── */
.erp-page-header {
  margin-bottom: 1.5rem;
}

.erp-page-header h1,
.erp-page-header h2 {
  color: var(--erp-text);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.erp-page-header .lead {
  color: var(--erp-text-muted);
  font-size: 0.925rem;
  margin-bottom: 0;
}

.erp-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ── KPI cards ── */
.erp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.erp-kpi-card {
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--erp-card-shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.erp-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(31, 41, 55, 0.1);
}

.erp-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.erp-kpi-icon.teal { background: rgba(20, 184, 166, 0.12); color: var(--erp-primary); }
.erp-kpi-icon.green { background: rgba(16, 185, 129, 0.12); color: var(--erp-success); }
.erp-kpi-icon.amber { background: rgba(245, 158, 11, 0.12); color: var(--erp-warning); }
.erp-kpi-icon.red { background: rgba(239, 68, 68, 0.12); color: var(--erp-danger); }
.erp-kpi-icon.grey { background: rgba(55, 65, 81, 0.1); color: var(--erp-sidebar); }

.erp-kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--erp-text-muted);
  margin-bottom: 0.2rem;
}

.erp-kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--erp-text);
  line-height: 1.2;
}

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

/* ── Cards & tables ── */
.card {
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  box-shadow: var(--erp-card-shadow);
  background: #fff;
}

.card-header {
  background: #fff;
  border-bottom: 1px solid var(--erp-border);
  font-weight: 600;
  color: var(--erp-text);
  padding: 0.85rem 1.15rem;
  border-radius: 12px 12px 0 0 !important;
}

.table {
  --bs-table-border-color: var(--erp-border);
  color: var(--erp-text);
}

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

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(249, 250, 251, 0.8);
}

/* ── Buttons ── */
.btn-primary {
  background: var(--erp-primary);
  border-color: var(--erp-primary);
  font-weight: 500;
}

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

.btn-success { background: var(--erp-success); border-color: var(--erp-success); }
.btn-warning { background: var(--erp-warning); border-color: var(--erp-warning); color: #fff; }
.btn-danger { background: var(--erp-danger); border-color: var(--erp-danger); }

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

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--erp-primary);
  border-color: var(--erp-primary);
  color: #fff;
}

.erp-btn-header {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 0.82rem;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}

.erp-btn-header:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.erp-btn-header-solid {
  background: #fff;
  color: var(--erp-header);
  border: none;
  font-weight: 600;
}

.erp-btn-header-solid:hover {
  background: #F0FDFA;
  color: var(--erp-header-dark);
}

/* ── Theme switcher (header) ── */
.erp-theme-switcher {
  flex-shrink: 0;
  position: relative;
}

.erp-theme-switcher .erp-theme-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  color: var(--erp-header);
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}

.erp-theme-switcher .erp-theme-trigger:hover {
  background: #F0FDFA;
  color: var(--erp-header-dark);
}

.erp-theme-switcher .dropdown-toggle::after {
  margin-left: 0.25rem;
  vertical-align: middle;
}

.erp-theme-switcher .dropdown-menu {
  border: 1px solid var(--erp-border);
  border-radius: 10px;
  box-shadow: var(--erp-card-shadow);
  padding: 0.35rem;
  min-width: 11rem;
}

.erp-theme-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: none;
  background: none;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--erp-text);
  text-align: left;
  cursor: pointer;
}

.erp-theme-option:hover { background: var(--erp-bg); }
.erp-theme-option.active { background: rgba(99, 102, 241, 0.12); font-weight: 600; }

.erp-theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--erp-border);
  flex-shrink: 0;
}

.erp-theme-login-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1050;
}

.erp-theme-login-btn .erp-theme-trigger {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  background: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

.erp-theme-login-btn .erp-theme-trigger:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
}

/* ── Forms ── */
.form-control, .form-select {
  border-color: var(--erp-border);
  border-radius: 8px;
  color: var(--erp-text);
}

.form-control:focus, .form-select:focus {
  border-color: var(--erp-primary);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.form-label {
  font-weight: 500;
  color: var(--erp-text);
  font-size: 0.875rem;
}

/* ── Alerts ── */
.alert {
  border-radius: 10px;
  border: none;
}

.alert-success { background: rgba(16, 185, 129, 0.12); color: #047857; }
.alert-danger { background: rgba(239, 68, 68, 0.12); color: #B91C1C; }
.alert-warning { background: rgba(245, 158, 11, 0.12); color: #B45309; }

/* ── Login page (dark atmospheric background) ── */
.erp-login-body {
  margin: 0;
  background: #050810;
}

.erp-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #050810;
}

.erp-login-page::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url('/images/mdw-login-bg.png') center center / cover no-repeat fixed;
  filter: brightness(0.72) contrast(1.08) saturate(1.05);
  transform: scale(1.02);
}

.erp-login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 50% 40% at 20% 15%, rgba(251, 146, 60, 0.15) 0%, transparent 55%),
    radial-gradient(ellipse 45% 35% at 85% 80%, rgba(13, 110, 253, 0.12) 0%, transparent 50%),
    linear-gradient(160deg, rgba(8, 12, 22, 0.62) 0%, rgba(15, 23, 42, 0.48) 50%, rgba(5, 8, 16, 0.68) 100%);
  pointer-events: none;
}

.erp-login-page > * {
  position: relative;
  z-index: 2;
}

.erp-login-card {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 16px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 48px rgba(34, 211, 238, 0.08);
  overflow: hidden;
  max-width: 440px;
  width: 100%;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.erp-login-card-wide {
  max-width: 520px;
}

.erp-login-tabs .nav-link {
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
}

.erp-login-tabs .nav-link.active {
  background: var(--erp-primary);
}

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

.erp-login-brand {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.92;
}

.erp-login-header h3 {
  margin: 0;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.35;
}

.erp-login-header p {
  margin: 0.35rem 0 0;
  opacity: 0.9;
  font-size: 0.875rem;
}

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

.erp-login-footer {
  padding: 0 2rem 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--erp-text-muted);
}

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

/* ── Franchise portal accent ── */
.erp-franchise .erp-sidebar-brand small { color: #5EEAD4; }
.erp-franchise .erp-nav-link.active { color: #5EEAD4; }

/* ── Misc ── */
.text-muted { color: var(--erp-text-muted) !important; }
a { color: var(--bs-link-color, var(--erp-primary)); }
a:hover { color: var(--bs-link-hover-color, var(--erp-primary-hover)); }

.badge.bg-primary { background: var(--erp-primary) !important; }

h2, h3, h4, h5 { color: var(--erp-text); }

.bg-light { background-color: var(--erp-bg) !important; }

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

/* ── Theme: Modern (card-based, rounded, indigo/navy) ── */
[data-erp-theme="modern"] .card,
[data-erp-theme="modern"] .erp-kpi-card {
  border-radius: var(--erp-radius-card);
  border: none;
  box-shadow: var(--erp-card-shadow);
}

[data-erp-theme="modern"] .erp-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.18);
}

[data-erp-theme="modern"] .erp-nav-link.active {
  background: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
}

[data-erp-theme="modern"] .erp-topbar {
  box-shadow: 0 2px 12px rgba(67, 56, 202, 0.25);
}

[data-erp-theme="modern"] .erp-right-widgets {
  background: linear-gradient(180deg, #eef2ff 0%, #fff 100%);
}

[data-erp-theme="modern"] .btn-primary {
  border-radius: var(--erp-radius-btn);
}

[data-erp-theme="modern"] .erp-login-page::before {
  background:
    radial-gradient(ellipse 55% 45% at 12% 18%, rgba(129, 140, 248, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 88% 80%, rgba(99, 102, 241, 0.24) 0%, transparent 55%),
    linear-gradient(160deg, rgba(5, 8, 16, 0.9) 0%, rgba(30, 58, 138, 0.75) 50%, rgba(5, 8, 16, 0.92) 100%);
}

[data-erp-theme="modern"] .erp-franchise .erp-sidebar-brand small { color: #c7d2fe; }
[data-erp-theme="modern"] .erp-franchise .erp-nav-link.active { color: #c7d2fe; }

/* ── Theme: Classical (traditional ERP — light sidebar, tables, sharp corners) ── */
[data-erp-theme="classical"],
[data-erp-theme="classic"] {
  --erp-sidebar: #E9ECEF;
  --erp-sidebar-hover: #DEE2E6;
  --erp-sidebar-active: #0D6EFD;
  --erp-header: #0D6EFD;
  --erp-header-dark: #0A58CA;
  --erp-bg: #F5F4EF;
  --erp-primary: #0D6EFD;
  --erp-primary-hover: #0B5ED7;
  --erp-text: #212529;
  --erp-text-muted: #6C757D;
  --erp-border: #CED4DA;
  --erp-card-shadow: none;
  --bs-primary: #0D6EFD;
  --bs-primary-rgb: 13, 110, 253;
  --bs-link-color: #0D6EFD;
  --bs-link-hover-color: #0A58CA;
  --bs-body-bg: #F5F4EF;
  --erp-radius-card: 2px;
  --erp-radius-btn: 2px;
  --erp-radius-nav: 2px;
}

[data-erp-theme="classical"] body,
[data-erp-theme="classic"] body {
  font-family: Tahoma, "Segoe UI", Geneva, Verdana, sans-serif;
}

[data-erp-theme="classical"] .erp-topbar,
[data-erp-theme="classic"] .erp-topbar {
  background: #fff;
  color: #212529;
  box-shadow: 0 1px 0 #dee2e6;
  border-bottom: 1px solid #dee2e6;
}

[data-erp-theme="classical"] .erp-topbar-logo,
[data-erp-theme="classic"] .erp-topbar-logo,
[data-erp-theme="classical"] .erp-topbar-icon,
[data-erp-theme="classic"] .erp-topbar-icon {
  color: #212529;
}

[data-erp-theme="classical"] .erp-topbar-icon:hover,
[data-erp-theme="classic"] .erp-topbar-icon:hover {
  background: #f8f9fa;
  color: #0d6efd;
}

[data-erp-theme="classical"] .erp-topbar-user,
[data-erp-theme="classic"] .erp-topbar-user,
[data-erp-theme="classical"] .erp-topbar-branch,
[data-erp-theme="classic"] .erp-topbar-branch {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #212529;
}

[data-erp-theme="classical"] .erp-topbar-menu,
[data-erp-theme="classic"] .erp-topbar-menu {
  background: #f8f9fa;
  color: #212529;
  border: 1px solid #dee2e6;
}

[data-erp-theme="classical"] .erp-theme-switcher .erp-theme-trigger,
[data-erp-theme="classic"] .erp-theme-switcher .erp-theme-trigger {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #212529;
}

[data-erp-theme="classical"] .erp-sidebar,
[data-erp-theme="classic"] .erp-sidebar {
  background: #E9ECEF;
  color: #212529;
  border-right: 2px solid #ADB5BD;
}

[data-erp-theme="classical"] .erp-sidebar-brand,
[data-erp-theme="classic"] .erp-sidebar-brand {
  border-bottom-color: #CED4DA;
}

[data-erp-theme="classical"] .erp-sidebar-brand a,
[data-erp-theme="classic"] .erp-sidebar-brand a {
  color: #212529;
}

[data-erp-theme="classical"] .erp-sidebar-brand small,
[data-erp-theme="classic"] .erp-sidebar-brand small,
[data-erp-theme="classical"] .erp-nav-section,
[data-erp-theme="classic"] .erp-nav-section,
[data-erp-theme="classical"] .erp-nav-section-toggle,
[data-erp-theme="classic"] .erp-nav-section-toggle {
  color: #1f2937;
  font-weight: 700;
}

[data-erp-theme="classical"] .erp-nav-link,
[data-erp-theme="classic"] .erp-nav-link,
[data-erp-theme="classical"] .erp-nav-toggle,
[data-erp-theme="classic"] .erp-nav-toggle {
  color: #111827;
  font-weight: 600;
  border-radius: var(--erp-radius-nav);
}

[data-erp-theme="classical"] .erp-nav-link:hover,
[data-erp-theme="classic"] .erp-nav-link:hover,
[data-erp-theme="classical"] .erp-nav-toggle:hover,
[data-erp-theme="classic"] .erp-nav-toggle:hover,
[data-erp-theme="classical"] .erp-nav-section-toggle:hover,
[data-erp-theme="classic"] .erp-nav-section-toggle:hover {
  background: #DEE2E6;
  color: #212529;
}

[data-erp-theme="classical"] .erp-nav-link.active,
[data-erp-theme="classic"] .erp-nav-link.active {
  background: #fff;
  color: #0b5ed7;
  border: 1px solid #94a3b8;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

[data-erp-theme="classical"] .card,
[data-erp-theme="classic"] .card,
[data-erp-theme="classical"] .erp-kpi-card,
[data-erp-theme="classic"] .erp-kpi-card {
  border-radius: var(--erp-radius-card);
  border: 1px solid #ADB5BD;
  box-shadow: none;
}

[data-erp-theme="classical"] .erp-kpi-card:hover,
[data-erp-theme="classic"] .erp-kpi-card:hover {
  transform: none;
}

[data-erp-theme="classical"] .card-header,
[data-erp-theme="classic"] .card-header {
  background: #F8F9FA;
  border-bottom: 1px solid #CED4DA;
  font-weight: 600;
}

[data-erp-theme="classical"] .table,
[data-erp-theme="classic"] .table {
  border: 1px solid #ADB5BD;
}

[data-erp-theme="classical"] .table thead th,
[data-erp-theme="classic"] .table thead th {
  background: #E9ECEF;
  border-bottom: 2px solid #ADB5BD;
  font-weight: 600;
}

[data-erp-theme="classical"] .table-striped > tbody > tr:nth-of-type(odd) > *,
[data-erp-theme="classic"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background: #fafafa;
}

[data-erp-theme="classical"] .btn,
[data-erp-theme="classic"] .btn {
  border-radius: var(--erp-radius-btn);
}

[data-erp-theme="classical"] .form-control,
[data-erp-theme="classic"] .form-control,
[data-erp-theme="classical"] .form-select,
[data-erp-theme="classic"] .form-select {
  border-radius: 2px;
  border-color: #ADB5BD;
}

[data-erp-theme="classical"] .erp-header,
[data-erp-theme="classic"] .erp-header {
  background: #fff;
  color: #212529;
  border-bottom: 1px solid #dee2e6;
  box-shadow: none;
}

[data-erp-theme="classical"] .erp-header-badge,
[data-erp-theme="classic"] .erp-header-badge {
  background: #e9ecef;
  color: #495057;
}

[data-erp-theme="classical"] .erp-btn-header,
[data-erp-theme="classic"] .erp-btn-header {
  color: #0d6efd;
  border: 1px solid #ced4da;
  background: #fff;
}

[data-erp-theme="classical"] .erp-btn-header-solid,
[data-erp-theme="classic"] .erp-btn-header-solid {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

[data-erp-theme="classical"] .erp-sidebar-toggle,
[data-erp-theme="classic"] .erp-sidebar-toggle {
  background: #f8f9fa;
  color: #212529;
  border: 1px solid #dee2e6;
}

[data-erp-theme="classical"] .erp-kpi-icon.teal,
[data-erp-theme="classic"] .erp-kpi-icon.teal {
  background: rgba(13, 110, 253, 0.12);
  color: #0D6EFD;
  border-radius: 2px;
}

[data-erp-theme="classical"] .erp-login-page::before,
[data-erp-theme="classic"] .erp-login-page::before {
  background:
    radial-gradient(ellipse 50% 40% at 20% 25%, rgba(13, 110, 253, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse 45% 35% at 80% 70%, rgba(34, 211, 238, 0.1) 0%, transparent 50%),
    linear-gradient(160deg, rgba(5, 8, 16, 0.92) 0%, rgba(33, 37, 41, 0.85) 100%);
}

[data-erp-theme="classical"] .erp-login-card,
[data-erp-theme="classic"] .erp-login-card {
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65);
  background: rgba(255, 255, 255, 0.97);
}

[data-erp-theme="classical"] .erp-right-widgets,
[data-erp-theme="classic"] .erp-right-widgets {
  background: #f8f9fa;
}

[data-erp-theme="classical"] .erp-theme-footer,
[data-erp-theme="classic"] .erp-theme-footer {
  display: block;
}

.erp-theme-footer {
  display: none;
  margin-top: 2rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--erp-border);
  text-align: center;
  color: var(--erp-text-muted);
  font-size: 0.8rem;
}

[data-erp-theme="classical"] .erp-franchise .erp-sidebar-brand small,
[data-erp-theme="classic"] .erp-franchise .erp-sidebar-brand small {
  color: #495057;
}

[data-erp-theme="classical"] .erp-franchise .erp-nav-link.active,
[data-erp-theme="classic"] .erp-franchise .erp-nav-link.active {
  color: #0D6EFD;
}

.erp-global-search-type {
  max-width: 6.5rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.95);
  border: none;
}

.erp-advanced-search {
  border: 1px solid var(--erp-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--erp-surface, #fff);
}

.erp-advanced-search-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
  text-align: left;
  cursor: pointer;
}

.erp-advanced-search-form.card-body {
  border-top: 1px solid var(--erp-border);
  padding: 1rem;
}

.erp-advanced-search--compact .erp-advanced-search-form--inline {
  padding: 0;
  border: none;
  background: transparent;
}

/* ── Responsive layout — fit screen, no page overflow ── */
html {
  overflow-x: clip;
  max-width: 100%;
}

body {
  overflow-x: clip;
  max-width: 100%;
}

.erp-app {
  max-width: 100%;
  overflow-x: clip;
}

.erp-app.erp-franchise {
  flex-direction: row;
  min-height: 100vh;
  max-width: 100%;
  overflow: hidden;
}

.erp-app.erp-franchise .erp-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.erp-content main,
.erp-content .card,
.erp-content .card-body,
.erp-content .container,
.erp-content .container-fluid {
  max-width: 100%;
  min-width: 0;
}

.erp-content main {
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

.erp-content .row {
  max-width: 100%;
  margin-left: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
  margin-right: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
}

.erp-content .row > [class*="col"] {
  min-width: 0;
}

.erp-content img,
.erp-content video,
.erp-content svg,
.erp-content canvas {
  max-width: 100%;
  height: auto;
}

.erp-content .form-control,
.erp-content .form-select,
.erp-content textarea {
  max-width: 100%;
  min-width: 0;
}

.erp-content .input-group {
  flex-wrap: wrap;
  max-width: 100%;
}

.erp-content .table-responsive,
.erp-content .erp-h-scroll {
  max-width: 100%;
  width: 100%;
}

.erp-content .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.erp-content .btn-group,
.erp-content .btn-toolbar {
  flex-wrap: wrap;
  max-width: 100%;
}

.erp-content .d-flex.gap-1,
.erp-content .d-flex.gap-2,
.erp-content .d-flex.gap-3 {
  flex-wrap: wrap;
  max-width: 100%;
}

.erp-content .alert {
  overflow-wrap: anywhere;
}

.erp-content pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
  overflow-x: auto;
}

.erp-page-title-bar,
.erp-page-header {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.erp-topbar {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.erp-topbar-right {
  flex-shrink: 1;
  min-width: 0;
}

.erp-header {
  max-width: 100%;
  overflow: hidden;
}

.erp-header-actions {
  flex-shrink: 1;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.erp-header-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* POS — stack summary on small screens */
.erp-pos-summary {
  position: static !important;
  top: auto !important;
}

#posProductGrid {
  max-width: 100%;
}

.pos-product-card {
  min-width: 0;
  max-width: 100%;
}

.pos-product-card .card-body {
  min-width: 0;
}

/* Franchise / warehouse mobile sidebar */
@media (max-width: 991.98px) {
  .erp-app.erp-franchise .erp-sidebar {
    position: fixed;
    top: var(--erp-header-height);
    left: 0;
    bottom: 0;
    height: auto;
    max-height: none;
    width: min(280px, 88vw);
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .erp-app.erp-franchise .erp-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.35);
  }

  .erp-app.erp-franchise .erp-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--erp-header-height);
    background: rgba(31, 41, 55, 0.5);
    z-index: 1035;
  }

  .erp-app.erp-franchise .erp-sidebar-overlay.show {
    display: block;
  }

  .erp-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .erp-content {
    padding: 1rem;
  }

  .erp-page-title-bar h2 {
    font-size: 1.15rem;
  }

  .erp-content form .w-25,
  .erp-content form .w-50 {
    width: 100% !important;
    max-width: 100%;
  }

  .erp-btn-header {
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 575.98px) {
  .erp-content {
    padding: 0.75rem;
  }

  .erp-kpi-grid-4 {
    grid-template-columns: 1fr;
  }

  .erp-header-badge {
    display: none !important;
  }

  .erp-header-user {
    display: none !important;
  }

  .erp-global-search {
    display: none !important;
  }

  .erp-price-table input.form-control-sm {
    min-width: 4.5rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.35rem;
  }

  .erp-h-scroll {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-bottom: 0.25rem;
  }

  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
}

/* ── ERP typography: readable menu + page content ── */
body:not(.sf-body),
body:not(.sf-body) .erp-app,
body:not(.sf-body) .erp-login-page {
  font-family: var(--erp-font-family);
  font-size: var(--erp-font-sm);
  font-weight: 500;
}

body:not(.sf-body) h1,
body:not(.sf-body) h2,
body:not(.sf-body) h3,
body:not(.sf-body) h4,
body:not(.sf-body) h5,
body:not(.sf-body) h6,
body:not(.sf-body) .h1,
body:not(.sf-body) .h2,
body:not(.sf-body) .h3,
body:not(.sf-body) .h4,
body:not(.sf-body) .h5,
body:not(.sf-body) .h6 {
  font-family: var(--erp-font-family);
  font-size: var(--erp-font-md) !important;
  font-weight: 700;
  line-height: 1.35;
}

body:not(.sf-body) small,
body:not(.sf-body) .small,
body:not(.sf-body) .form-text,
body:not(.sf-body) .text-muted,
body:not(.sf-body) .erp-theme-footer,
body:not(.sf-body) .erp-panel-title,
body:not(.sf-body) .erp-price-block-title {
  font-size: var(--erp-font-xs) !important;
  font-weight: 500;
}

body:not(.sf-body) .badge {
  font-size: var(--erp-font-xs) !important;
  font-weight: 600;
}

body:not(.sf-body) .erp-page-title-bar h2,
body:not(.sf-body) .erp-page-header h1,
body:not(.sf-body) .erp-page-header h2,
body:not(.sf-body) .erp-header-title {
  font-size: var(--erp-font-md) !important;
  font-weight: 700;
}

body:not(.sf-body) .table,
body:not(.sf-body) .table td,
body:not(.sf-body) .table th {
  font-size: var(--erp-font-sm);
  font-family: var(--erp-font-family);
  font-weight: 500;
}

body:not(.sf-body) .table > :not(caption) > * > * {
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
}

body:not(.sf-body) .table thead th {
  font-size: var(--erp-font-xs);
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  color: #111827;
}

body:not(.sf-body) .btn,
body:not(.sf-body) .erp-btn-header,
body:not(.sf-body) .dropdown-item,
body:not(.sf-body) .nav-link,
body:not(.sf-body) .page-link {
  font-family: var(--erp-font-family);
  font-size: var(--erp-font-sm);
  font-weight: 600;
  line-height: 1.3;
  padding: 0.3rem 0.6rem;
}

body:not(.sf-body) .form-control-sm,
body:not(.sf-body) .form-select-sm,
body:not(.sf-body) .input-group-sm > .form-control {
  font-size: var(--erp-font-xs) !important;
  font-weight: 500;
  padding: 0.2rem 0.4rem;
}

body:not(.sf-body) .btn-sm,
body:not(.sf-body) .btn-group-sm > .btn {
  font-size: var(--erp-font-xs) !important;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
}

body:not(.sf-body) .btn-lg {
  font-size: var(--erp-font-md) !important;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
}

body:not(.sf-body) .form-control,
body:not(.sf-body) .form-select,
body:not(.sf-body) .input-group-text {
  font-family: var(--erp-font-family);
  font-size: var(--erp-font-sm);
  font-weight: 500;
  padding: 0.3rem 0.5rem;
  min-height: auto;
  line-height: 1.3;
}

body:not(.sf-body) .form-label,
body:not(.sf-body) label {
  font-size: var(--erp-font-sm);
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: #111827;
}

body:not(.sf-body) .alert {
  font-size: var(--erp-font-sm);
  padding: 0.4rem 0.65rem;
  margin-bottom: 0.5rem;
}

body:not(.sf-body) .card,
body:not(.sf-body) .card-body,
body:not(.sf-body) .card-header,
body:not(.sf-body) .modal-body,
body:not(.sf-body) .modal-header,
body:not(.sf-body) .modal-footer,
body:not(.sf-body) p,
body:not(.sf-body) li,
body:not(.sf-body) dd,
body:not(.sf-body) dt {
  font-size: var(--erp-font-sm);
  font-family: var(--erp-font-family);
  font-weight: 500;
}

body:not(.sf-body) .card-header {
  padding: 0.35rem 0.65rem;
}

body:not(.sf-body) .card-body {
  padding: 0.5rem 0.65rem;
}

body:not(.sf-body) .erp-content {
  padding: 0.65rem 0.85rem;
}

body:not(.sf-body) .erp-page-title-bar {
  margin-bottom: 0.65rem !important;
}

body:not(.sf-body) .erp-topbar {
  height: var(--erp-header-height);
  padding: 0 0.65rem;
  font-size: var(--erp-font-sm);
}

body:not(.sf-body) .erp-topbar-logo,
body:not(.sf-body) .erp-topbar-user,
body:not(.sf-body) .erp-topbar-branch,
body:not(.sf-body) .erp-global-search .form-control,
body:not(.sf-body) .erp-global-search .btn {
  font-size: var(--erp-font-sm);
  font-weight: 600;
}

body:not(.sf-body) .erp-header {
  height: var(--erp-header-height);
  padding: 0 0.65rem;
  min-height: var(--erp-header-height);
}

body:not(.sf-body) .erp-sidebar {
  width: var(--erp-sidebar-width);
  height: calc(100vh - var(--erp-header-height));
  max-height: calc(100vh - var(--erp-header-height));
  top: var(--erp-header-height);
}

body:not(.sf-body) .erp-sidebar-brand {
  padding: 0.65rem 0.75rem 0.5rem;
}

body:not(.sf-body) .erp-sidebar-brand a {
  font-size: var(--erp-menu-font-size);
  font-weight: 700;
}

body:not(.sf-body) .erp-sidebar-brand small {
  font-size: var(--erp-menu-section-size);
  font-weight: 600;
}

body:not(.sf-body) .erp-kpi-card {
  padding: 0.65rem;
}

body:not(.sf-body) .erp-kpi-card h3,
body:not(.sf-body) .erp-kpi-card h4 {
  font-size: var(--erp-font-sm) !important;
}

body:not(.sf-body) .erp-price-table th,
body:not(.sf-body) .erp-price-table td,
body:not(.sf-body) .erp-price-table input {
  font-size: var(--erp-font-sm);
}

body:not(.sf-body) .pagination {
  font-size: var(--erp-font-sm);
  margin-bottom: 0.35rem;
}

body:not(.sf-body) .pagination .page-link {
  padding: 0.15rem 0.4rem;
}

[data-erp-theme="classical"] body:not(.sf-body),
[data-erp-theme="classic"] body:not(.sf-body) {
  font-family: var(--erp-font-family);
}

/* ── Sidebar menu: larger, dark, sharp (overrides compact 10/12px) ── */
.erp-sidebar-nav {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: optimizeLegibility;
}

.erp-sidebar .erp-nav-link,
.erp-sidebar .erp-nav-toggle,
.erp-sidebar .erp-nav-sub .erp-nav-link,
.erp-sidebar .erp-nav-subgroup-items .erp-nav-link,
.erp-sidebar .erp-nav-chain-item {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: var(--erp-menu-font-size) !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  padding: 0.42rem 0.6rem !important;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: auto;
}

.erp-sidebar .erp-nav-sub .erp-nav-link,
.erp-sidebar .erp-nav-subgroup-items .erp-nav-link {
  font-size: var(--erp-font-sm) !important;
  font-weight: 700 !important;
}

.erp-sidebar .erp-nav-section,
.erp-sidebar .erp-nav-section-toggle {
  font-size: var(--erp-menu-section-size) !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  -webkit-font-smoothing: auto;
}

.erp-sidebar .erp-nav-link .nav-icon {
  font-size: 0.95rem;
  opacity: 1;
}

/* Modern / dark sidebar */
[data-erp-theme="modern"] .erp-sidebar .erp-nav-link,
[data-erp-theme="modern"] .erp-sidebar .erp-nav-toggle {
  color: #f1f5f9 !important;
}

[data-erp-theme="modern"] .erp-sidebar .erp-nav-section,
[data-erp-theme="modern"] .erp-sidebar .erp-nav-section-toggle {
  color: #cbd5e1 !important;
}

[data-erp-theme="modern"] .erp-sidebar .erp-nav-link:hover,
[data-erp-theme="modern"] .erp-sidebar .erp-nav-toggle:hover {
  color: #fff !important;
}

[data-erp-theme="modern"] .erp-sidebar .erp-nav-link.active {
  color: #e0e7ff !important;
  font-weight: 700 !important;
}

/* Classical / light sidebar */
[data-erp-theme="classical"] .erp-sidebar .erp-nav-link,
[data-erp-theme="classic"] .erp-sidebar .erp-nav-link,
[data-erp-theme="classical"] .erp-sidebar .erp-nav-toggle,
[data-erp-theme="classic"] .erp-sidebar .erp-nav-toggle {
  color: #111827 !important;
}

[data-erp-theme="classical"] .erp-sidebar .erp-nav-section,
[data-erp-theme="classic"] .erp-sidebar .erp-nav-section,
[data-erp-theme="classical"] .erp-sidebar .erp-nav-section-toggle,
[data-erp-theme="classic"] .erp-sidebar .erp-nav-section-toggle {
  color: #374151 !important;
}

[data-erp-theme="classical"] .erp-sidebar .erp-nav-link:hover,
[data-erp-theme="classic"] .erp-sidebar .erp-nav-link:hover,
[data-erp-theme="classical"] .erp-sidebar .erp-nav-toggle:hover,
[data-erp-theme="classic"] .erp-sidebar .erp-nav-toggle:hover {
  color: #0f172a !important;
  background: #dee2e6 !important;
}

[data-erp-theme="classical"] .erp-sidebar .erp-nav-link.active,
[data-erp-theme="classic"] .erp-sidebar .erp-nav-link.active {
  color: #0b5ed7 !important;
  font-weight: 700 !important;
}

[data-erp-theme="classical"] .erp-sidebar-brand a,
[data-erp-theme="classic"] .erp-sidebar-brand a {
  color: #0f172a !important;
  font-weight: 700;
}

[data-erp-theme="classical"] .erp-sidebar-brand small,
[data-erp-theme="classic"] .erp-sidebar-brand small {
  color: #475569 !important;
  font-weight: 600;
}
