:root {
  --primary: #182b4d;
  --primary-dark: #10203a;
  --primary-soft: #e8eef6;
  --primary-rgb: 24, 43, 77;
  --accent: #22a45a;
  --accent-dark: #187846;
  --accent-soft: #dcfce7;
  --success: #15803d;
  --warning: #d97706;
  --error: #dc2626;
  --bg: #f4f7fb;
  --bg-subtle: #ebf1f6;
  --surface: #ffffff;
  --border: #d9e3ee;
  --text: #10213c;
  --text-secondary: #61708a;
  --heading-color: #0d1b31;
  --sidebar-bg: #0f1e35;
  --sidebar-text: #b7c4d8;
  --sidebar-text-hover: #f7fbff;
  --font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --shadow-xs: 0 10px 24px rgba(16, 33, 60, 0.06);
  --shadow-sm: 0 18px 36px rgba(16, 33, 60, 0.08);
  --shadow: 0 24px 48px rgba(16, 33, 60, 0.12);
}

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,
.quick-add-actions,
.settings-actions,
.report-actions {
  max-width: 100%;
  min-width: 0;
}

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

.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: clamp(0.96rem, 0.45vw + 0.82rem, 1.08rem);
  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: 1080;
}

.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: 1090;
  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;
}

.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,
.quick-add-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,
.quick-add-copy {
  color: var(--text-secondary) !important;
}

.dash-eyebrow,
.finance-eyebrow,
.account-module-eyebrow,
.gui-billing-eyebrow,
.report-eyebrow,
.billing-eyebrow,
.settings-eyebrow,
.quick-add-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,
.quick-add-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,
.quick-add-card,
.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,
.quick-add-hero {
  padding: 1.25rem;
}

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

.billing-actions,
.quick-add-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;
}

.quick-add-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.86), rgba(235, 241, 246, 0.82));
}

.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: clamp(1.25rem, 1vw + 0.95rem, 1.9rem);
  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: clamp(1.12rem, 0.8vw + 0.95rem, 1.7rem);
  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-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 {
  display: block;
  color: var(--text-secondary);
}

.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;
}

.purchase-workspace .inventory-panel,
.purchase-workspace .inventory-panel > .card-body,
.purchase-workspace .inventory-table-wrap,
.purchase-workspace .search-suggestion-container {
  position: relative;
  overflow: visible !important;
}

.purchase-workspace .inventory-panel {
  z-index: 1;
}

.purchase-workspace .inventory-panel:focus-within {
  z-index: 30;
}

.purchase-workspace .search-suggestion-container {
  z-index: 40;
  isolation: isolate;
}

.purchase-workspace .suggestion-dropdown {
  z-index: 1400;
}

.purchase-workspace #purchaseTable th:nth-child(7),
.purchase-workspace #purchaseTable td.purchase-margin-cell {
  min-width: 158px;
}

.purchase-workspace .purchase-margin-group {
  flex-wrap: nowrap;
  width: 100%;
  min-width: 136px;
  border: 1px solid rgba(15, 30, 53, 0.12);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.purchase-workspace .purchase-margin-group .form-control,
.purchase-workspace .purchase-margin-group .form-select {
  min-height: 40px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.purchase-workspace .purchase-margin-value {
  min-width: 0;
  font-weight: 700;
}

.purchase-workspace .purchase-margin-type {
  flex: 0 0 82px;
  max-width: 82px !important;
  padding-left: 0.45rem;
  padding-right: 1.7rem;
  background: rgba(24, 43, 77, 0.05) !important;
  color: var(--heading-color) !important;
  font-size: 0.86rem;
  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: 1;
}

.billing-shell .billing-section-card:focus-within {
  z-index: 30;
}

.billing-shell .search-suggestion-container {
  position: relative;
  z-index: 40;
  isolation: isolate;
}

.billing-shell .suggestion-dropdown {
  z-index: 1400;
}

.quick-add-shell .quick-add-card,
.quick-add-shell .quick-add-card > .card-body,
.quick-add-shell .barcode-scanner-container {
  position: relative;
  overflow: visible !important;
}

.quick-add-shell .quick-add-card {
  z-index: 1;
}

.quick-add-shell .quick-add-card:focus-within {
  z-index: 30;
}

.quick-add-shell .search-suggestion-container {
  position: relative;
  z-index: 40;
  isolation: isolate;
}

.quick-add-shell .suggestion-dropdown {
  z-index: 1400;
}

.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;
}

.quick-add-card {
  overflow: hidden;
}

.quick-add-card .card-footer {
  padding: 1rem 1.1rem;
  border-top: 1px solid rgba(15, 30, 53, 0.08);
  background: rgba(246, 250, 253, 0.86);
}

.quick-add-table-note {
  background: rgba(24, 43, 77, 0.04) !important;
  border-color: rgba(15, 30, 53, 0.08) !important;
}

.quick-add-search-note {
  max-width: 42rem;
}

@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-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,
  .quick-add-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,
  .quick-add-actions::-webkit-scrollbar,
  .settings-actions::-webkit-scrollbar,
  .report-actions::-webkit-scrollbar {
    display: none;
  }

  .nav-tabs .nav-link,
  .report-subnav a,
  .billing-actions .btn,
  .quick-add-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,
  .quick-add-copy,
  .inventory-copy p,
  .dash-eyebrow,
  .finance-eyebrow,
  .account-module-eyebrow,
  .gui-billing-eyebrow,
  .report-eyebrow,
  .billing-eyebrow,
  .settings-eyebrow,
  .quick-add-eyebrow,
  .inventory-eyebrow {
    display: none !important;
  }

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

  .report-panel,
  .report-filter-card,
  .report-stat-card,
  .billing-section-card,
  .billing-surface,
  .quick-add-card,
  .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-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;
  }

  .quick-add-card .card-footer {
    display: grid;
    gap: 0.65rem;
  }

  .quick-add-card .card-footer .btn {
    width: 100%;
    margin: 0 !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 {
    width: 100%;
    justify-content: flex-end;
  }
}
