:root {
  --premium-sidebar: linear-gradient(180deg, var(--sys-sidebar-start, #251033) 0%, var(--sys-sidebar-mid, var(--sys-primary-dark)) 48%, var(--sys-sidebar-end, #180b22) 100%);
  --premium-topbar: linear-gradient(90deg, var(--sys-primary-dark) 0%, var(--sys-primary) 58%, var(--sys-primary-light) 100%);
  --premium-surface: rgba(255, 255, 255, 0.96);
  --premium-border: rgba(var(--sys-primary-rgb), 0.12);
  --premium-shadow: 0 18px 45px rgba(22, 10, 32, 0.1);
  --premium-shadow-soft: 0 10px 28px rgba(22, 10, 32, 0.08);
}

body {
  background:
    radial-gradient(circle at top right, rgba(var(--sys-primary-rgb), 0.12), transparent 32rem),
    linear-gradient(180deg, #fbf9fd 0%, var(--sys-background) 42%, #f7f4fa 100%);
}

.wrapper {
  background: transparent;
}

.content-wrapper {
  background: transparent;
}

.content-header {
  padding: 18px 18px 10px;
}

.content-header h1 {
  letter-spacing: -0.02em;
  font-size: 1.55rem;
  font-weight: 800;
}

.content-header .breadcrumb {
  padding: 0.55rem 0.8rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--premium-border);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(22, 10, 32, 0.05);
}

.content {
  padding: 0 18px 18px;
}

body .main-header.navbar,
body .main-header.navbar.navbar-dark {
  min-height: 58px;
  border-bottom: 0;
  background: var(--premium-topbar) !important;
  box-shadow: 0 14px 34px rgba(38, 16, 50, 0.2);
}

.main-header .nav-link {
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88) !important;
  font-weight: 700;
}

.main-header .nav-link:hover,
.main-header .nav-link:focus {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12);
}

.main-header .form-control-navbar {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px 0 0 10px;
}

.main-header .form-control-navbar::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.main-header .btn-navbar {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 0;
  border-radius: 0 10px 10px 0;
}

body .main-sidebar,
body .main-sidebar.sidebar-dark-purple {
  background: var(--premium-sidebar) !important;
  box-shadow: 18px 0 42px rgba(22, 10, 32, 0.22);
}

.sidebar {
  padding-right: 10px;
  padding-left: 10px;
}

.sys-brand-logo {
  width: calc(100% - 28px);
  height: 58px;
  margin: 12px auto 0;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
}

.user-panel {
  padding: 12px;
  margin-right: 0;
  margin-left: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}

.user-panel .image img {
  width: 38px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.48);
}

.user-panel .info a {
  color: #fff;
  font-weight: 800;
}

.nav-sidebar > .nav-item {
  margin-bottom: 6px;
}

body .main-sidebar .nav-sidebar .nav-link {
  min-height: 40px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.78);
  transition: color var(--sys-transition), background-color var(--sys-transition), transform var(--sys-transition);
}

.nav-sidebar .nav-link p {
  font-weight: 700;
}

body .main-sidebar .nav-sidebar .nav-link > .nav-icon,
body .main-sidebar .nav-sidebar .nav-link > .right {
  color: var(--sys-icons) !important;
}

body .main-sidebar .nav-sidebar .nav-link:hover > .nav-icon,
body .main-sidebar .nav-sidebar .menu-open > .nav-link > .nav-icon,
body .main-sidebar .nav-sidebar .nav-link.active > .nav-icon,
body .main-sidebar .nav-sidebar .nav-link:hover > .right,
body .main-sidebar .nav-sidebar .menu-open > .nav-link > .right,
body .main-sidebar .nav-sidebar .nav-link.active > .right {
  color: var(--sys-icons) !important;
}

body .main-sidebar .nav-sidebar .nav-link:hover,
body .main-sidebar .nav-sidebar .menu-open > .nav-link,
body .main-sidebar .nav-sidebar .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12) !important;
}

.nav-sidebar .nav-link:hover {
  transform: translateX(2px);
}

.nav-treeview {
  padding: 4px 0 2px 10px;
}

.nav-treeview .nav-link {
  min-height: 34px;
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent !important;
}

.nav-treeview .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1) !important;
}

.card,
.small-box,
.info-box,
.compras-card {
  overflow: hidden;
  border: 1px solid var(--premium-border);
  border-radius: 18px;
  background: var(--premium-surface);
  box-shadow: var(--premium-shadow-soft);
}

.small-box {
  min-height: 118px;
  color: #fff !important;
  background: linear-gradient(135deg, var(--sys-primary-dark), var(--sys-primary)) !important;
}

.small-box.bg-dark {
  background: linear-gradient(135deg, #222832, #3a4351) !important;
}

.small-box.bg-secondary,
.small-box.bg-info,
.small-box.bg-success,
.small-box.bg-warning,
.small-box.bg-danger {
  background: linear-gradient(135deg, var(--sys-primary), var(--sys-primary-light)) !important;
}

.small-box > .inner {
  position: relative;
  z-index: 2;
  padding: 18px 18px 12px;
}

.small-box h3,
.small-box h4 {
  margin-bottom: 0.45rem;
  color: #fff;
  letter-spacing: -0.02em;
  font-weight: 850;
}

.small-box p {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

.small-box .icon {
  top: 14px;
  right: 14px;
  color: rgba(255, 255, 255, 0.13);
}

.small-box .icon > i {
  font-size: 64px;
}

.small-box .small-box-footer {
  position: relative;
  z-index: 2;
  padding: 9px 12px;
  color: #fff !important;
  background: rgba(0, 0, 0, 0.12);
  font-weight: 800;
}

.small-box .small-box-footer:hover {
  background: rgba(255, 255, 255, 0.12);
}

.product-layout > .card-body {
  overflow: hidden;
  min-height: 292px;
  border: 1px solid var(--premium-border);
  border-radius: 18px;
  background: var(--premium-surface) !important;
  box-shadow: var(--premium-shadow-soft);
}

.product-layout .chart-container {
  min-height: 250px;
  padding: 8px;
}

.sys-confirm-modal .modal-content {
  overflow: hidden;
  border: 1px solid var(--premium-border);
  border-radius: 18px;
  background: var(--premium-surface);
  box-shadow: 0 24px 70px rgba(22, 10, 32, 0.28);
}

.sys-confirm-modal .modal-header {
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--sys-primary-dark), var(--sys-primary));
}

.sys-confirm-modal .modal-header small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.sys-confirm-modal .modal-title {
  margin-top: 2px;
  font-weight: 800;
}

.sys-confirm-modal .modal-header .close {
  margin-left: auto;
  color: #fff;
  opacity: 0.8;
  text-shadow: none;
}

.sys-confirm-modal-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.14);
}

.sys-confirm-modal .modal-body {
  padding: 22px;
  color: var(--sys-text);
}

.sys-confirm-modal-destination {
  display: grid;
  gap: 2px;
  padding: 13px 15px;
  border: 1px solid var(--premium-border);
  border-radius: 12px;
  background: rgba(var(--sys-primary-rgb), 0.05);
}

.sys-confirm-modal-destination span,
.sys-confirm-modal-destination small {
  color: var(--sys-primary-light);
}

.sys-confirm-modal .modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--premium-border);
  background: rgba(var(--sys-primary-rgb), 0.035);
}

.sys-confirm-modal .btn-primary {
  border-color: var(--sys-primary);
  background: var(--sys-primary);
}

.sys-confirm-modal .btn-primary:hover,
.sys-confirm-modal .btn-primary:focus {
  border-color: var(--sys-primary-dark);
  background: var(--sys-primary-dark);
}

.sys-confirm-modal-danger .modal-header {
  background: linear-gradient(135deg, var(--sys-primary-dark), var(--sys-delete));
}

.sys-confirm-modal-danger .btn-danger {
  border-color: var(--sys-delete);
  background: var(--sys-delete);
}

.dashboard-ata-card {
  background: var(--premium-surface) !important;
}

.dashboard-ata-table th {
  color: var(--sys-primary-dark) !important;
  background: rgba(var(--sys-primary-rgb), 0.06) !important;
}

.dashboard-ata-code {
  background: linear-gradient(135deg, var(--sys-primary-dark), var(--sys-primary)) !important;
  box-shadow: 0 8px 16px rgba(var(--sys-primary-rgb), 0.18);
}

.dashboard-ata-pager .btn {
  border-color: rgba(var(--sys-primary-rgb), 0.18);
  color: var(--sys-primary);
  background: #fff;
}

.card-header,
.compras-card-header {
  border-bottom: 1px solid var(--premium-border);
  color: var(--sys-primary-dark);
  background:
    linear-gradient(90deg, rgba(var(--sys-primary-rgb), 0.1), rgba(255, 255, 255, 0.9)) !important;
  font-weight: 800;
}

.card-header .card-title {
  color: #000 !important;
  font-weight: 800;
}

.sys-customizer .card,
.sys-customizer .card label,
.sys-customizer .card .form-text,
.sys-customizer .card .card-title {
  color: #000 !important;
}

.sys-customizer .card-header {
  color: #000 !important;
  background: linear-gradient(90deg, rgba(var(--sys-primary-rgb), 0.08), rgba(255, 255, 255, 0.96)) !important;
}

.sys-customizer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.sys-customizer-grid .form-group {
  margin-bottom: 0;
}

.sys-customizer-grid .custom-file {
  width: 100%;
}

.sys-customizer .form-control,
.sys-customizer .custom-file-label,
.sys-customizer .sys-color-field {
  color: #000 !important;
}

.sys-customizer .sys-theme-preview {
  color: var(--preview-text) !important;
  background: var(--preview-background) !important;
}

.sys-customizer .sys-theme-preview__top {
  background: var(--preview-top) !important;
}

.sys-customizer .sys-theme-preview__card {
  color: var(--preview-text) !important;
  background: #fff !important;
  border-top-color: var(--preview-primary) !important;
}

.sys-customizer .sys-theme-preview__card strong,
.sys-customizer .sys-theme-preview__card p {
  color: var(--preview-text) !important;
}

.card-body,
.compras-card-body {
  padding: 1.15rem;
}

.btn {
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(22, 10, 32, 0.08);
  transition: transform var(--sys-transition), box-shadow var(--sys-transition), background-color var(--sys-transition);
}

.btn:hover,
.btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(22, 10, 32, 0.14);
}

.btn-primary {
  border-color: var(--sys-primary);
  background: linear-gradient(135deg, var(--sys-primary-dark), var(--sys-primary));
}

.btn-info,
.btn-dark,
.badge-dark {
  border-color: var(--sys-primary);
  background: linear-gradient(135deg, var(--sys-primary-dark), var(--sys-primary)) !important;
}

.btn-info:hover,
.btn-info:focus,
.btn-dark:hover,
.btn-dark:focus {
  border-color: var(--sys-primary-dark);
  background: linear-gradient(135deg, var(--sys-primary-dark), var(--sys-primary)) !important;
}

.btn-secondary {
  border-color: #64748b;
  background: linear-gradient(135deg, #64748b, #475569);
}

.btn-success {
  border-color: var(--sys-add);
  background: linear-gradient(135deg, var(--sys-add), #34a853);
}

.btn-warning {
  border-color: var(--sys-edit);
  background: linear-gradient(135deg, var(--sys-edit), #f4b740);
}

.btn-danger {
  border-color: var(--sys-delete);
  background: linear-gradient(135deg, var(--sys-delete), #e55353);
}

.form-control,
.custom-select,
.select2-container--bootstrap4 .select2-selection {
  min-height: 38px;
  border: 1px solid rgba(var(--sys-primary-rgb), 0.14);
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.form-control:focus,
.custom-select:focus,
.select2-container--bootstrap4.select2-container--focus .select2-selection {
  border-color: var(--sys-primary-light);
  box-shadow: 0 0 0 0.2rem rgba(var(--sys-primary-rgb), 0.16);
}

.table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  color: var(--sys-primary-dark);
  background: rgba(var(--sys-primary-rgb), 0.04);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  text-transform: none;
}

.table td,
.table th {
  border-top-color: rgba(var(--sys-primary-rgb), 0.08);
}

.table-hover tbody tr {
  transition: background-color var(--sys-transition), transform var(--sys-transition);
}

.table-hover tbody tr:hover {
  background-color: rgba(var(--sys-primary-rgb), 0.055);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(var(--sys-primary-rgb), 0.025);
}

.dataTables_wrapper,
.dataTables_wrapper label,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  color: var(--sys-text) !important;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  color: var(--sys-text) !important;
  background-color: #fff !important;
}

.dataTables_wrapper .dataTables_filter label {
  color: var(--sys-text) !important;
}

.dataTables_wrapper .dataTables_filter input::placeholder,
.dataTables_wrapper .dataTables_filter input::-webkit-input-placeholder {
  color: var(--sys-muted) !important;
  opacity: 1;
}

.dataTables_wrapper .dataTables_filter input::-moz-placeholder {
  color: var(--sys-muted) !important;
  opacity: 1;
}

.dataTables_wrapper .dataTables_length select option {
  color: var(--sys-text);
  background: #fff;
}

.dataTables_wrapper .paginate_button,
.dataTables_wrapper .page-link {
  min-width: 34px;
  color: var(--sys-primary) !important;
  border-color: rgba(var(--sys-primary-rgb), 0.18) !important;
  background: #fff !important;
  font-weight: 800;
}

.dataTables_wrapper .paginate_button:hover,
.dataTables_wrapper .paginate_button:focus,
.dataTables_wrapper .page-link:hover,
.dataTables_wrapper .page-link:focus {
  color: var(--sys-primary-dark) !important;
  border-color: rgba(var(--sys-primary-rgb), 0.35) !important;
  background: rgba(var(--sys-primary-rgb), 0.08) !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--sys-primary-rgb), 0.12) !important;
}

.dataTables_wrapper .paginate_button.disabled,
.dataTables_wrapper .page-item.disabled .page-link {
  color: var(--sys-muted) !important;
  border-color: rgba(var(--sys-primary-rgb), 0.12) !important;
  background: rgba(var(--sys-primary-rgb), 0.03) !important;
}

.dataTables_wrapper .page-item.active .page-link {
  color: #fff !important;
  border-color: var(--sys-primary) !important;
  background: linear-gradient(135deg, var(--sys-primary-dark), var(--sys-primary)) !important;
  box-shadow: 0 8px 16px rgba(var(--sys-primary-rgb), 0.18) !important;
}

.card-header .dataTables_wrapper,
.card-header .dataTables_wrapper label,
.card-header .dataTables_filter,
.card-header .dataTables_filter label,
.card-header .dataTables_info,
.card-header .dataTables_length,
.card-header label:not(.custom-control-label) {
  color: var(--sys-text) !important;
}

.card-header .dataTables_filter input,
.card-header input[type="search"]:not(.form-control-navbar),
.card-header .dataTables_length select {
  color: var(--sys-text) !important;
  background-color: #fff !important;
  border-color: rgba(var(--sys-primary-rgb), 0.18) !important;
}

.card-header .dataTables_filter input::placeholder,
.card-header input[type="search"]:not(.form-control-navbar)::placeholder {
  color: var(--sys-muted) !important;
  opacity: 1;
}

.modal-content {
  overflow: hidden;
  border: 1px solid var(--premium-border);
  border-radius: 20px;
  box-shadow: var(--premium-shadow);
}

.modal:not(.sys-confirm-modal-danger) .modal-header {
  align-items: center;
  color: #fff !important;
  border-bottom: 0;
  background: linear-gradient(135deg, var(--sys-primary-dark), var(--sys-primary)) !important;
}

.modal:not(.sys-confirm-modal-danger) .modal-title,
.modal:not(.sys-confirm-modal-danger) .modal-header h1,
.modal:not(.sys-confirm-modal-danger) .modal-header h2,
.modal:not(.sys-confirm-modal-danger) .modal-header h3,
.modal:not(.sys-confirm-modal-danger) .modal-header h4,
.modal:not(.sys-confirm-modal-danger) .modal-header h5 {
  color: #fff !important;
  font-weight: 800;
}

.modal:not(.sys-confirm-modal-danger) .modal-header .close,
.modal:not(.sys-confirm-modal-danger) .modal-header .btn-close {
  color: #fff !important;
  opacity: 0.9;
  text-shadow: none;
}

.modal:not(.sys-confirm-modal-danger) .modal-header .close:hover,
.modal:not(.sys-confirm-modal-danger) .modal-header .close:focus,
.modal:not(.sys-confirm-modal-danger) .modal-header .btn-close:hover,
.modal:not(.sys-confirm-modal-danger) .modal-header .btn-close:focus {
  opacity: 1;
}

.modal-footer {
  border-top: 1px solid var(--premium-border);
  background: rgba(var(--sys-primary-rgb), 0.035);
}

.alert {
  border: 0;
  border-left: 4px solid currentColor;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(22, 10, 32, 0.06);
}

.badge {
  border-radius: 999px;
  font-weight: 800;
}

.main-footer {
  color: var(--sys-muted);
  background: rgba(255, 255, 255, 0.76);
  border-top: 1px solid var(--premium-border);
  backdrop-filter: blur(12px);
}

@media (max-width: 767.98px) {
  .content {
    padding-right: 10px;
    padding-left: 10px;
  }

  .content-header {
    padding-right: 10px;
    padding-left: 10px;
  }

  .content-header .breadcrumb {
    margin-top: 10px;
    border-radius: 12px;
  }
}
