@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Regular.woff2') format('woff2'), local('Inter'), local('Segoe UI'), local('Helvetica Neue'), local('Arial'), sans-serif;
  font-display: swap;
  font-weight: 400;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Bold.woff2') format('woff2'), local('Inter'), local('Segoe UI'), local('Helvetica Neue'), local('Arial'), sans-serif;
  font-display: swap;
  font-weight: 700;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/SpaceGrotesk-Regular.woff2') format('woff2'), local('Space Grotesk'), local('Segoe UI'), local('Arial'), sans-serif;
  font-display: swap;
  font-weight: 400;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/SpaceGrotesk-Bold.woff2') format('woff2'), local('Space Grotesk'), local('Segoe UI'), local('Arial'), sans-serif;
  font-display: swap;
  font-weight: 700;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/IBMPlexMono-Regular.woff2') format('woff2'), local('IBM Plex Mono'), local('SFMono-Regular'), local('Consolas'), local('Liberation Mono'), monospace;
  font-display: swap;
  font-weight: 400;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/IBMPlexMono-Bold.woff2') format('woff2'), local('IBM Plex Mono'), local('SFMono-Regular'), local('Consolas'), local('Liberation Mono'), monospace;
  font-display: swap;
  font-weight: 700;
}

:root {
  --ink: #1d2a39;
  --ink-soft: #53657a;
  --sidebar-bg-start: #2d3b45;
  --sidebar-bg-end: #3a4f5d;
  --sidebar-bg: var(--sidebar-bg-start);
  --sidebar-text: #edf3f7;
  --sidebar-muted: rgba(237, 243, 247, 0.8);
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: #48657a;
  --panel-bg: #f7f9fb;
  --primary: #48657a;
  --primary-strong: #3d586c;
  --blue-bright: #1a7cd6;
  --muted: #6b7b8d;
  --bg-soft: #edf3f8;
  --card-border: #e8e3db;
  --card-bg: #ffffff;
  --button-shadow: none;
  --header-footer-bg: #f5f3ee;
  --header-footer-text: #4b4b4b;
  --header-footer-secondary: #6b6b6b;
  --header-footer-link: #3d5d73;
  --header-footer-link-hover: #2d3b45;
  --focus-ring: rgba(72, 101, 122, 0.22);
  --secondary-button: #e9e5de;
  --secondary-button-hover: #ddd7cd;
  --secondary-button-text: #3f4549;
  --metric-general: #536d7f;
  --metric-receivables-overdue: #956257;
  --metric-billing: #71836e;
  --metric-collections: #6f8580;
  --metric-outstanding: #9a7c4d;
  --card-shadow: 0 4px 18px rgba(45, 59, 69, 0.08);
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

html {
  overflow-y: scroll;
}

body.modal-open {
  padding-right: 0 !important;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background: var(--bg-soft);
}

h1, h2, h3, h4, h5, h6,
.topbar-brand-text,
.sidebar .brand-title,
.page-header h1,
.card-header,
.modal-title {
  font-family: 'Space Grotesk', sans-serif;
}

.app-shell {
  min-height: 100vh;
  background: var(--bg-soft);
}

.app-shell > .d-flex {
  display: flex;
  min-height: calc(100vh - 72px);
}

nav.topbar,
.topbar.navbar-dark {
  background: var(--header-footer-bg) !important;
  border-bottom: 1px solid var(--card-border) !important;
  padding: 0 18px !important;
  min-height: 72px !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1030 !important;
}

.topbar .topbar-inner {
  min-height: 72px;
}

.topbar-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.topbar-brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.24), rgba(59, 130, 246, 0.2));
  color: #5eead4;
  font-size: 1.05rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.topbar-brand-text {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--header-footer-text);
}

.topbar .dropdown-toggle,
.topbar .btn,
.topbar button {
  border: 1px solid var(--card-border) !important;
  background: #fff !important;
  color: var(--header-footer-text) !important;
  box-shadow: none !important;
}

.topbar .dropdown-toggle:hover,
.topbar .btn:hover,
.topbar button:hover,
.topbar .dropdown-toggle:focus,
.topbar .btn:focus,
.topbar button:focus {
  background: var(--secondary-button) !important;
  border-color: var(--secondary-button-hover) !important;
  color: var(--header-footer-text) !important;
}

.topbar-brand-text,
.topbar .dropdown-toggle,
.topbar .topbar-user-name,
.topbar i,
.topbar .bi {
  color: var(--header-footer-text) !important;
  text-shadow: 0 1px 1px rgba(0,0,0,0.18);
}

aside.sidebar,
.sidebar {
  width: 250px !important;
  min-height: calc(100vh - 72px) !important;
  background: linear-gradient(180deg, var(--sidebar-bg-start), var(--sidebar-bg-end)) !important;
  color: var(--sidebar-text) !important;
  position: sticky !important;
  top: 72px !important;
  left: 0 !important;
  border-right: 1px solid rgba(148, 163, 184, 0.12) !important;
  flex-shrink: 0 !important;
  transition: width 0.2s ease, opacity 0.2s ease !important;
}

.sidebar .sidebar-header {
  padding: 0.95rem 0.8rem 1.05rem;
  margin: 0.05rem 0.05rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(59, 130, 246, 0.035));
}

.sidebar .brand-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.15rem;
  letter-spacing: -0.035em;
  font-weight: 700;
  line-height: 1.1;
  color: #edf5ff;
}

.sidebar .brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.sidebar .brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(94, 234, 212, 0.4);
  border-radius: 13px;
  background: linear-gradient(145deg, #20bfae, #1774c8);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 5px 14px rgba(20, 184, 166, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.sidebar .brand-copy {
  min-width: 0;
}

.sidebar .brand-edition {
  padding: 0.18rem 0.38rem;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 5px;
  background: rgba(20, 184, 166, 0.12);
  color: #5eead4;
  font-family: 'Inter', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.sidebar .sidebar-header small {
  display: block;
  margin-top: 0.32rem;
  color: #aebed0;
  font-size: 0.7rem;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.sidebar .sidebar-header small span {
  padding: 0 0.12rem;
  color: #5eead4;
}

.login-bg {
  position: relative;
  overflow: auto;
  padding: 2rem 1rem;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(45, 212, 191, 0.13), transparent 36%),
    radial-gradient(ellipse at 85% 85%, rgba(59, 130, 246, 0.12), transparent 38%),
    linear-gradient(135deg, #edf5f8 0%, #f7f9fc 52%, #edf3fa 100%);
}

.login-card {
  width: min(430px, 100%);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 35, 55, 0.13), 0 3px 10px rgba(15, 35, 55, 0.04);
}

.login-brand {
  margin-bottom: 1.8rem;
  text-align: center;
}

.login-brand-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(94, 234, 212, 0.55);
  border-radius: 17px;
  background: linear-gradient(145deg, #20bfae, #1774c8);
  color: #fff;
  font-size: 1.45rem;
  box-shadow: 0 8px 20px rgba(20, 137, 172, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.login-brand-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #142b3d;
  font: 700 1.75rem/1.1 'Space Grotesk', sans-serif;
  letter-spacing: -0.045em;
}

.login-brand-edition {
  padding: 0.22rem 0.42rem;
  border: 1px solid rgba(20, 184, 166, 0.25);
  border-radius: 6px;
  background: rgba(20, 184, 166, 0.1);
  color: #087e78;
  font: 700 0.62rem/1 'Inter', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-brand-tagline {
  margin: 0.45rem 0 1.55rem;
  color: #64788a;
  font-size: 0.82rem;
  letter-spacing: 0.015em;
}

.login-brand-tagline span {
  padding: 0 0.14rem;
  color: #0d9b91;
}

.login-heading {
  margin: 0;
  color: #1d2a39;
  font: 700 1.2rem/1.3 'Space Grotesk', sans-serif;
}

.sidebar nav {
  padding: 0.65rem 0.7rem 1rem;
}

.sidebar .nav-link,
.sidebar .nav-group-toggle {
  color: var(--sidebar-text);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.96rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover,
.sidebar .nav-group-toggle:hover,
.sidebar .nav-group-toggle[aria-expanded="true"] {
  background: var(--sidebar-hover);
  color: #fff;
  border-left: 2px solid var(--sidebar-active);
  padding-left: calc(0.8rem - 2px);
}

.sidebar .nav-link.active {
  background: var(--sidebar-active);
  border-left-color: transparent;
}

.sidebar .nav-submenu {
  margin-top: 0.2rem;
  padding-left: 0.7rem;
  border-left: 1px solid rgba(148, 163, 184, 0.12);
}

.sidebar .sub-nav-link {
  padding-left: 0.9rem;
}

main.main-content,
.main-content {
  flex: 1 !important;
  min-width: 0 !important;
  padding: 1.5rem 1.5rem 1.75rem !important;
  background: transparent !important;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2vw, 2.4rem);
  line-height: 1.2;
  color: var(--ink);
}

.page-header p {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
}

.card {
  border: 1px solid var(--card-border);
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--card-shadow);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--card-border);
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.stat-card {
  min-height: 150px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
}

.stat-card .card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 150px;
}

.stat-card .text-muted {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.stat-card .small.text-muted {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: normal;
  text-transform: none;
}

.dashboard-stat-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.dashboard-stat-link:hover,
.dashboard-stat-link:focus {
  color: inherit;
  text-decoration: none;
}

.dashboard-stat-link .stat-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dashboard-stat-link:hover .stat-card,
.dashboard-stat-link:focus-visible .stat-card {
  transform: translateY(-2px);
  border-color: #b8c9dc;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.stat-card .fs-4 {
  font-size: clamp(1.6rem, 2vw, 2rem) !important;
  font-weight: 700;
  color: var(--ink);
}

.stat-card .icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--metric-general);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
}

.status-posted {
  background: rgba(30, 167, 111, 0.1);
  color: #0f7f52;
}

.status-void {
  background: rgba(220, 53, 69, 0.1);
  color: #b42318;
}

.status-low {
  background: rgba(255, 184, 0, 0.12);
  color: #9a6400;
}

.table thead th {
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.table tbody td {
  color: var(--ink);
  vertical-align: middle;
}

.btn {
  border-radius: 10px;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  color: #fff;
}

.btn-secondary {
  background: var(--secondary-button);
  border-color: var(--secondary-button);
  color: var(--secondary-button-text);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active,
.btn-secondary.active {
  background: var(--secondary-button-hover);
  border-color: var(--secondary-button-hover);
  color: var(--secondary-button-text);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn:focus-visible,
.btn.focus,
.form-control:focus,
.form-select:focus,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.25rem var(--focus-ring) !important;
}

.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
  border-radius: 10px;
  border-color: var(--card-border);
  box-shadow: none;
}

.modal-content {
  border-radius: 14px;
  border-color: var(--card-border);
  overflow: hidden;
}

.modal-header {
  background: var(--header-footer-bg);
  border-bottom: 1px solid var(--card-border);
  color: var(--header-footer-text);
  padding: 0.9rem 1rem;
}

.modal-header .modal-title,
.modal-header h5 {
  color: var(--header-footer-text) !important;
}

.modal-header .btn-close {
  filter: none !important;
  opacity: 1;
}

.modal-header .btn-close:hover,
.modal-header .btn-close:focus {
  opacity: 1;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 38, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  width: 272px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 1000;
  border-right: 1px solid rgba(255,255,255,0.08);
  transition: width 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.desktop-sidebar-toggle {
  display: none;
  border: 1px solid var(--card-border);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.desktop-sidebar-toggle:hover {
  background: var(--bg-soft);
}

.sidebar .brand {
  padding: 24px 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.02);
}

.sidebar .nav-heading {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  padding: 15px 18px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.sidebar-nav {
  padding-bottom: 16px;
}

.nav-group {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.nav-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
}

.nav-toggle:hover,
.nav-group.is-active .nav-toggle {
  color: #fff;
  background: rgba(255,255,255,0.04);
}

.nav-chevron {
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.nav-toggle[aria-expanded="true"] .nav-chevron {
  transform: rotate(45deg);
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  padding: 10px 20px;
  display: block;
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar .standalone-nav-link {
  margin: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--sidebar-active);
}

.sidebar .nav-link.active {
  background: var(--sidebar-active);
  border-left-color: transparent;
}

.nav-items[hidden] {
  display: none;
}

.main {
  margin-left: 272px;
  min-height: 100vh;
  position: relative;
  transition: margin-left 0.2s ease;
  /* z-index: 0; */
}

body.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  border-right-width: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

body.sidebar-collapsed .sidebar .brand,
body.sidebar-collapsed .sidebar .nav-link,
body.sidebar-collapsed .sidebar .nav-group {
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed .main {
  margin-left: 0;
}

.topbar {
  background: #f9fbfd;
  border-bottom: 1px solid var(--card-border);
  padding: 18px 30px;
  position: sticky;
  top: 0;
  z-index: 1001;
}

.dropdown {
  position: relative;
  z-index: 3;
}

.dropdown-menu {
  z-index: 1000;
  min-width: 180px;
}

.topbar .dropdown-menu,
.topbar .dropdown-menu-dark {
  background: var(--header-footer-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 24px rgba(45, 59, 69, 0.12);
}

.topbar .dropdown-menu .dropdown-item,
.topbar .dropdown-menu-dark .dropdown-item {
  color: var(--header-footer-text) !important;
}

.topbar .dropdown-menu .dropdown-item:hover,
.topbar .dropdown-menu .dropdown-item:focus,
.topbar .dropdown-menu-dark .dropdown-item:hover,
.topbar .dropdown-menu-dark .dropdown-item:focus {
  background: var(--secondary-button);
  color: var(--header-footer-link-hover) !important;
}

.modal-backdrop {
  z-index: 1040 !important;
}

.modal {
  z-index: 1060 !important;
}

.modal-dialog {
  position: relative;
  z-index: 1061 !important;
}

.topbar h4,
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink);
}

.content {
  padding: 30px;
}

.card {
  border: 1px solid var(--card-border);
  box-shadow: none;
  border-radius: 0;
  background: var(--card-bg);
}

.kpi-card {
  padding: 18px 20px;
}

.kpi-card .value {
  font-size: 1.6rem;
  font-weight: 700;
}

.executive-overview {
  border: 1px solid var(--card-border);
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
}

.status-pill--success {
  background: rgba(21, 128, 61, 0.1);
  color: #166534;
}

.executive-metric {
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.7);
  padding: 1rem 1rem 0.9rem;
  min-height: 120px;
}

.executive-metric .label {
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
}

.executive-metric .value {
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 0.7rem;
  color: var(--ink);
}

.executive-metric .meta {
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.dashboard-panel {
  background: #fff;
}

.marketplace-summary {
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
  border: 1px solid var(--card-border);
  border-radius: 0;
  padding: 1rem;
}

.market-share-list {
  display: grid;
  gap: 0.9rem;
}

.market-share-item {
  display: grid;
  gap: 0.35rem;
}

@media (max-width: 767.98px) {
  .kpi-card {
    padding: 14px 12px;
  }

  .kpi-card .value {
    font-size: 1.3rem;
  }

  .executive-metric {
    min-height: auto;
  }

  .marketplace-chart {
    height: auto;
  }
}

.table-responsive {
  overflow-x: auto;
}

.mobile-data-card-list {
  display: none;
}

.mobile-data-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 0;
  padding: 14px 14px 10px;
  margin-bottom: 12px;
  box-shadow: none;
}

.mobile-data-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.mobile-data-card__body {
  display: grid;
  gap: 8px;
}

.mobile-data-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 8px;
}

.mobile-data-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.mobile-data-label {
  flex: 0 0 42%;
  color: var(--ink-soft);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: 'IBM Plex Mono', monospace;
}

.mobile-data-value {
  flex: 1;
  text-align: right;
  color: var(--ink);
  word-break: break-word;
}

.mobile-data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf2f7;
}

.mobile-data-actions .btn {
  flex: 1 1 auto;
}

.mobile-data-actions form {
  flex: 1 1 auto;
}

.mobile-data-actions form .btn {
  width: 100%;
}

.badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  border-radius: 0;
  padding: 0.4em 0.7em;
}

.form-control, .form-select {
  border-radius: 0;
  border-color: var(--card-border);
  background: #fff;
}

.btn {
  border-radius: 0;
  font-weight: 600;
  box-shadow: var(--button-shadow);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.btn-outline-secondary {
  border-color: var(--card-border);
  color: var(--ink);
  background: #fff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
  background: #f2f6fa;
  border-color: var(--card-border);
  color: var(--ink);
}

.table thead th {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.table tbody td {
  color: var(--ink);
  vertical-align: middle;
}

textarea {
  resize: vertical;
}

.modal-content {
  border-radius: 4px;
  border-color: var(--card-border);
}

.mobile-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--card-border);
  background: #fff;
  border-radius: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.mobile-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 25px rgba(15, 108, 189, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background 0.2s ease;
  z-index: 1200;
}

.back-to-top:hover,
.back-to-top:focus {
  background: var(--primary-strong);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 1199.98px) {
  .sidebar {
    width: 230px;
  }

  .main {
    margin-left: 230px;
  }
}

@media (min-width: 992px) {
  .desktop-sidebar-toggle {
    display: inline-flex;
  }
}

@media (max-width: 991.98px) {
  #mobileSidebar.offcanvas {
    top: 72px !important;
    bottom: 0 !important;
    height: auto !important;
    max-height: none !important;
    z-index: 1045 !important;
    background: #0f1d2d !important;
    border-right: 1px solid rgba(148, 163, 184, 0.16) !important;
  }

  #mobileSidebar .offcanvas-header {
    min-height: 62px;
    padding: 0.9rem 1rem;
    background: #0b1625;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  #mobileSidebar .offcanvas-title {
    color: #fff;
    font: 700 1rem 'Space Grotesk', sans-serif;
  }

  #mobileSidebar .offcanvas-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.9;
  }

  #mobileSidebar .offcanvas-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
    background: #0f1d2d;
    overscroll-behavior: contain;
  }

  #mobileSidebar .sidebar {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100% !important;
    height: max-content !important;
    min-height: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    flex: 1 0 auto !important;
    background: linear-gradient(180deg, #0f1d2d 0%, #0c1827 100%) !important;
  }

  #mobileSidebar .sidebar .sidebar-header {
    display: none;
  }

  #mobileSidebar .sidebar nav {
    display: block;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .sidebar {
    width: min(80vw, 300px);
    top: 72px;
    bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 16px 0 30px rgba(11, 20, 38, 0.28);
    z-index: 1100;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .content {
    padding: 18px 16px 30px;
  }

  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.65rem 0.75rem !important;
    z-index: 1001;
  }

  .topbar .topbar-inner {
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    gap: 0.5rem;
  }

  .topbar .topbar-brand-group {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar .topbar-brand-text {
    max-width: 30vw;
    font-size: 0.95rem;
  }

  .topbar .topbar-user-menu {
    flex: 0 1 auto;
    min-width: 0;
  }

  .topbar .topbar-user-button {
    max-width: 39vw;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
  }

  .main {
    padding-top: 74px;
  }

  .topbar h4 {
    font-size: 1.4rem;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .desktop-sidebar-toggle {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .mobile-filter-toggle {
    display: block;
  }

  .mobile-filter-form:not(.is-expanded) {
    display: none !important;
  }

  .topbar {
    gap: 12px;
    align-items: center;
  }

  .topbar > .d-flex:last-child {
    margin-left: auto;
  }

  .content {
    padding: 14px 12px 24px;
  }

  .card {
    overflow: hidden;
  }

  .table-responsive {
    margin: 0 -2px;
  }

  .table-responsive:has(.mobile-data-card-list) table {
    display: none !important;
  }

  .mobile-data-card-list {
    display: block;
  }
}

@media (min-width: 768px) {
  .mobile-filter-toggle {
    display: none;
  }
}

@media (min-width: 768px) {
  .mobile-data-card-list {
    display: none !important;
  }
}

.row-gap {
  row-gap: 16px;
}

.inline-actions a, .inline-actions button {
  margin-right: 8px;
}

.order-item-card {
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--blue-bright);
  border-radius: 4px;
  padding: 14px;
  margin-bottom: 10px;
  background: #f8fafc;
}

.order-items-scroll {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 8px;
}

.order-item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.sidebar .brand-copy small,
.sidebar-header small {
  color: var(--sidebar-muted) !important;
}

.btn-outline-secondary {
  background: var(--secondary-button);
  border-color: var(--secondary-button-hover);
  color: var(--secondary-button-text);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-outline-secondary.active {
  background: var(--secondary-button-hover);
  border-color: var(--secondary-button-hover);
  color: var(--secondary-button-text);
}

.app-footer {
  background: var(--header-footer-bg) !important;
  color: var(--header-footer-text) !important;
  border-top: 1px solid var(--card-border);
  box-shadow: none;
}

.app-footer small,
.app-footer hr {
  color: var(--header-footer-secondary);
  border-color: var(--card-border);
}

.app-footer a {
  color: var(--header-footer-link) !important;
}

.app-footer a:hover,
.app-footer a:focus {
  color: var(--header-footer-link-hover) !important;
}

.stat-card {
  border-color: var(--card-border);
  box-shadow: var(--card-shadow);
}

.stat-card.metric-receivable,
.stat-card.metric-overdue,
.dashboard-stat-link:nth-child(1) .stat-card.metric-receivable,
.dashboard-stat-link:nth-child(1) .stat-card.metric-overdue {
  --metric-accent: var(--metric-receivables-overdue);
}

.stat-card.metric-billing {
  --metric-accent: var(--metric-billing);
}

.stat-card.metric-collection,
.stat-card.metric-collections {
  --metric-accent: var(--metric-collections);
}

.stat-card.metric-outstanding {
  --metric-accent: var(--metric-outstanding);
}

.stat-card .icon-wrap {
  background: var(--metric-accent, var(--metric-general));
}

.card {
  box-shadow: var(--card-shadow);
}

aside.sidebar,
.sidebar,
#mobileSidebar .sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg-start), var(--sidebar-bg-end)) !important;
}
