:root {
  --bs-primary: #0f766e;
  --bs-primary-rgb: 15, 118, 110;
  --bs-info: #256f86;
  --bs-info-rgb: 37, 111, 134;
  --bs-success: #15803d;
  --bs-success-rgb: 21, 128, 61;
  --bs-warning: #b45309;
  --bs-warning-rgb: 180, 83, 9;
  --bs-dark: #1f1720;
  --bs-dark-rgb: 31, 23, 32;
  --bs-link-color: #0f766e;
  --bs-link-hover-color: #0b5d57;
}

a:not(.btn):not(.dropdown-item) {
  color: var(--primary-color);
}

a:not(.btn):not(.dropdown-item):hover {
  color: var(--primary-hover);
}

.text-primary {
  color: rgba(var(--bs-primary-rgb), var(--bs-text-opacity, 1)) !important;
}

.border-primary {
  border-color: rgba(var(--bs-primary-rgb), var(--bs-border-opacity, 1)) !important;
}

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

.btn-primary,
a.btn-primary,
button.btn-primary {
  color: #fff !important;
  background: #0f766e !important;
  border-color: #0f766e !important;
  box-shadow: 0 10px 20px -16px rgba(15, 118, 110, 0.9);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  color: #fff !important;
  background: #0b5d57 !important;
  border-color: #0b5d57 !important;
}

.btn-primary *,
.btn-success *,
.btn-info *,
.btn-dark * {
  color: inherit !important;
}

.btn-success,
a.btn-success,
button.btn-success {
  color: #fff !important;
}

.btn-info,
a.btn-info,
button.btn-info {
  color: #fff !important;
  background-color: #256f86 !important;
  border-color: #256f86 !important;
}

.btn-dark,
a.btn-dark,
button.btn-dark {
  color: #fff !important;
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 10px 20px -16px rgba(15, 118, 110, 0.9);
}

.btn-dark:hover,
.btn-dark:focus,
.btn-dark:active {
  color: #fff !important;
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
}

.btn-warning,
a.btn-warning,
button.btn-warning {
  color: #1f1720 !important;
  background-color: #f59e0b !important;
  border-color: #f59e0b !important;
}

.btn-outline-primary {
  color: var(--primary-color) !important;
  border-color: rgba(15, 118, 110, 0.55) !important;
}

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

.btn-outline-success {
  color: #15803d !important;
  border-color: rgba(21, 128, 61, 0.55) !important;
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active {
  color: #fff !important;
  background-color: #15803d !important;
  border-color: #15803d !important;
}

.btn-outline-dark {
  color: var(--primary-color) !important;
  border-color: rgba(15, 118, 110, 0.55) !important;
}

.btn-outline-dark:hover,
.btn-outline-dark:focus,
.btn-outline-dark:active,
.btn-check:checked + .btn-outline-dark,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
  color: #fff !important;
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

#sidebar-wrapper {
  border-inline-end: 0 !important;
}

.sidebar-heading span {
  letter-spacing: 0;
  line-height: 1.35;
}

#sidebar-navigation .list-group-item {
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  font-size: 0.93rem;
  line-height: 1.25;
  height: 40px;
  min-height: 40px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sidebar-navigation .list-group-item > .d-flex {
  height: 100%;
  min-width: 0;
  gap: 0.35rem;
  align-items: center;
}

#sidebar-navigation .list-group-item > .d-flex > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#sidebar-navigation .list-group-item .toggle-icon {
  flex: 0 0 auto;
  margin-inline-start: 0.25rem;
}

#sidebar-navigation .collapse .list-group-item {
  font-size: 0.9rem;
  line-height: 1.25;
  height: 40px;
  min-height: 40px;
  margin-top: 0.08rem;
  margin-bottom: 0.08rem;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-inline-start: 2rem !important;
  padding-inline-end: 2rem !important;
}

#sidebar-navigation .collapse .list-group-item i {
  font-size: 0.95rem;
}

#sidebar-navigation .list-group-item.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(180, 83, 9, 0.18));
  border-color: rgba(255, 255, 255, 0.16);
}

#sidebar-navigation .collapse .list-group {
  background: rgba(0, 0, 0, 0.16) !important;
  padding: 0.25rem 0;
}

.top-navbar {
  position: sticky;
  top: 0;
  z-index: 990;
}

.card,
.table-responsive,
.modal-content,
.surface-card,
.filter-shell {
  border-color: var(--border-color) !important;
}

.card:not(.border-0),
.surface-card,
.table-responsive {
  box-shadow: 0 14px 34px -30px rgba(31, 23, 32, 0.6) !important;
}

.table th {
  color: #665d66;
  background-color: #fafbfc !important;
}

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

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.22rem rgba(15, 118, 110, 0.18) !important;
}

.shop-item-card,
.product-card {
  border-radius: 0.5rem !important;
  border: 1px solid var(--border-color) !important;
}

.shop-item-card:hover,
.product-card:hover {
  border-color: rgba(15, 118, 110, 0.48) !important;
  box-shadow: 0 18px 34px -24px rgba(15, 118, 110, 0.58) !important;
}

.shop-item-img,
.product-img-wrapper {
  background: linear-gradient(180deg, #fbfefd 0%, #f4fbfa 100%) !important;
}

.shop-pagination .page-link {
  color: var(--primary-color) !important;
}

.shop-pagination .page-item.active .page-link {
  color: #fff !important;
}

.cat-btn.active,
.cart-header {
  background: linear-gradient(135deg, #0f766e, #1f1720) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px -18px rgba(15, 118, 110, 0.8) !important;
}

.product-price,
#cartTotalVal,
#modalTotalAmount,
#displayTotal,
#displayDueAmountLive {
  color: var(--primary-color) !important;
}

.btn-pay {
  color: #fff !important;
  background: linear-gradient(135deg, #15803d, #0f766e) !important;
  border-radius: 0.5rem !important;
}

.smart-form-card,
.pos-cart-area,
.product-card {
  border-radius: 0.5rem !important;
}

.bg-primary-subtle {
  background-color: rgba(15, 118, 110, 0.11) !important;
}

.bg-info-subtle {
  background-color: rgba(37, 111, 134, 0.11) !important;
}

.bg-warning-subtle {
  background-color: rgba(180, 83, 9, 0.13) !important;
}

.bg-success-subtle {
  background-color: rgba(21, 128, 61, 0.11) !important;
}

.badge.bg-primary,
.badge.bg-info,
.badge.bg-success,
.badge.bg-dark {
  color: #fff !important;
}

.alert-success {
  border-color: rgba(21, 128, 61, 0.22);
}

.swal2-confirm {
  color: #fff !important;
  background-color: var(--primary-color) !important;
}

.sales-advanced-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sales-filter-row {
  row-gap: 0.85rem;
}

.sales-filter-actions .btn {
  min-width: 0;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .sales-top-actions .btn {
    flex: 1 1 auto;
  }
}

/* Clearer admin sidebar */
#sidebar-wrapper {
  background: linear-gradient(180deg, #10282b 0%, #173438 48%, #221927 100%) !important;
  box-shadow: 18px 0 42px -34px rgba(31, 23, 32, 0.72);
}

[dir="rtl"] #sidebar-wrapper {
  box-shadow: -18px 0 42px -34px rgba(31, 23, 32, 0.72);
}

#sidebar-wrapper .sidebar-heading {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.14) !important;
}

#sidebar-wrapper .text-white-50 {
  color: rgba(238, 246, 245, 0.76) !important;
}

#sidebar-navigation {
  padding-inline: 0.35rem;
}

#sidebar-navigation .list-group-item {
  color: #eef6f5 !important;
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.04);
  font-weight: 600;
}

#sidebar-navigation .list-group-item i {
  color: rgba(238, 246, 245, 0.84);
}

#sidebar-navigation .list-group-item:not(.active):hover,
#sidebar-navigation .list-group-item:not(.active):focus {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}

#sidebar-navigation .list-group-item:not(.active):hover i,
#sidebar-navigation .list-group-item:not(.active):focus i {
  color: #ffffff;
}

#sidebar-navigation .list-group-item.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.95), rgba(180, 83, 9, 0.78)) !important;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 14px 26px -22px rgba(0, 0, 0, 0.85);
}

#sidebar-navigation .list-group-item.active i {
  color: #ffffff;
}

#sidebar-navigation .collapse .list-group-item {
  color: #f3c77b !important;
  background: transparent;
  font-weight: 500;
}

#sidebar-navigation .collapse .list-group-item i {
  color: rgba(243, 199, 123, 0.9);
}

#sidebar-navigation .collapse .list-group-item:not(.active):hover,
#sidebar-navigation .collapse .list-group-item:not(.active):focus {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1);
}

#sidebar-navigation .collapse .list-group-item:not(.active):hover i,
#sidebar-navigation .collapse .list-group-item:not(.active):focus i {
  color: #ffffff;
}

#sidebar-navigation .collapse .list-group-item.active {
  color: #ffffff !important;
  background: rgba(243, 199, 123, 0.18) !important;
  border-color: rgba(243, 199, 123, 0.34);
}

/* Dashboard workspace */
.dashboard-workspace {
  --dash-border: rgba(218, 226, 235, 0.92);
  --dash-soft: #f8fafc;
  --dash-text: #1f2937;
  --dash-muted: #64748b;
}

.dashboard-command-bar,
.dashboard-panel,
.dashboard-kpi-card {
  border: 1px solid var(--dash-border);
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 18px 40px -34px rgba(31, 23, 32, 0.42);
}

.dashboard-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbfb 56%, #fff8ef 100%);
}

.dashboard-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.25rem;
  color: #0f766e;
  font-size: 0.76rem;
  font-weight: 800;
}

.dashboard-command-copy h5 {
  color: var(--dash-text);
}

.dashboard-command-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  color: var(--dash-muted);
  font-size: 0.84rem;
}

.dashboard-command-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dashboard-command-meta i {
  color: #256f86;
}

.dashboard-command-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.dashboard-kpi-card {
  --kpi-accent: #0f766e;
  --kpi-soft: rgba(15, 118, 110, 0.1);
  min-height: 116px;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.95rem;
  overflow: hidden;
  border-inline-start: 4px solid var(--kpi-accent);
}

.dashboard-kpi-card span,
.dashboard-kpi-card small {
  display: block;
  color: var(--dash-muted);
  line-height: 1.35;
}

.dashboard-kpi-card span {
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-kpi-card strong {
  display: block;
  color: var(--dash-text);
  font-size: 1.28rem;
  line-height: 1.25;
  margin: 0.25rem 0;
  overflow-wrap: anywhere;
}

.dashboard-kpi-card small {
  font-size: 0.76rem;
}

.dashboard-kpi-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  color: var(--kpi-accent);
  background: var(--kpi-soft);
  border-radius: 0.45rem;
}

.kpi-revenue {
  --kpi-accent: #15803d;
  --kpi-soft: rgba(21, 128, 61, 0.1);
}

.kpi-month {
  --kpi-accent: #256f86;
  --kpi-soft: rgba(37, 111, 134, 0.11);
}

.kpi-collection {
  --kpi-accent: #b45309;
  --kpi-soft: rgba(180, 83, 9, 0.12);
}

.kpi-alert {
  --kpi-accent: #9f2348;
  --kpi-soft: rgba(159, 35, 72, 0.1);
}

.dashboard-panel {
  overflow: hidden;
}

.dashboard-panel-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid var(--dash-border);
}

.dashboard-panel-subtitle {
  color: var(--dash-muted);
  font-size: 0.82rem;
}

.dashboard-summary-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.dashboard-summary-pills span {
  min-width: 118px;
  padding: 0.45rem 0.65rem;
  background: var(--dash-soft);
  border: 1px solid var(--dash-border);
  border-radius: 0.45rem;
}

.dashboard-summary-pills small,
.dashboard-month-meter span,
.dashboard-ranked-item small,
.dashboard-payment-item small {
  color: var(--dash-muted);
  font-size: 0.74rem;
}

.dashboard-summary-pills small,
.dashboard-summary-pills strong {
  display: block;
  line-height: 1.25;
}

.dashboard-summary-pills strong {
  color: var(--dash-text);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.dashboard-chart-frame,
.dashboard-mini-chart {
  position: relative;
  width: 100%;
}

.dashboard-chart-frame-monthly {
  height: 285px;
  min-height: 285px;
}

.dashboard-chart-frame-products {
  height: 270px;
  min-height: 270px;
}

.dashboard-mini-chart {
  height: 170px;
  min-height: 170px;
}

.dashboard-month-meter {
  padding: 0.85rem;
  border: 1px solid var(--dash-border);
  border-radius: 0.5rem;
  background: var(--dash-soft);
}

.dashboard-month-meter .progress {
  height: 0.55rem;
  background: #e2e8f0;
}

.dashboard-month-meter .progress-bar {
  background: linear-gradient(90deg, #0f766e, #256f86);
}

.dashboard-ranked-list,
.dashboard-payment-list,
.dashboard-attention-list {
  display: grid;
  gap: 0.65rem;
}

.dashboard-ranked-item {
  padding: 0.68rem 0;
  border-bottom: 1px dashed var(--dash-border);
}

.dashboard-ranked-item:last-child {
  border-bottom: 0;
}

.dashboard-ranked-item strong,
.dashboard-payment-item strong {
  color: var(--dash-text);
  font-size: 0.9rem;
}

.dashboard-ranked-item span,
.dashboard-payment-item > span {
  color: #0f766e;
  font-weight: 800;
  font-size: 0.86rem;
  white-space: nowrap;
}

.dashboard-progress-line {
  height: 0.48rem;
  margin: 0.45rem 0 0.25rem;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 999px;
}

.dashboard-progress-line span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0f766e, #b45309);
  border-radius: inherit;
}

.dashboard-payment-item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.78rem;
  background: var(--dash-soft);
  border: 1px solid var(--dash-border);
  border-radius: 0.45rem;
}

.dashboard-payment-item small {
  display: block;
}

.dashboard-attention-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem;
  color: var(--dash-text) !important;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid var(--dash-border);
  border-radius: 0.45rem;
}

.dashboard-attention-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -26px rgba(31, 23, 32, 0.55);
}

.attention-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
  border-radius: 0.45rem;
}

.dashboard-attention-item strong,
.dashboard-attention-item small {
  display: block;
}

.dashboard-attention-item small {
  color: var(--dash-muted);
  font-size: 0.76rem;
}

.attention-value {
  color: var(--dash-text);
  font-weight: 900;
  white-space: nowrap;
}

.attention-warn .attention-icon {
  color: #b45309;
  background: rgba(180, 83, 9, 0.12);
}

.attention-info .attention-icon {
  color: #256f86;
  background: rgba(37, 111, 134, 0.11);
}

.attention-danger .attention-icon {
  color: #9f2348;
  background: rgba(159, 35, 72, 0.1);
}

.dashboard-product-chips,
.dashboard-stock-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-product-chips {
  margin-top: 0.85rem;
}

.dashboard-product-chips span,
.dashboard-stock-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.6rem;
  color: var(--dash-text);
  background: var(--dash-soft);
  border: 1px solid var(--dash-border);
  border-radius: 0.45rem;
  font-size: 0.8rem;
}

.dashboard-product-chips strong {
  color: #0f766e;
}

.dashboard-stock-item {
  flex-direction: column;
  align-items: flex-start;
  min-width: 170px;
  text-decoration: none;
}

.dashboard-stock-item strong {
  color: var(--dash-text);
}

.dashboard-stock-item span {
  color: #9f2348;
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-sales-table th {
  padding: 0.85rem 1rem;
  color: var(--dash-muted);
  background: var(--dash-soft);
  border: 0;
  font-size: 0.78rem;
}

.dashboard-sales-table td {
  padding: 0.78rem 1rem;
}

.dashboard-empty-state {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: var(--dash-muted);
  text-align: center;
}

.dashboard-empty-state i {
  color: #94a3b8;
  font-size: 2rem;
}

.dashboard-empty-state p {
  margin: 0;
}

.dashboard-empty-state.small-state {
  min-height: 130px;
}

@media (max-width: 1399.98px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .dashboard-command-bar,
  .dashboard-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-command-actions,
  .dashboard-summary-pills {
    justify-content: flex-start;
  }

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

@media (max-width: 767.98px) {
  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-frame-monthly,
  .dashboard-chart-frame-products {
    height: 310px;
    min-height: 310px;
  }

  .dashboard-attention-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .attention-value {
    grid-column: 2;
  }
}
