:root {
  --erp-font: 'Source Sans Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --erp-radius-sm: 10px;
  --erp-radius: 16px;
  --erp-radius-lg: 22px;
  --erp-transition: all .2s ease;
}

body {
  font-family: var(--erp-font);
}

body.erp-theme-dark {
  --erp-body: #0b1220;
  --erp-body-alt: #121b2d;
  --erp-surface: rgba(20, 28, 45, .94);
  --erp-surface-2: rgba(27, 37, 58, .96);
  --erp-surface-3: rgba(255,255,255,.04);
  --erp-border: rgba(255,255,255,.08);
  --erp-text: #edf3ff;
  --erp-text-soft: #a9b7d0;
  --erp-primary: #6ea8fe;
  --erp-primary-2: #7c5cff;
  --erp-success: #22c55e;
  --erp-warning: #f59e0b;
  --erp-danger: #ef4444;
  --erp-shadow: 0 18px 40px rgba(0,0,0,.32);
  --erp-sidebar-grad: linear-gradient(180deg, #0f1728 0%, #121b2d 45%, #0c1322 100%);
  --erp-navbar-grad: linear-gradient(90deg, rgba(17,24,39,.96), rgba(26,36,58,.96));
  --erp-content-grad: radial-gradient(1200px 600px at 5% 5%, rgba(124,92,255,.12), transparent 55%), radial-gradient(900px 550px at 100% 0%, rgba(110,168,254,.09), transparent 55%), linear-gradient(160deg, #0a111f 0%, #0f1728 45%, #0c1322 100%);
  --erp-input-bg: rgba(255,255,255,.035);
  --erp-table-stripe: rgba(255,255,255,.018);
  --erp-hover: rgba(110,168,254,.10);
}

body.erp-theme-light {
  --erp-body: #eef2f8;
  --erp-body-alt: #f7f9fc;
  --erp-surface: rgba(255,255,255,.94);
  --erp-surface-2: rgba(255,255,255,.98);
  --erp-surface-3: rgba(20, 30, 50, .03);
  --erp-border: rgba(17,24,39,.08);
  --erp-text: #162033;
  --erp-text-soft: #5c6c85;
  --erp-primary: #2563eb;
  --erp-primary-2: #6d28d9;
  --erp-success: #16a34a;
  --erp-warning: #d97706;
  --erp-danger: #dc2626;
  --erp-shadow: 0 18px 38px rgba(15, 23, 42, .08);
  --erp-sidebar-grad: linear-gradient(180deg, #162033 0%, #1e293b 65%, #162033 100%);
  --erp-navbar-grad: linear-gradient(90deg, rgba(255,255,255,.95), rgba(245,247,251,.96));
  --erp-content-grad: radial-gradient(900px 480px at 10% 0%, rgba(37,99,235,.07), transparent 56%), radial-gradient(900px 480px at 100% 0%, rgba(109,40,217,.05), transparent 52%), linear-gradient(180deg, #f4f7fb 0%, #edf2f9 100%);
  --erp-input-bg: #ffffff;
  --erp-table-stripe: rgba(37,99,235,.028);
  --erp-hover: rgba(37,99,235,.07);
}

body,
.main-footer,
.main-header,
.main-sidebar,
.content-wrapper,
.card,
.small-box,
.info-box,
.modal-content,
.dropdown-menu,
.table,
.form-control,
.select2-container--bootstrap4 .select2-selection,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.page-item .page-link,
.btn,
.breadcrumb,
.login-card-body,
.login-box .card {
  transition: var(--erp-transition);
}

body[class*="erp-theme-"] {
  background: var(--erp-body);
  color: var(--erp-text);
}

body[class*="erp-theme-"] .content-wrapper,
body[class*="erp-theme-"] .login-page {
  background: var(--erp-content-grad) !important;
}

body[class*="erp-theme-"] .main-header {
  background: var(--erp-navbar-grad) !important;
  border-bottom: 1px solid var(--erp-border);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

body.erp-theme-dark .main-header .nav-link,
body.erp-theme-dark .main-header .navbar-nav .nav-item,
body.erp-theme-dark .main-header .navbar-nav .nav-link,
body.erp-theme-dark .main-header .navbar-brand,
body.erp-theme-dark .content-header h1,
body.erp-theme-dark .content-header .breadcrumb-item,
body.erp-theme-dark .content-header .breadcrumb-item a,
body.erp-theme-dark .content-wrapper,
body.erp-theme-dark .content,
body.erp-theme-dark .card-title,
body.erp-theme-dark .card-header,
body.erp-theme-dark .card-body,
body.erp-theme-dark .main-footer,
body.erp-theme-dark .table,
body.erp-theme-dark .form-control,
body.erp-theme-dark label,
body.erp-theme-dark .small-box,
body.erp-theme-dark .info-box,
body.erp-theme-dark .login-box-msg,
body.erp-theme-dark .login-logo,
body.erp-theme-dark .text-dark {
  color: var(--erp-text) !important;
}

body.erp-theme-light .content-wrapper,
body.erp-theme-light .content,
body.erp-theme-light .card-title,
body.erp-theme-light .card-header,
body.erp-theme-light .card-body,
body.erp-theme-light .main-footer,
body.erp-theme-light .table,
body.erp-theme-light .form-control,
body.erp-theme-light label,
body.erp-theme-light .small-box,
body.erp-theme-light .info-box,
body.erp-theme-light .login-box-msg,
body.erp-theme-light .login-logo,
body.erp-theme-light .text-dark {
  color: var(--erp-text) !important;
}

body[class*="erp-theme-"] .content-wrapper {
  min-height: calc(100vh - 57px);
}

body[class*="erp-theme-"] .main-sidebar {
  background: var(--erp-sidebar-grad) !important;
  border-right: 1px solid rgba(255,255,255,.04);
}

body[class*="erp-theme-"] .brand-link {
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 14px 16px !important;
}

body[class*="erp-theme-"] .sidebar .user-panel {
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
}

body[class*="erp-theme-"] .nav-sidebar .nav-item > .nav-link {
  margin: 4px 10px;
  border-radius: 12px;
  padding: 10px 14px;
  color: rgba(255,255,255,.78);
  font-weight: 600;
}

body[class*="erp-theme-"] .nav-sidebar .nav-treeview > .nav-item > .nav-link {
  padding-left: 18px;
  margin-left: 22px;
  margin-right: 10px;
  border-radius: 10px;
  font-size: .95rem;
}

body[class*="erp-theme-"] .nav-sidebar .nav-link:hover,
body[class*="erp-theme-"] .nav-sidebar .nav-link:focus {
  background: rgba(255,255,255,.08);
  color: #fff !important;
}

body[class*="erp-theme-"] .nav-sidebar .nav-link.active,
body[class*="erp-theme-"] .nav-sidebar .menu-open > .nav-link {
  background: linear-gradient(135deg, rgba(110,168,254,.28), rgba(124,92,255,.30)) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 8px 24px rgba(59, 130, 246, .18);
}

body[class*="erp-theme-"] .content-header {
  padding-top: 20px;
  padding-bottom: 6px;
}

body[class*="erp-theme-"] .breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 0;
}

body[class*="erp-theme-"] .breadcrumb-item,
body[class*="erp-theme-"] .breadcrumb-item a {
  color: var(--erp-text-soft) !important;
}

body[class*="erp-theme-"] .card,
body[class*="erp-theme-"] .small-box,
body[class*="erp-theme-"] .info-box,
body[class*="erp-theme-"] .modal-content,
body[class*="erp-theme-"] .login-box .card {
  background: var(--erp-surface) !important;
  border: 1px solid var(--erp-border) !important;
  box-shadow: var(--erp-shadow);
  border-radius: var(--erp-radius);
  overflow: hidden;
}

body[class*="erp-theme-"] .card-header,
body[class*="erp-theme-"] .modal-header {
  background: var(--erp-surface-3) !important;
  border-bottom: 1px solid var(--erp-border) !important;
}

body[class*="erp-theme-"] .card-footer,
body[class*="erp-theme-"] .modal-footer,
body[class*="erp-theme-"] .main-footer {
  background: var(--erp-surface-2) !important;
  border-top: 1px solid var(--erp-border) !important;
}

body[class*="erp-theme-"] .table thead th {
  border-bottom: 1px solid var(--erp-border) !important;
  border-top: 0 !important;
  background: var(--erp-surface-3);
  color: var(--erp-text);
  font-weight: 700;
}

body[class*="erp-theme-"] .table td,
body[class*="erp-theme-"] .table th {
  border-color: var(--erp-border) !important;
}

body[class*="erp-theme-"] .table-striped tbody tr:nth-of-type(odd) {
  background: var(--erp-table-stripe);
}

body[class*="erp-theme-"] .table-hover tbody tr:hover {
  background: var(--erp-hover) !important;
}

body[class*="erp-theme-"] .form-control,
body[class*="erp-theme-"] .custom-select,
body[class*="erp-theme-"] .select2-container--bootstrap4 .select2-selection,
body[class*="erp-theme-"] .select2-container--default .select2-selection--single,
body[class*="erp-theme-"] .select2-container--default .select2-selection--multiple {
  background: var(--erp-input-bg) !important;
  border: 1px solid var(--erp-border) !important;
  color: var(--erp-text) !important;
  border-radius: 12px !important;
  min-height: 42px;
  box-shadow: none !important;
}

body[class*="erp-theme-"] .form-control::placeholder { color: var(--erp-text-soft); }
body[class*="erp-theme-"] .input-group-text {
  background: var(--erp-surface-3) !important;
  color: var(--erp-text);
  border-color: var(--erp-border) !important;
}

body[class*="erp-theme-"] .btn {
  border-radius: 12px;
  font-weight: 700;
  box-shadow: none !important;
}

body[class*="erp-theme-"] .btn-default,
body[class*="erp-theme-"] .btn-light {
  background: var(--erp-surface-3) !important;
  color: var(--erp-text) !important;
  border-color: var(--erp-border) !important;
}

body[class*="erp-theme-"] .btn-default:hover,
body[class*="erp-theme-"] .btn-light:hover {
  background: var(--erp-hover) !important;
}

body[class*="erp-theme-"] .btn-primary {
  background: linear-gradient(135deg, var(--erp-primary), var(--erp-primary-2));
  border-color: transparent !important;
}

body[class*="erp-theme-"] .btn-success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border-color: transparent !important;
}

body[class*="erp-theme-"] .btn-warning {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border-color: transparent !important;
  color: #fff !important;
}

body[class*="erp-theme-"] .btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  border-color: transparent !important;
}

body[class*="erp-theme-"] .small-box {
  border-radius: 18px;
}

body[class*="erp-theme-"] .small-box .inner {
  padding: 18px 18px 10px;
}

body[class*="erp-theme-"] .small-box .inner h3 {
  font-size: 2rem;
  font-weight: 800;
}

body[class*="erp-theme-"] .small-box .inner p {
  font-weight: 700;
  opacity: .95;
}

body[class*="erp-theme-"] .small-box .icon {
  top: 12px;
  right: 14px;
  font-size: 56px;
  opacity: .22;
}

body[class*="erp-theme-"] .small-box-footer {
  background: rgba(0,0,0,.15) !important;
  color: #fff !important;
  font-weight: 700;
}

body[class*="erp-theme-"] .info-box {
  min-height: 108px;
  padding: 10px;
}

body[class*="erp-theme-"] .info-box .info-box-icon {
  border-radius: 14px;
}

body[class*="erp-theme-"] .main-footer {
  color: var(--erp-text-soft) !important;
}

body[class*="erp-theme-"] .page-item .page-link,
body[class*="erp-theme-"] .pagination .paginate_button .page-link {
  background: var(--erp-surface) !important;
  border-color: var(--erp-border) !important;
  color: var(--erp-text) !important;
}

body[class*="erp-theme-"] .page-item.active .page-link {
  background: linear-gradient(135deg, var(--erp-primary), var(--erp-primary-2)) !important;
  border-color: transparent !important;
}

body[class*="erp-theme-"] .dataTables_wrapper .dataTables_length,
body[class*="erp-theme-"] .dataTables_wrapper .dataTables_filter,
body[class*="erp-theme-"] .dataTables_wrapper .dataTables_info,
body[class*="erp-theme-"] .dataTables_wrapper .dataTables_processing,
body[class*="erp-theme-"] .dataTables_wrapper .dataTables_paginate {
  color: var(--erp-text-soft) !important;
}

body[class*="erp-theme-"] .irs--flat .irs-line,
body[class*="erp-theme-"] .irs--flat .irs-bar,
body[class*="erp-theme-"] .progress {
  border-radius: 999px;
}

.erp-navbar-company {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--erp-surface-3);
  border: 1px solid var(--erp-border);
  color: var(--erp-text) !important;
  font-weight: 700;
  max-width: min(460px, 44vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-navbar-company i {
  color: var(--erp-primary);
}

.erp-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px !important;
  border-radius: 999px;
  background: var(--erp-surface-3);
  border: 1px solid var(--erp-border);
  color: var(--erp-text) !important;
  font-weight: 700;
}

.erp-theme-toggle:hover {
  background: var(--erp-hover);
}

.erp-dashboard-hero {
  margin-bottom: 18px;
  padding: 26px 26px 16px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(110,168,254,.18), rgba(124,92,255,.15));
  border: 1px solid var(--erp-border);
  box-shadow: var(--erp-shadow);
}

.erp-dashboard-hero h1,
.erp-dashboard-hero h2,
.erp-dashboard-hero h3,
.erp-dashboard-hero p,
.erp-dashboard-hero small,
.erp-dashboard-hero span {
  color: var(--erp-text) !important;
}

.erp-section-subtitle {
  color: var(--erp-text-soft);
  font-size: .95rem;
}

.login-page {
  position: relative;
}

.login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 25, .35);
  pointer-events: none;
}

body.erp-theme-light.login-page::before,
body.erp-theme-light .login-page::before {
  background: rgba(255,255,255,.16);
}

.login-box {
  width: 390px;
  position: relative;
  z-index: 1;
}

.login-card-body {
  border-radius: 22px;
  padding: 32px;
  background: transparent !important;
}

.login-logo {
  font-size: 2rem;
  margin-bottom: 10px;
}

.login-box-msg {
  color: var(--erp-text-soft) !important;
  margin-bottom: 22px;
}

@media (max-width: 991.98px) {
  .erp-navbar-company {
    max-width: 52vw;
  }
}

@media (max-width: 767.98px) {
  .erp-navbar-company {
    display: none;
  }

  .erp-theme-toggle span {
    display: none;
  }

  .content-header .breadcrumb {
    float: none !important;
    margin-top: 8px;
  }

  .login-box {
    width: calc(100% - 24px);
  }
}
