/* ═══════════════════════════════════════════════════════════════════
   SHOPKEEPERS.PK — Private UI Component Layer
   Design tokens defined in admin-theme.css (single source of truth)
   This file adds app-level component styles on top of the base theme.
   ═══════════════════════════════════════════════════════════════════ */

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family) !important;
  overflow-x: hidden;
}

body:not(.dark-mode) .wrapper,
body:not(.dark-mode) .content-wrapper {
  background:
    radial-gradient(circle at top right, rgba(24, 43, 77, 0.06), transparent 24%),
    radial-gradient(circle at bottom left, rgba(34, 164, 90, 0.08), transparent 26%),
    linear-gradient(180deg, #f6f9fc 0%, #eef3f9 100%);
}

.wrapper,
.content-wrapper,
.content-wrapper > .content,
.container,
.container-fluid,
.row,
[class*="col-"],
.card,
.card-body,
.card-header,
.card-footer,
.modal-dialog,
.modal-content,
.modal-body,
.table-responsive,
.dataTables_wrapper,
.dataTables_scroll,
.select2-container,
.input-group,
.nav-tabs,
.report-subnav,
.billing-actions,
.settings-actions,
.report-actions {
  max-width: 100%;
  min-width: 0;
}

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

.fw-bold {
  font-weight: 700 !important;
}

.text-start {
  text-align: left !important;
}

.text-end {
  text-align: right !important;
}

.gap-2 {
  gap: 0.5rem !important;
}

.me-2 {
  margin-right: 0.5rem !important;
}

.row.g-2 {
  margin-left: -0.25rem;
  margin-right: -0.25rem;
}

.row.g-2 > [class*="col-"] {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.content-wrapper > .content {
  padding-top: 1rem !important;
  padding-bottom: 1.9rem !important;
}

.container-fluid {
  max-width: 1400px;
}

.select2-container {
  width: 100% !important;
}

.dataTables_wrapper .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.dataTables_wrapper .row > [class*="col-"] {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.main-header.navbar.app-topbar {
  min-height: 56px;
  padding: 0.45rem 0.75rem;
  background: rgba(255, 255, 255, 0.84) !important;
  border-bottom: 1px solid rgba(15, 30, 53, 0.08) !important;
  box-shadow: 0 8px 22px rgba(16, 33, 60, 0.06);
  backdrop-filter: blur(18px);
}

.app-header-grid {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(220px, 420px) minmax(0, auto);
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

.app-header-left,
.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.app-page-context {
  min-width: 0;
}

.app-menu-toggle,
.app-icon-action,
.app-header-action,
.app-user-trigger,
.theme-toggle-btn {
  min-height: 38px;
  border-radius: 12px !important;
  box-shadow: var(--shadow-xs);
}

.app-menu-toggle,
.app-icon-action,
.app-user-trigger,
.theme-toggle-btn {
  background: var(--surface);
  border: 1px solid rgba(15, 30, 53, 0.08);
  color: var(--text) !important;
}

.app-menu-toggle {
  width: 40px;
  justify-content: center;
}

.app-page-kicker {
  display: none;
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-page-title {
  display: block;
  color: var(--heading-color);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header-search {
  position: relative;
}

.app-header-search i {
  position: absolute;
  top: 50%;
  left: 0.8rem;
  transform: translateY(-50%);
  color: var(--text-secondary);
  z-index: 2;
}

.app-header-search input {
  width: 100%;
  min-height: 40px;
  padding: 0.58rem 0.8rem 0.58rem 2.15rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 30, 53, 0.08);
  background: rgba(248, 250, 252, 0.92);
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
}

.app-search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  padding: 0.45rem;
  border: 1px solid rgba(15, 30, 53, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  z-index: var(--z-dropdown);
}

.app-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.8rem 0.95rem;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none !important;
}

.app-search-result:hover,
.app-search-result:focus {
  background: rgba(24, 43, 77, 0.06);
  color: var(--primary);
}

.app-search-result.is-active {
  background: rgba(24, 43, 77, 0.08);
  color: var(--primary);
}

.app-search-result strong,
.app-user-meta strong {
  display: block;
  font-weight: 800;
}

.app-search-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(24, 43, 77, 0.07);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.app-shortcut-help {
  display: grid;
  gap: 0.6rem;
  text-align: left;
}

.app-shortcut-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
}

.app-shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.35rem 0.55rem;
  border-radius: 12px;
  background: rgba(24, 43, 77, 0.08);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
}

.app-shortcut-label {
  color: var(--text);
  font-weight: 600;
}

.app-search-result small,
.app-search-empty {
  display: block;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.app-header-actions {
  justify-content: flex-end;
  min-width: 0;
}

.app-header-shortcuts {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-header-shortcuts::-webkit-scrollbar {
  display: none;
}

.app-header-shortcuts > * {
  flex: 0 0 auto;
}

.app-icon-action,
.app-header-action,
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.72rem !important;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.app-header-action {
  background: linear-gradient(135deg, var(--accent), #3ecf78) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  white-space: nowrap;
}

.theme-toggle-btn {
  width: 38px;
  padding: 0 !important;
}

.app-user-trigger {
  display: inline-flex !important;
  align-items: center;
  gap: 0.42rem;
  padding: 0.32rem 0.5rem !important;
}

.app-user-avatar,
.app-sidebar-avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #24456f);
  color: #ffffff;
  font-weight: 800;
}

.app-user-meta strong {
  font-size: 0.84rem;
  line-height: 1.05;
}

.app-user-meta span {
  display: none;
}

.main-sidebar {
  background: linear-gradient(180deg, rgba(15, 30, 53, 0.98), rgba(24, 43, 77, 0.98)) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 10px 0 32px rgba(10, 17, 30, 0.18);
}

.app-sidebar-brand {
  display: flex !important;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.8rem !important;
  min-height: 64px;
}

.app-sidebar-brand-logo {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem;
}

.app-sidebar-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-sidebar-brand-copy strong,
.app-sidebar-brand-copy small,
.app-sidebar-profile strong,
.app-sidebar-profile span {
  display: block;
}

.app-sidebar-brand-copy strong,
.app-sidebar-profile strong {
  color: #ffffff;
  font-weight: 800;
}

.app-sidebar-brand-copy strong {
  font-size: 0.95rem;
  line-height: 1.1;
}

.app-sidebar-brand-copy small,
.app-sidebar-profile span {
  color: rgba(231, 238, 248, 0.72);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.app-sidebar-brand-copy small {
  display: none;
}

.app-sidebar-profile {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin: 0.9rem 0.8rem 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar {
  padding-top: 0.35rem;
}

.sidebar .nav-header {
  margin: 0.7rem 0.75rem 0.15rem;
  padding: 0;
  color: rgba(231, 238, 248, 0.56);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar .nav-sidebar .nav-item > .nav-link,
.sidebar .nav-sidebar .nav-treeview .nav-link {
  margin: 0.08rem 0.55rem;
  padding: 0.72rem 0.82rem;
  min-height: 42px;
  border-radius: 13px;
  color: var(--sidebar-text);
}

.sidebar .nav-sidebar > .nav-item .nav-icon,
.sidebar .nav-sidebar .nav-treeview .nav-icon {
  width: 1.2rem;
  font-size: 0.95rem;
}

.sidebar .nav-sidebar .nav-link p {
  margin: 0 0 0 0.18rem;
  font-size: 0.9rem;
  line-height: 1.18;
}

.sidebar .nav-sidebar .nav-treeview {
  padding-bottom: 0.2rem;
}

.sidebar .nav-sidebar .nav-link > .right,
.sidebar .nav-sidebar .nav-link > p > .right {
  top: 0.96rem;
  right: 0.68rem;
}

.sidebar .nav-sidebar .nav-item > .nav-link:hover,
.sidebar .nav-sidebar .nav-treeview .nav-link:hover,
.sidebar .nav-sidebar .nav-item > .nav-link.active,
.sidebar .nav-sidebar .nav-treeview .nav-link.active {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--sidebar-text-hover) !important;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  padding: 0.2rem 1.1rem 0.8rem;
  margin: 0;
  border-top: 0 !important;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.app-footer-copy strong {
  color: var(--heading-color);
  font-weight: 800;
  margin-right: 0.35rem;
}

.mobile-bottom-nav {
  position: fixed;
  right: 0.7rem;
  bottom: 0.65rem;
  left: 0.7rem;
  z-index: var(--z-header);
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 18px;
  background: rgba(15, 30, 53, 0.92);
  box-shadow: 0 16px 36px rgba(10, 17, 30, 0.22);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mobile-bottom-nav::-webkit-scrollbar {
  display: none;
}

.mobile-bottom-nav a,
.mobile-bottom-nav button {
  min-height: 48px;
  min-width: 74px;
  padding: 0.45rem 0.7rem;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(231, 238, 248, 0.84);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
}

.mobile-bottom-nav a.is-active,
.mobile-bottom-nav a:hover,
.mobile-bottom-nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Shared navigation refinement pass */
.main-header.navbar.app-topbar {
  z-index: var(--z-header);
}

.main-sidebar {
  z-index: var(--z-sidebar);
}

.modal-backdrop {
  z-index: var(--z-overlay) !important;
}

.modal {
  z-index: var(--z-modal) !important;
}

.swal2-container,
#toast-container,
.toast {
  z-index: var(--z-toast) !important;
}

.mobile-bottom-nav {
  z-index: var(--z-header);
}

.app-menu-toggle,
.app-icon-action,
.app-header-action,
.app-user-trigger,
.theme-toggle-btn,
.mobile-bottom-nav a,
.mobile-bottom-nav button {
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.app-menu-toggle:hover,
.app-menu-toggle:focus,
.app-icon-action:hover,
.app-icon-action:focus,
.app-user-trigger:hover,
.app-user-trigger:focus,
.theme-toggle-btn:hover,
.theme-toggle-btn:focus {
  color: var(--primary) !important;
  border-color: rgba(var(--primary-rgb), 0.18);
  background: rgba(var(--primary-rgb), 0.06);
}

.app-menu-toggle:focus-visible,
.app-icon-action:focus-visible,
.app-header-action:focus-visible,
.app-user-trigger:focus-visible,
.theme-toggle-btn:focus-visible,
.app-header-search input:focus,
.mobile-bottom-nav a:focus-visible,
.mobile-bottom-nav button:focus-visible,
.sidebar .nav-sidebar .nav-link:focus-visible {
  outline: 0;
  box-shadow: var(--shadow-focus);
}

.app-header-search input:focus {
  border-color: rgba(var(--primary-rgb), 0.24);
  background: var(--surface);
}

.app-search-results {
  z-index: var(--z-dropdown);
  max-height: min(420px, calc(100vh - 130px));
  overflow-y: auto;
}

.app-search-result > div {
  min-width: 0;
}

.app-search-result strong,
.app-search-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .nav-sidebar .nav-link {
  position: relative;
}

.sidebar .nav-sidebar .nav-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar .nav-sidebar .nav-link.active .nav-icon {
  color: #ffffff;
}

.app-sidebar-brand-copy,
.app-sidebar-profile > div {
  min-width: 0;
}

.app-sidebar-brand-copy strong,
.app-sidebar-profile strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-bottom-nav a.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.mobile-bottom-nav i {
  font-size: 1rem;
  line-height: 1;
}

.card,
.modal-content {
  border-radius: 22px !important;
  border: 1px solid rgba(15, 30, 53, 0.08) !important;
  box-shadow: var(--shadow-xs) !important;
}

.btn {
  min-height: 46px;
  border-radius: 14px !important;
  font-weight: 800 !important;
}

.btn-primary,
.btn-dark,
.login-btn {
  background: linear-gradient(135deg, var(--primary), #234169) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

.btn-success {
  background: var(--accent) !important;
  border-color: transparent !important;
}

.form-control,
.form-select,
.custom-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  min-height: 50px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(15, 30, 53, 0.12) !important;
  background: rgba(255, 255, 255, 0.96) !important;
}

.nav-tabs {
  gap: 0.55rem;
  border-bottom: 0 !important;
  padding: 0.35rem;
  background: rgba(235, 241, 246, 0.9);
  border-radius: 18px;
}

.nav-tabs .nav-link {
  border: 0 !important;
  border-radius: 14px !important;
  color: var(--text-secondary) !important;
  font-weight: 700 !important;
}

.nav-tabs .nav-link.active {
  background: #ffffff !important;
  color: var(--primary) !important;
  box-shadow: var(--shadow-xs);
}

.table thead th,
.dataTable thead th {
  background: linear-gradient(135deg, var(--primary), #234169) !important;
  color: #ffffff !important;
  border-bottom: 0 !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table,
.dataTable {
  width: 100% !important;
}

.table td,
.table th,
.dataTable td,
.dataTable th {
  white-space: normal;
  word-break: break-word;
}

.ui-mobile-cards {
  border-collapse: separate;
}

.login-page {
  background:
    radial-gradient(circle at top left, rgba(24, 43, 77, 0.16), transparent 25%),
    radial-gradient(circle at bottom right, rgba(34, 164, 90, 0.18), transparent 28%),
    linear-gradient(135deg, #f4f7fb 0%, #edf3f8 45%, #e4edf4 100%) !important;
}

.dash-hero,
.finance-hero,
.account-module-hero,
.products-hero,
.gui-billing-hero,
.report-hero,
.billing-hero,
.settings-hero {
  border: 1px solid rgba(15, 30, 53, 0.08) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at top right, rgba(24, 43, 77, 0.05), transparent 22%),
    radial-gradient(circle at bottom left, rgba(34, 164, 90, 0.08), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.99) 0%, rgba(249, 251, 253, 0.99) 58%, rgba(246, 250, 247, 0.99) 100%) !important;
  color: var(--text) !important;
  box-shadow: 0 14px 30px rgba(16, 33, 60, 0.07) !important;
}

.dash-copy,
.finance-copy,
.account-module-copy,
.products-hero-copy p,
.gui-billing-copy,
.report-copy,
.billing-copy,
.settings-copy {
  color: var(--text-secondary) !important;
}

.dash-eyebrow,
.finance-eyebrow,
.account-module-eyebrow,
.gui-billing-eyebrow,
.report-eyebrow,
.billing-eyebrow,
.settings-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(24, 43, 77, 0.06);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dash-hero .btn-outline-dark,
.dash-hero .btn-outline-secondary,
.finance-hero .btn-outline-dark,
.finance-hero .btn-outline-secondary,
.account-module-hero .btn-outline-dark,
.products-hero .btn-light,
.gui-billing-hero .btn-outline-dark,
.gui-billing-hero .btn-outline-secondary,
.report-hero .btn-outline-dark,
.billing-hero .btn-outline-dark,
.settings-hero .btn-outline-dark {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(15, 30, 53, 0.08) !important;
  color: var(--text) !important;
  box-shadow: 0 8px 18px rgba(16, 33, 60, 0.05) !important;
}

.report-panel,
.report-filter-card,
.report-stat-card,
.billing-section-card,
.billing-surface,
.barcode-scanner-container,
.settings-panel {
  border: 1px solid rgba(15, 30, 53, 0.08) !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98)) !important;
  box-shadow: var(--shadow-xs) !important;
}

.billing-surface > .card-header {
  background: linear-gradient(135deg, rgba(24, 43, 77, 0.06), rgba(34, 164, 90, 0.1)) !important;
  border-bottom: 1px solid rgba(15, 30, 53, 0.08) !important;
}

.billing-surface > .card-header h5,
.billing-surface > .card-header .text-white,
.billing-surface > .card-header .text-primary {
  color: var(--heading-color) !important;
}

.report-hero,
.billing-hero,
.settings-hero {
  padding: 1.25rem;
}

.billing-shell,
.settings-shell {
  display: grid;
  gap: 1.1rem;
}

.billing-actions,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.billing-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.billing-section-head h6 {
  margin: 0;
  color: var(--heading-color);
  font-size: 1rem;
  font-weight: 800;
}

.billing-section-head span {
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.billing-items-table-wrap {
  border-radius: 22px;
  overflow: hidden;
}

.billing-list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: var(--space-2);
  min-width: min(100%, 520px);
}

.billing-list-tools .btn {
  min-height: 44px;
  gap: var(--space-2);
}

.billing-list-filter {
  min-width: 190px;
}

.billing-list-filter label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.billing-list-filter .form-select {
  min-height: 44px !important;
}

.bill-action-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.bill-action-stack .btn {
  min-height: 36px;
  padding: 0.45rem 0.68rem !important;
  gap: var(--space-1);
  border-radius: var(--radius-sm) !important;
  white-space: nowrap;
}

.bill-adjustment-type {
  flex: 0 0 82px;
  max-width: 82px !important;
}

.bill-items-table code {
  color: var(--primary);
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}

.report-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.report-subnav a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(15, 30, 53, 0.08);
  color: var(--text);
  text-decoration: none !important;
  font-weight: 700;
}

.report-subnav a.active {
  background: var(--primary);
  color: #ffffff;
}

.inventory-workspace {
  display: grid;
  gap: 1rem;
}

.inventory-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(15, 30, 53, 0.08);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(24, 43, 77, 0.05), transparent 22%),
    radial-gradient(circle at bottom left, rgba(34, 164, 90, 0.07), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.995), rgba(248, 251, 253, 0.985));
  box-shadow: 0 14px 30px rgba(16, 33, 60, 0.06);
}

.inventory-copy {
  min-width: 0;
}

.inventory-copy h3,
.inventory-copy h4,
.inventory-copy h5 {
  margin: 0;
  color: var(--heading-color);
  font-weight: 800;
}

.inventory-copy p {
  margin: 0.28rem 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.inventory-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.68rem;
  margin-bottom: 0.45rem;
  border-radius: 999px;
  background: rgba(34, 164, 90, 0.1);
  color: var(--accent-dark);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.inventory-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.inventory-actions::-webkit-scrollbar {
  display: none;
}

.inventory-actions > * {
  flex: 0 0 auto;
}

.inventory-panel,
.inventory-summary-card {
  border: 1px solid rgba(15, 30, 53, 0.08) !important;
  border-radius: 22px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.985)) !important;
  box-shadow: var(--shadow-xs) !important;
}

.inventory-panel > .card-header {
  padding: 0.95rem 1.1rem;
  background: transparent !important;
  border-bottom: 1px solid rgba(15, 30, 53, 0.08) !important;
}

.inventory-panel > .card-body,
.inventory-summary-card > .card-body {
  padding: 1rem 1.1rem;
}

.inventory-panel-headbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.95rem;
}

.inventory-panel-headbar h5,
.inventory-panel-headbar h6,
.inventory-panel > .card-header h5,
.inventory-panel > .card-header h6 {
  margin: 0;
  color: var(--heading-color);
  font-weight: 800;
}

.inventory-panel-headbar p,
.inventory-panel > .card-header p {
  margin: 0.18rem 0 0;
  color: var(--text-secondary);
}

.inventory-table-wrap {
  border-radius: 20px;
  overflow: hidden;
}

.inventory-summary-card {
  min-height: 100%;
}

.inventory-summary-card .inventory-metric-label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.inventory-summary-card .inventory-metric-value {
  display: block;
  margin-top: 0.4rem;
  color: var(--heading-color);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
}

.inventory-tone-primary {
  background: linear-gradient(180deg, rgba(24, 43, 77, 0.08), rgba(255, 255, 255, 0.99)) !important;
}

.inventory-tone-info {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.08), rgba(255, 255, 255, 0.99)) !important;
}

.inventory-tone-warning {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.1), rgba(255, 255, 255, 0.99)) !important;
}

.inventory-tone-success {
  background: linear-gradient(180deg, rgba(34, 164, 90, 0.09), rgba(255, 255, 255, 0.99)) !important;
}

.inventory-info-box {
  padding: 0.95rem 1rem;
  border: 1px dashed rgba(15, 30, 53, 0.14);
  border-radius: 18px;
  background: rgba(244, 247, 251, 0.9);
  color: var(--text-secondary);
}

.inventory-info-box.alert-light {
  border-color: rgba(15, 30, 53, 0.14);
  background: rgba(244, 247, 251, 0.9);
}

.inventory-info-box.alert-success {
  border-color: rgba(34, 164, 90, 0.22);
  background: rgba(220, 252, 231, 0.78);
  color: #166534;
}

.inventory-info-box.alert-warning {
  border-color: rgba(217, 119, 6, 0.22);
  background: rgba(255, 247, 237, 0.86);
  color: #9a3412;
}

.inventory-mini-stat {
  min-height: 100%;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(15, 30, 53, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.985));
  box-shadow: var(--shadow-xs);
}

.inventory-mini-stat .label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inventory-mini-stat .value {
  display: block;
  margin-top: 0.38rem;
  color: var(--heading-color);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
}

.inventory-row-card {
  padding: 1rem;
  border: 1px solid rgba(15, 30, 53, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 253, 0.97));
  box-shadow: var(--shadow-xs);
}

.inventory-row-card .form-label {
  color: var(--heading-color);
  font-size: 0.82rem;
  font-weight: 700;
}

.inventory-row-card small,
.inventory-form-note {
  color: var(--text-secondary) !important;
}

.inventory-chip-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.inventory-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.62rem;
  border-radius: 999px;
  background: rgba(24, 43, 77, 0.06);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
}

.inventory-history-table tbody td,
.inventory-history-table thead th {
  vertical-align: top;
}

.sales-history-modal .modal-dialog {
  max-width: min(1380px, calc(100vw - 1.5rem));
}

.sales-history-toolbar {
  margin-bottom: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(15, 30, 53, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 253, 0.98));
  box-shadow: var(--shadow-xs);
}

.sales-history-toolbar-note {
  margin-top: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.sales-history-actions,
.sales-history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sales-history-primary-actions,
.sales-history-export-actions,
.sales-history-page-size,
.sales-history-page-buttons {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sales-history-page-size {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.sales-history-page-size .form-select {
  min-width: 82px;
}

.sales-history-pagination {
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(15, 30, 53, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-xs);
}

.sales-history-page-info {
  color: var(--heading-color);
  font-size: 0.86rem;
  font-weight: 800;
}

.sales-history-stats {
  margin-bottom: 1rem;
}

.sales-history-page .inventory-panel {
  overflow: visible;
}

.sales-history-page .sales-history-headbar {
  margin-bottom: 0.85rem;
}

.sales-history-page .inventory-panel-headbar p {
  max-width: 38rem;
}

.sales-history-table-wrap {
  max-height: calc(100vh - 320px);
}

.sales-history-page .sales-history-table-wrap {
  max-height: none;
}

.sales-history-product-line strong,
.sales-history-customer-line strong,
.sales-history-invoice-line strong {
  display: block;
  color: var(--heading-color);
}

.sales-history-product-line small,
.sales-history-customer-line small,
.sales-history-invoice-line small,
.sales-history-context-line small {
  display: block;
  color: var(--text-secondary);
}

.sales-history-context-line {
  display: grid;
  gap: 0.12rem;
  min-width: 130px;
}

.sales-history-price-stack {
  display: grid;
  gap: 0.18rem;
}

.sales-history-margin-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(24, 43, 77, 0.07);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
}

/* Form and modal refinement pass */
.modal-content {
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 253, 0.97)) !important;
}

.modal-header,
.modal-footer {
  padding: 1rem 1.2rem;
  border-color: rgba(15, 30, 53, 0.08) !important;
  background: rgba(248, 251, 253, 0.88);
}

.modal-title {
  font-weight: 800;
  color: var(--heading-color);
}

.modal-header .close,
.modal-header .btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(15, 30, 53, 0.08);
  background: #ffffff;
  color: var(--text);
  opacity: 1;
  box-shadow: var(--shadow-xs);
}

.search-suggestion-container .input-group,
.barcode-scanner-container .input-group {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(15, 30, 53, 0.1);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.search-suggestion-container .input-group .input-group-text,
.search-suggestion-container .input-group .btn,
.barcode-scanner-container .input-group .input-group-text,
.barcode-scanner-container .input-group .btn {
  border: 0 !important;
}

.suggestion-dropdown {
  margin-top: 0.45rem;
  border: 1px solid rgba(15, 30, 53, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 40px rgba(16, 33, 60, 0.12);
}

.billing-surface > .card-body {
  background: transparent !important;
}

.billing-shell .billing-surface,
.billing-shell .billing-surface > .card-body,
.billing-shell .billing-section-card,
.billing-shell .billing-section-card > .card-body {
  position: relative;
  overflow: visible !important;
}

.billing-shell .billing-section-card {
  z-index: var(--z-base);
}

.billing-shell .billing-section-card:focus-within {
  z-index: var(--z-dropdown);
}

.billing-shell .search-suggestion-container {
  position: relative;
  z-index: var(--z-dropdown);
  isolation: isolate;
}

.billing-shell .suggestion-dropdown {
  z-index: var(--z-dropdown);
}

.billing-summary-card {
  position: sticky;
  top: 0.8rem;
  border: 1px solid rgba(15, 30, 53, 0.08) !important;
  border-radius: 22px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(246, 250, 253, 0.97)) !important;
  box-shadow: 0 16px 34px rgba(16, 33, 60, 0.08) !important;
}

.billing-admin-card {
  border: 1px solid rgba(15, 30, 53, 0.08) !important;
  border-radius: 20px !important;
  background: linear-gradient(135deg, rgba(24, 43, 77, 0.97), rgba(36, 65, 105, 0.95)) !important;
  color: #ffffff !important;
}

.billing-admin-card h6,
.billing-admin-card .text-warning,
.billing-admin-card .text-white {
  color: #ffffff !important;
}

.billing-admin-card .border-secondary {
  border-color: rgba(255, 255, 255, 0.14) !important;
}

.billing-admin-card .small,
.billing-admin-card .text-muted {
  color: rgba(231, 238, 248, 0.72) !important;
}

.billing-summary-row {
  gap: 0.8rem;
}

.billing-adjustment-block {
  padding: 0.85rem;
  margin-bottom: 0.8rem;
  border-radius: 18px;
  border: 1px solid rgba(15, 30, 53, 0.07);
  background: rgba(24, 43, 77, 0.04);
}

.billing-summary-card .input-group {
  overflow: hidden;
  border-radius: 14px;
}

.billing-summary-card .form-control-sm,
.billing-summary-card .form-select-sm {
  min-height: 42px !important;
}

.billing-draft-note {
  border: 0;
  border-radius: 16px;
  background: rgba(217, 119, 6, 0.12);
  color: #8d5300;
}

.billing-receive-card {
  border-color: rgba(15, 30, 53, 0.08) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 253, 0.95)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.settings-panel > .card-header {
  padding: 1rem 1.2rem;
  background: transparent;
  border-bottom: 1px solid rgba(15, 30, 53, 0.08);
}

.settings-panel .card-title {
  font-weight: 800;
  color: var(--heading-color);
}

.settings-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.4rem;
  gap: 0.5rem;
  background: rgba(235, 241, 246, 0.92);
  scrollbar-width: none;
}

.settings-tabs::-webkit-scrollbar {
  display: none;
}

.settings-tabs .nav-item {
  flex: 1 0 auto;
}

.settings-tabs .nav-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.settings-grid {
  padding: 1.15rem !important;
  background: transparent;
}

.settings-grid .card {
  border: 1px solid rgba(15, 30, 53, 0.08) !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(246, 250, 253, 0.97)) !important;
  box-shadow: 0 16px 34px rgba(16, 33, 60, 0.06) !important;
}

.settings-grid .card.card-outline {
  border-top: 0 !important;
}

.settings-grid .card-header {
  padding: 0.95rem 1.05rem;
  background: transparent !important;
  border-bottom: 1px solid rgba(15, 30, 53, 0.08);
}

.settings-grid .card-header h6 {
  margin: 0;
  font-weight: 800;
  color: var(--heading-color);
}

.settings-grid .card-body,
.settings-table-card .card-body {
  padding: 1rem 1.05rem;
}

.settings-grid .form-group {
  margin-bottom: 0.95rem;
}

.settings-grid .form-group label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--heading-color);
}

.settings-grid .form-control-sm,
.settings-grid .btn-sm,
.settings-table-card .btn-sm {
  min-height: 42px !important;
}

.settings-table-card .table thead th,
.settings-data-table thead th {
  color: var(--text) !important;
  background: #eef4fb !important;
  border-bottom: 1px solid rgba(15, 30, 53, 0.08) !important;
}

.settings-modal .modal-content {
  border-radius: 22px !important;
}

/* ═══════════════════════════════════════════════════════════════════
   DARK MODE — Private UI Component Overrides
   Needed because component styles above use hardcoded light colors
   with !important. These overrides ensure dark mode works fully.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Layout & Background ── */
body.dark-mode .wrapper,
body.dark-mode .content-wrapper {
  background: var(--bg) !important;
}

/* ── Topbar ── */
body.dark-mode .main-header.navbar.app-topbar {
  background: rgba(17, 29, 51, 0.94) !important;
  border-bottom-color: var(--border) !important;
  backdrop-filter: blur(18px);
}

body.dark-mode .app-menu-toggle,
body.dark-mode .app-icon-action,
body.dark-mode .app-user-trigger,
body.dark-mode .theme-toggle-btn {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

body.dark-mode .app-menu-toggle:hover,
body.dark-mode .app-menu-toggle:focus,
body.dark-mode .app-icon-action:hover,
body.dark-mode .app-icon-action:focus,
body.dark-mode .app-user-trigger:hover,
body.dark-mode .app-user-trigger:focus,
body.dark-mode .theme-toggle-btn:hover,
body.dark-mode .theme-toggle-btn:focus {
  color: var(--accent) !important;
  border-color: rgba(var(--accent-rgb), 0.28) !important;
  background: rgba(var(--accent-rgb), 0.1) !important;
}

body.dark-mode .app-page-title {
  color: var(--heading-color);
}

body.dark-mode .app-header-search input {
  background: var(--bg-input) !important;
  border-color: var(--border) !important;
  color: var(--text);
}

body.dark-mode .app-header-search input:focus {
  border-color: rgba(var(--accent-rgb), 0.32) !important;
  background: var(--surface) !important;
}

body.dark-mode .app-search-results {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

body.dark-mode .app-search-result:hover,
body.dark-mode .app-search-result:focus,
body.dark-mode .app-search-result.is-active {
  background: var(--surface-alt);
}

body.dark-mode .app-search-shortcut,
body.dark-mode .app-shortcut-key {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

body.dark-mode .app-user-avatar,
body.dark-mode .app-sidebar-avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

/* ── Cards & Surfaces ── */
body.dark-mode .card,
body.dark-mode .modal-content {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

body.dark-mode .card-header {
  background: transparent !important;
  border-bottom-color: var(--border) !important;
}

body.dark-mode .card-footer {
  background: var(--surface-alt) !important;
  border-top-color: var(--border) !important;
}

/* ── Forms ── */
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .custom-select,
body.dark-mode .select2-container--default .select2-selection--single,
body.dark-mode .select2-container--default .select2-selection--multiple {
  background: var(--bg-input) !important;
  border-color: var(--border-strong) !important;
  color: var(--text) !important;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus,
body.dark-mode .custom-select:focus {
  border-color: var(--accent) !important;
  box-shadow: var(--shadow-focus) !important;
}

body.dark-mode .form-control::placeholder {
  color: var(--text-muted) !important;
}

body.dark-mode .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text);
}

body.dark-mode .select2-dropdown {
  background: var(--surface) !important;
  border-color: var(--border-strong) !important;
}

body.dark-mode label:not(.btn):not(.custom-control-label):not(.form-check-label) {
  color: var(--text);
}

/* ── Nav Tabs ── */
body.dark-mode .nav-tabs {
  background: var(--surface-alt) !important;
}

body.dark-mode .nav-tabs .nav-link {
  color: var(--text-secondary) !important;
}

body.dark-mode .nav-tabs .nav-link.active {
  background: var(--surface) !important;
  color: var(--heading-color) !important;
  box-shadow: var(--shadow-xs);
}

/* ── Tables ── */
body.dark-mode .table thead th,
body.dark-mode .dataTable thead th {
  background: var(--sidebar-bg) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  border-bottom-color: var(--border) !important;
}

body.dark-mode .table td {
  border-color: var(--border) !important;
  color: var(--text);
}

body.dark-mode .settings-table-card .table thead th,
body.dark-mode .settings-data-table thead th {
  background: var(--surface-alt) !important;
  color: var(--text) !important;
  border-bottom-color: var(--border) !important;
}

/* ── Hero Sections ── */
body.dark-mode .dash-hero,
body.dark-mode .finance-hero,
body.dark-mode .account-module-hero,
body.dark-mode .products-hero,
body.dark-mode .gui-billing-hero,
body.dark-mode .report-hero,
body.dark-mode .billing-hero,
body.dark-mode .settings-hero,
body.dark-mode .inventory-hero {
  background: linear-gradient(135deg, var(--surface), var(--surface-alt)) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
}

body.dark-mode .dash-hero::after {
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.08), transparent);
}

/* ── Hero Buttons ── */
body.dark-mode .dash-hero .btn-outline-dark,
body.dark-mode .dash-hero .btn-outline-secondary,
body.dark-mode .finance-hero .btn-outline-dark,
body.dark-mode .finance-hero .btn-outline-secondary,
body.dark-mode .account-module-hero .btn-outline-dark,
body.dark-mode .gui-billing-hero .btn-outline-dark,
body.dark-mode .gui-billing-hero .btn-outline-secondary,
body.dark-mode .report-hero .btn-outline-dark,
body.dark-mode .billing-hero .btn-outline-dark,
body.dark-mode .settings-hero .btn-outline-dark,
body.dark-mode .products-hero .btn-light {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

/* ── Eyebrows ── */
body.dark-mode .dash-eyebrow,
body.dark-mode .finance-eyebrow,
body.dark-mode .account-module-eyebrow,
body.dark-mode .gui-billing-eyebrow,
body.dark-mode .report-eyebrow,
body.dark-mode .billing-eyebrow,
body.dark-mode .settings-eyebrow,
body.dark-mode .inventory-eyebrow {
  background: rgba(var(--accent-rgb), 0.12) !important;
  border-color: var(--border) !important;
  color: var(--accent) !important;
}

/* ── Panels & Stat Cards ── */
body.dark-mode .report-panel,
body.dark-mode .report-filter-card,
body.dark-mode .report-stat-card,
body.dark-mode .billing-section-card,
body.dark-mode .billing-surface,
body.dark-mode .barcode-scanner-container,
body.dark-mode .settings-panel,
body.dark-mode .inventory-panel,
body.dark-mode .inventory-summary-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

body.dark-mode .inventory-panel > .card-header,
body.dark-mode .settings-panel > .card-header {
  border-bottom-color: var(--border) !important;
}

body.dark-mode .billing-surface > .card-header {
  background: var(--surface-alt) !important;
  border-bottom-color: var(--border) !important;
}

body.dark-mode .billing-list-filter label {
  color: var(--text-secondary);
}

body.dark-mode .bill-items-table code {
  color: var(--accent);
}

body.dark-mode .billing-surface > .card-header h5,
body.dark-mode .billing-surface > .card-header .text-primary {
  color: var(--heading-color) !important;
}

/* ── Modal ── */
body.dark-mode .modal-content {
  background: var(--surface) !important;
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
  background: var(--surface-alt) !important;
  border-color: var(--border) !important;
}

body.dark-mode .modal-title {
  color: var(--heading-color);
}

body.dark-mode .modal-header .close,
body.dark-mode .modal-header .btn-close {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

/* ── Inventory ── */
body.dark-mode .inventory-mini-stat,
body.dark-mode .inventory-row-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

body.dark-mode .inventory-info-box {
  background: var(--surface-alt) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary);
}

body.dark-mode .inventory-info-box.alert-success {
  background: rgba(var(--accent-rgb), 0.1) !important;
  border-color: rgba(var(--accent-rgb), 0.2) !important;
  color: var(--accent);
}

body.dark-mode .inventory-info-box.alert-warning {
  background: rgba(217, 119, 6, 0.12) !important;
  border-color: rgba(217, 119, 6, 0.2) !important;
  color: var(--warning-light);
}

body.dark-mode .inventory-chip {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

body.dark-mode .inventory-tone-primary,
body.dark-mode .inventory-tone-info,
body.dark-mode .inventory-tone-warning,
body.dark-mode .inventory-tone-success {
  background: var(--surface) !important;
}

/* ── Sales History ── */
body.dark-mode .sales-history-toolbar {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

body.dark-mode .sales-history-pagination {
  background: rgba(15, 23, 42, 0.9);
  border-color: var(--border) !important;
}

body.dark-mode .sales-history-margin-pill {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

/* ── Suggestion Dropdown ── */
body.dark-mode .suggestion-dropdown {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

body.dark-mode .search-suggestion-container .input-group,
body.dark-mode .barcode-scanner-container .input-group {
  background: var(--bg-input) !important;
  border-color: var(--border) !important;
}

/* ── Billing ── */
body.dark-mode .billing-summary-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

body.dark-mode .billing-adjustment-block {
  background: var(--surface-alt);
  border-color: var(--border);
}

body.dark-mode .billing-receive-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

body.dark-mode .billing-draft-note {
  background: rgba(217, 119, 6, 0.15);
  color: var(--warning-light);
}

/* ── Settings ── */
body.dark-mode .settings-tabs {
  background: var(--surface-alt) !important;
}

body.dark-mode .settings-grid {
  background: transparent;
}

body.dark-mode .settings-grid .card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

body.dark-mode .settings-grid .card-header {
  border-bottom-color: var(--border);
}

/* ── Quick Add ── */
/* ── Report Sub-nav ── */
body.dark-mode .report-subnav a {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

body.dark-mode .report-subnav a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* ── Bill Action Modal ── */
body.dark-mode .bill-action-body {
  background: var(--bg) !important;
}

body.dark-mode .bill-action-body label {
  color: var(--text-secondary);
}

body.dark-mode .bill-mini-summary {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .bill-mini-grid span {
  background: var(--surface-alt);
  border-color: var(--border);
}

body.dark-mode .bill-mini-grid small {
  color: var(--text-muted);
}

body.dark-mode .bill-mini-grid b {
  color: var(--heading-color);
}

body.dark-mode .bill-origin-chip {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(125, 211, 252, 0.22);
  color: #7dd3fc;
}

body.dark-mode .compact-preview-grid input[readonly] {
  background: var(--surface-alt);
  border-color: var(--border);
}

body.dark-mode .bill-quick-payments button {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

body.dark-mode .bill-quick-payments button:hover,
body.dark-mode .bill-quick-payments button:focus {
  background: var(--surface-alt);
  border-color: rgba(45, 212, 191, 0.38);
  color: var(--heading-color);
}

/* ── Mobile Cards (Dark) ── */
body.dark-mode .ui-mobile-cards tbody tr {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

body.dark-mode .ui-mobile-cards tbody td {
  border-bottom-color: var(--border) !important;
}

/* ── Dropdown ── */
body.dark-mode .dropdown-menu {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

body.dark-mode .dropdown-item {
  color: var(--text);
}

body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus {
  background: var(--surface-alt);
  color: var(--heading-color);
}

/* ── Text & Misc ── */
body.dark-mode p {
  color: var(--text-secondary);
}

body.dark-mode .text-muted {
  color: var(--text-muted) !important;
}

body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 {
  color: var(--heading-color);
}

body.dark-mode .btn-primary,
body.dark-mode .btn-dark {
  background: linear-gradient(135deg, var(--primary-light), var(--primary)) !important;
  border-color: transparent !important;
}

body.dark-mode .btn-outline-dark {
  color: var(--text) !important;
  border-color: var(--border) !important;
  background: transparent !important;
}

body.dark-mode .btn-outline-dark:hover {
  background: var(--surface-alt) !important;
  color: var(--heading-color) !important;
}

body.dark-mode .btn-outline-secondary {
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
}

body.dark-mode .btn-outline-secondary:hover {
  background: var(--surface-alt) !important;
  color: var(--text) !important;
}

body.dark-mode .btn-light {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

body.dark-mode .btn-secondary {
  background: var(--surface-alt) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

body.dark-mode .alert-success { background: rgba(16, 185, 129, 0.12) !important; color: #6ee7b7 !important; }
body.dark-mode .alert-danger { background: rgba(220, 38, 38, 0.12) !important; color: #fca5a5 !important; }
body.dark-mode .alert-warning { background: rgba(217, 119, 6, 0.12) !important; color: #fde68a !important; }
body.dark-mode .alert-info { background: rgba(14, 165, 233, 0.12) !important; color: #7dd3fc !important; }

/* ── Footer ── */
body.dark-mode .app-footer {
  color: var(--text-muted);
}

body.dark-mode .app-footer-copy strong {
  color: var(--heading-color);
}

/* ── Mobile Bottom Nav ── */
body.dark-mode .mobile-bottom-nav {
  background: rgba(6, 13, 24, 0.95);
}

/* Role-aware workspace navigation */
.app-search-key {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  padding: 0.2rem 0.42rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

.app-header-search input {
  padding-right: 4.2rem;
}

.app-search-close,
.app-command-button {
  display: none;
}

.app-search-result {
  justify-content: flex-start;
  border-radius: 8px;
}

.app-search-result-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--result-accent) 12%, transparent);
  color: var(--result-accent);
}

.app-search-result > div {
  flex: 1 1 auto;
}

.app-sidebar-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.45rem 0.72rem 0.35rem;
  color: rgba(231, 238, 248, 0.58);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.app-sidebar-caption button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.8);
}

.sidebar .nav-sidebar .app-sidebar-group,
.sidebar .nav-sidebar .app-sidebar-home {
  min-height: 46px;
  color: rgba(238, 244, 252, 0.88);
}

.sidebar .nav-sidebar .app-sidebar-group.active,
.sidebar .nav-sidebar .app-sidebar-home.active {
  color: #ffffff !important;
}

.app-nav-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.35rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--nav-accent) 24%, transparent);
  color: color-mix(in srgb, var(--nav-accent) 72%, white);
}

.app-nav-icon-danger {
  --nav-accent: #ef4444;
}

.sidebar .nav-sidebar .app-sidebar-group > p,
.sidebar .nav-sidebar .app-sidebar-home > p,
.sidebar .nav-sidebar .app-sidebar-logout > .nav-link > p {
  display: flex;
  align-items: center;
  min-width: 0;
}

.app-group-count {
  min-width: 22px;
  margin-left: auto;
  margin-right: 1.2rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.66rem;
  font-weight: 800;
  text-align: center;
}

.sidebar .nav-sidebar .nav-treeview {
  margin: 0.15rem 0.6rem 0.4rem 1.55rem;
  padding: 0.18rem 0 0.18rem 0.45rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .nav-sidebar .nav-treeview .nav-link {
  min-height: 38px;
  margin: 0.06rem 0;
  padding: 0.55rem 0.62rem;
  border-radius: 7px;
  color: rgba(231, 238, 248, 0.76);
}

.sidebar .nav-sidebar .nav-treeview .nav-icon {
  width: 1rem;
  margin-right: 0.25rem;
  color: rgba(231, 238, 248, 0.58);
  font-size: 0.78rem;
}

.sidebar .nav-sidebar .nav-treeview .nav-link.active {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.12) !important;
}

.app-nav-shortcut {
  top: 0.62rem !important;
  padding: 0.12rem 0.32rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.6rem;
  font-weight: 800;
}

.app-sidebar-logout {
  margin-top: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-mode .app-search-key {
  border-color: var(--border);
  background: var(--surface-alt);
}



@media (max-width: 1440px) {
  .app-header-grid {
    grid-template-columns: minmax(0, auto) minmax(190px, 340px) minmax(0, auto);
  }

  .app-header-shortcuts {
    gap: 0.35rem;
  }

  .app-icon-action,
  .app-header-action {
    padding: 0.42rem 0.62rem !important;
  }
}

@media (max-width: 1199.98px) {
  .app-header-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .app-header-left {
    min-width: 0;
  }

  .app-header-search {
    grid-column: 1 / -1;
  }

  .app-header-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .app-header-shortcuts {
    max-width: min(42vw, 360px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .app-header-shortcuts::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .content-wrapper > .content {
    padding: 0.65rem 0.65rem 5.15rem !important;
  }

  .main-header.navbar.app-topbar {
    min-height: auto;
    padding: 0.35rem 0.55rem;
  }

  .app-header-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
    align-items: center;
  }

  .app-header-left {
    gap: 0.4rem;
    min-width: 0;
  }

  .app-menu-toggle,
  .app-icon-action,
  .app-header-action,
  .app-user-trigger,
  .theme-toggle-btn {
    min-height: 36px;
    border-radius: 11px !important;
    box-shadow: none;
  }

  .app-menu-toggle {
    width: 36px;
  }

  .app-page-kicker {
    display: none;
  }

  .app-page-title {
    font-size: 0.92rem;
    line-height: 1.1;
  }

  .app-header-search {
    display: none;
  }

  .app-command-button {
    width: 36px;
    display: inline-flex;
    padding: 0 !important;
  }

  .app-command-button span {
    display: none;
  }

  body.app-search-open {
    overflow: hidden;
  }

  body.app-search-open .app-header-search {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: block;
    padding: 0.8rem;
    background: rgba(8, 18, 32, 0.52);
    backdrop-filter: blur(8px);
  }

  body.app-search-open .app-header-search-icon {
    top: 2.15rem;
    left: 1.75rem;
  }

  body.app-search-open .app-header-search input {
    min-height: 52px;
    padding: 0.72rem 3rem 0.72rem 2.35rem;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  body.app-search-open .app-search-key {
    display: none;
  }

  body.app-search-open .app-search-close {
    position: absolute;
    top: 1.25rem;
    right: 1.3rem;
    z-index: 3;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
  }

  body.app-search-open .app-search-results {
    top: 4.7rem;
    right: 0.8rem;
    left: 0.8rem;
    max-height: calc(100vh - 5.6rem);
    border-radius: 8px;
  }

  .app-header-actions {
    max-width: none;
    overflow: visible;
    justify-content: flex-end;
  }

  .app-header-shortcuts {
    display: none;
  }

  .app-user-meta {
    display: none;
  }

  .app-user-trigger {
    padding: 0.35rem !important;
  }

  .app-footer {
    display: none;
  }

  .mobile-bottom-nav {
    display: flex;
    right: 0.5rem;
    left: 0.5rem;
    bottom: 0.45rem;
    padding: 0.35rem;
    border-radius: 16px;
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    min-height: 44px;
    min-width: 68px;
    padding: 0.38rem 0.58rem;
    font-size: 0.68rem;
  }

  .nav-tabs,
  .report-subnav,
  .billing-actions,
  .settings-actions,
  .report-actions {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .nav-tabs::-webkit-scrollbar,
  .report-subnav::-webkit-scrollbar,
  .billing-actions::-webkit-scrollbar,
  .settings-actions::-webkit-scrollbar,
  .report-actions::-webkit-scrollbar {
    display: none;
  }

  .nav-tabs .nav-link,
  .report-subnav a,
  .billing-actions .btn,
  .settings-actions .btn,
  .report-actions .btn {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .billing-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .billing-section-head span,
  .dash-copy,
  .finance-copy,
  .account-module-copy,
  .products-hero-copy p,
  .gui-billing-copy,
  .report-copy,
  .billing-copy,
  .settings-copy,
  .inventory-copy p,
  .dash-eyebrow,
  .finance-eyebrow,
  .account-module-eyebrow,
  .gui-billing-eyebrow,
  .report-eyebrow,
  .billing-eyebrow,
  .settings-eyebrow,
  .inventory-eyebrow {
    display: none !important;
  }

  .dash-hero,
  .finance-hero,
  .account-module-hero,
  .products-hero,
  .gui-billing-hero,
  .report-hero,
  .billing-hero,
  .settings-hero,
  .inventory-hero {
    padding: 0.8rem !important;
    border-radius: 16px !important;
  }

  .report-panel,
  .report-filter-card,
  .report-stat-card,
  .billing-section-card,
  .billing-surface,
  .barcode-scanner-container,
  .settings-panel,
  .inventory-panel,
  .inventory-summary-card,
  .card,
  .modal-content {
    border-radius: 16px !important;
  }

  .inventory-actions {
    flex-wrap: nowrap;
    width: 100%;
  }

  .inventory-panel > .card-body,
  .inventory-summary-card > .card-body {
    padding: 0.9rem !important;
  }

  .inventory-mini-stat {
    padding: 0.9rem;
    border-radius: 16px;
  }

  .inventory-row-card {
    padding: 0.9rem;
    border-radius: 16px;
  }

  .sales-history-toolbar {
    padding: 0.9rem;
    border-radius: 16px;
  }

  .sales-history-actions,
  .sales-history-pagination {
    align-items: stretch;
  }

  .sales-history-primary-actions,
  .sales-history-export-actions,
  .sales-history-page-size,
  .sales-history-page-buttons {
    width: 100%;
  }

  .sales-history-primary-actions .btn,
  .sales-history-export-actions .btn,
  .sales-history-page-buttons .btn {
    flex: 1 1 130px;
  }

  .sales-history-page-info {
    width: 100%;
    text-align: center;
  }

  .sales-history-table-wrap {
    max-height: none;
  }

  .form-control,
  .form-select,
  .custom-select,
  .select2-container--default .select2-selection--single,
  .select2-container--default .select2-selection--multiple {
    min-height: 46px !important;
    border-radius: 14px !important;
  }

  .btn {
    min-height: 42px;
    border-radius: 12px !important;
  }

  .billing-summary-card {
    position: static;
  }

  .billing-summary-row {
    flex-direction: column;
    align-items: stretch !important;
  }

  .billing-summary-row .input-group,
  .billing-summary-row .form-control {
    width: 100% !important;
    max-width: none !important;
  }

  .settings-grid {
    padding: 0.92rem !important;
  }

  .ui-mobile-cards thead {
    display: none;
  }

  .ui-mobile-cards tbody,
  .ui-mobile-cards tr,
  .ui-mobile-cards td {
    display: block;
    width: 100%;
  }

  .ui-mobile-cards tbody tr {
    margin-bottom: 0.9rem;
    border: 1px solid rgba(15, 30, 53, 0.08);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
  }

  .ui-mobile-cards tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(15, 30, 53, 0.08) !important;
    text-align: right;
  }

  .ui-mobile-cards tbody td:last-child {
    border-bottom: 0 !important;
  }

  .ui-mobile-cards tbody td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
  }

  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    width: 100%;
    text-align: left !important;
  }

  .dataTables_wrapper .dataTables_filter input,
  .dataTables_wrapper .dataTables_length select {
    width: 100%;
    margin-left: 0 !important;
    margin-top: 0.35rem;
  }

  .ui-mobile-cards tbody td[colspan] {
    display: block;
    text-align: center !important;
  }

  .ui-mobile-cards tbody td[colspan]::before {
    display: none;
  }

  .ui-mobile-cards tbody td .btn-group,
  .ui-mobile-cards tbody td .product-actions,
  .ui-mobile-cards tbody td .account-action-stack,
  .ui-mobile-cards tbody td .bill-action-stack {
    width: 100%;
    justify-content: flex-end;
  }

  .billing-list-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .billing-list-filter {
    min-width: 100%;
  }

  .billing-list-tools .btn,
  .billing-list-filter {
    flex: 1 1 100%;
  }
}

.bill-action-dialog,
.purchase-payment-dialog {
  max-width: 560px;
}

.bill-action-modal {
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.bill-action-modal .modal-header {
  padding: 0.95rem 1.15rem;
  border: 0;
  background: linear-gradient(135deg, #0f766e, #14532d);
  color: #fff;
}

.bill-action-modal .modal-title {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.bill-action-modal .btn-close {
  color: #fff;
}

.bill-action-body {
  max-height: calc(100vh - 135px);
  overflow-y: auto;
  padding: 1rem 1.15rem 1.15rem;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 56%);
}

.bill-action-body hr {
  margin: 0.75rem 0;
}

.bill-action-body label {
  margin-bottom: 0.25rem;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bill-action-body .form-control,
.bill-action-body .form-select {
  min-height: 38px;
  border-radius: 12px;
  font-size: 0.92rem;
}

.bill-action-body textarea.form-control {
  min-height: 38px;
}

.bill-action-body .btn-lg {
  min-height: 44px;
  border-radius: 14px;
  font-weight: 800;
}

.compact-section-title {
  margin: 0 0 0.55rem;
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 900;
}

.bill-mini-summary {
  padding: 0.85rem;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.bill-mini-title {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

.bill-mini-title strong {
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.2;
}

.bill-mini-title span {
  color: #64748b;
  font-size: 0.78rem;
  text-align: right;
}

.bill-number-cell {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}

.bill-origin-row {
  margin: -0.25rem 0 0.65rem;
}

.bill-origin-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.22rem 0.48rem;
  border: 1px solid rgba(14, 165, 233, 0.22);
  border-radius: 999px;
  background: #eff6ff;
  color: #075985;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.bill-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.bill-mini-grid span,
.compact-preview-grid > [class*="col-"] {
  border-radius: 14px;
}

.bill-mini-grid span {
  padding: 0.5rem;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.bill-mini-grid small {
  display: block;
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bill-mini-grid b {
  display: block;
  color: #0f172a;
  font-size: 0.86rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.compact-preview-grid input[readonly] {
  background: #f8fafc;
  border-color: rgba(15, 118, 110, 0.18);
  font-weight: 800;
}

.bill-quick-payments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.bill-quick-payments button {
  min-height: 30px;
  padding: 0.28rem 0.58rem;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: #0f766e;
  font-size: 0.76rem;
  font-weight: 800;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.bill-quick-payments button:hover,
.bill-quick-payments button:focus {
  border-color: rgba(15, 118, 110, 0.42);
  background: #ecfdf5;
  transform: translateY(-1px);
}

@media (max-width: 575.98px) {
  .bill-action-dialog,
  .purchase-payment-dialog {
    max-width: none;
    margin: 0.65rem;
  }

  .bill-mini-title {
    display: block;
  }

  .bill-mini-title span {
    display: block;
    margin-top: 0.25rem;
    text-align: left;
  }

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

@media (max-width: 767.98px) {
  .main-sidebar {
    z-index: calc(var(--z-header) + 40) !important;
  }

  #sidebar-overlay {
    z-index: calc(var(--z-header) + 30) !important;
  }

  body.sidebar-open .mobile-bottom-nav {
    z-index: calc(var(--z-header) - 1) !important;
    pointer-events: none;
    opacity: 0.18;
  }
}

/* ==========================================================================
   GLOBAL COMPACT MODAL SYSTEM — cute, small, premium modals
   ========================================================================== */

/* --- Compact: form-only modals (Add/Edit with inputs only) --- */
.sk-modal-compact { max-width: 480px; }

/* --- Mid: modals with tables/lists inside --- */
.sk-modal-mid { max-width: 640px; }

/* --- Shared cute modal styling --- */
.sk-modal-compact .modal-content,
.sk-modal-mid .modal-content {
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}

.sk-modal-compact .modal-header,
.sk-modal-mid .modal-header {
  padding: 0.8rem 1.1rem;
  border: 0;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
}

.sk-modal-compact .modal-title,
.sk-modal-mid .modal-title {
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0;
}

.sk-modal-compact .modal-header .btn-close,
.sk-modal-mid .modal-header .btn-close,
.sk-modal-compact .modal-header .close,
.sk-modal-mid .modal-header .close {
  color: #fff;
  opacity: 0.7;
  text-shadow: none;
  filter: invert(1);
}

.sk-modal-compact .modal-body,
.sk-modal-mid .modal-body {
  padding: 0.9rem 1.1rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 50%);
  font-size: 0.85rem;
}

.sk-modal-compact .modal-body label,
.sk-modal-mid .modal-body label {
  margin-bottom: 0.2rem;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sk-modal-compact .modal-body .form-control,
.sk-modal-compact .modal-body .form-select,
.sk-modal-compact .modal-body .custom-select,
.sk-modal-mid .modal-body .form-control,
.sk-modal-mid .modal-body .form-select,
.sk-modal-mid .modal-body .custom-select {
  min-height: 36px !important;
  padding: 0.35rem 0.65rem;
  border-radius: 10px !important;
  font-size: 0.85rem;
}

.sk-modal-compact .modal-body textarea.form-control,
.sk-modal-mid .modal-body textarea.form-control {
  min-height: 36px !important;
}

.sk-modal-compact .modal-body .row > [class*="col-"],
.sk-modal-mid .modal-body .row > [class*="col-"] {
  margin-bottom: 0.55rem !important;
}

.sk-modal-compact .modal-body .mb-2,
.sk-modal-compact .modal-body .mb-3,
.sk-modal-mid .modal-body .mb-2,
.sk-modal-mid .modal-body .mb-3 {
  margin-bottom: 0.55rem !important;
}

.sk-modal-compact .modal-footer,
.sk-modal-mid .modal-footer {
  padding: 0.6rem 1.1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
  gap: 0.4rem;
}

.sk-modal-compact .modal-footer .btn,
.sk-modal-mid .modal-footer .btn {
  min-height: 36px;
  padding: 0.35rem 1rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Select2 inside compact modals */
.sk-modal-compact .select2-container--default .select2-selection--single,
.sk-modal-mid .select2-container--default .select2-selection--single {
  min-height: 36px !important;
  border-radius: 10px !important;
}

/* Custom switch inside compact modals */
.sk-modal-compact .custom-control-label,
.sk-modal-mid .custom-control-label {
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0;
}

/* Tables inside mid-size modals */
.sk-modal-mid .table {
  font-size: 0.78rem;
}

.sk-modal-mid .table th {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45rem 0.55rem;
}

.sk-modal-mid .table td {
  padding: 0.4rem 0.55rem;
}

/* Finance modal note */
.sk-modal-compact .finance-modal-note,
.sk-modal-mid .finance-modal-note {
  font-size: 0.72rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  margin-top: 0.3rem;
}

/* ==========================================================================
   GLOBAL MODAL VIEWPORT FIX — footer always visible, body scrolls
   Bootstrap 4 sets .modal { overflow-y: auto } which scrolls the ENTIRE
   dialog as a page. We kill that and force internal body-only scrolling.
   ========================================================================== */

/* 1. Kill Bootstrap's page-level modal scroll */
.modal {
  overflow: hidden !important;
}

/* 2. Constrain dialog to viewport */
.modal .modal-dialog {
  max-height: calc(100vh - 1rem) !important;
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
  overflow: hidden !important;
}

/* 3. Constrain modal-content */
.modal .modal-content {
  display: flex !important;
  flex-direction: column !important;
  max-height: calc(100vh - 1rem) !important;
  overflow: hidden !important;
}

/* 4. If <form> wraps body+footer (common pattern), make it flex too */
.modal .modal-content > form {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* 5. Pin header */
.modal .modal-header {
  flex-shrink: 0 !important;
}

/* 6. Scrollable body */
.modal .modal-body {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-height: 0 !important;
  -webkit-overflow-scrolling: touch;
}

/* 7. Pin footer (submit button always visible) */
.modal .modal-footer {
  flex-shrink: 0 !important;
}

/* Mobile */
@media (max-width: 575.98px) {
  .sk-modal-compact,
  .sk-modal-mid {
    max-width: none !important;
    margin: 0.35rem !important;
  }

  .modal .modal-dialog {
    max-height: calc(100vh - 0.5rem) !important;
    margin: 0.25rem !important;
  }

  .modal .modal-content {
    max-height: calc(100vh - 0.5rem) !important;
  }
}

/* Short laptop screens */
@media (max-height: 700px) {
  .modal .modal-dialog {
    max-height: calc(100vh - 0.5rem) !important;
  }

  .modal .modal-content {
    max-height: calc(100vh - 0.5rem) !important;
  }
}

