:root {
  --app-sidebar: #0a1d3a;
  --app-sidebar-muted: #94a3b8;
  --app-sidebar-active: #1e40af;
  --app-bg: #f6f8fb;
  --app-border: #e2e8f0;
  --app-text: #111827;
  --app-muted: #64748b;
  --app-accent: #2563eb;
  --app-accent-dark: #1d4ed8;
  --app-accent-emerald: #00c896;
  --app-sidebar-width: 292px;
  --app-sidebar-collapsed-width: 76px;
  --app-topbar-height: 72px;
  --app-surface: #ffffff;
  --app-surface-muted: #f8fafc;
  --app-input-bg: #ffffff;
  --app-table-stripe: #f8fafc;
  --app-shadow: rgba(15, 23, 42, 0.06);
}

[data-bs-theme="dark"] {
  --app-bg: #0b1120;
  --app-border: #334155;
  --app-text: #e5e7eb;
  --app-muted: #94a3b8;
  --app-accent: #60a5fa;
  --app-accent-dark: #3b82f6;
  --app-sidebar: #070d19;
  --app-sidebar-muted: #94a3b8;
  --app-surface: #111827;
  --app-surface-muted: #182235;
  --app-input-bg: #0f172a;
  --app-table-stripe: #152033;
  --app-shadow: rgba(0, 0, 0, 0.28);
}

html {
  font-size: 14px;
  min-height: 100%;
  position: relative;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  background: var(--app-bg);
  color: var(--app-text);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

.topbar-command{align-items:center;background:var(--app-surface-muted);border:1px solid var(--app-border);border-radius:9px;color:var(--app-muted);display:flex;font-size:.75rem;gap:.55rem;min-width:210px;padding:.45rem .6rem;text-align:left}.topbar-command span:nth-child(2){flex:1}.topbar-command kbd{background:var(--app-surface);border:1px solid var(--app-border);box-shadow:none;color:var(--app-muted);font-size:.62rem}
.command-palette{background:transparent;border:0;height:100%;margin:0;max-height:none;max-width:none;padding:9vh 1rem 1rem;width:100%}.command-palette::backdrop{background:rgba(2,6,23,.68);backdrop-filter:blur(4px)}.command-palette-box{background:var(--app-surface);border:1px solid var(--app-border);border-radius:16px;box-shadow:0 28px 80px rgba(0,0,0,.3);display:flex;flex-direction:column;margin:0 auto;max-height:72vh;max-width:680px;overflow:hidden}.command-search-row{align-items:center;border-bottom:1px solid var(--app-border);display:flex;font-size:1.2rem;gap:.7rem;padding:.85rem 1rem}.command-search-row input{background:transparent;border:0;color:var(--app-text);flex:1;font-size:1rem;outline:0}.command-search-row input::placeholder{color:var(--app-muted)}.command-search-row kbd,.command-palette footer kbd{background:var(--app-surface-muted);border:1px solid var(--app-border);box-shadow:none;color:var(--app-muted);font-size:.62rem}.command-results{overflow:auto;padding:.45rem}.command-group>span{color:var(--app-muted);display:block;font-size:.62rem;font-weight:800;letter-spacing:.1em;padding:.65rem .65rem .35rem;text-transform:uppercase}.command-group a{align-items:center;border-radius:9px;color:var(--app-text);display:flex;gap:.7rem;padding:.55rem .65rem;text-decoration:none}.command-group a:hover,.command-group a.active{background:color-mix(in srgb,var(--app-accent) 9%,transparent)}.command-group i{align-items:center;background:var(--app-surface-muted);border:1px solid var(--app-border);border-radius:8px;color:var(--app-accent);display:flex;font-size:.72rem;font-style:normal;font-weight:800;height:32px;justify-content:center;width:32px}.command-group strong{font-size:.82rem}.command-group small{color:var(--app-muted);font-size:.7rem;margin-left:auto}.command-empty{color:var(--app-muted);padding:2.5rem;text-align:center}.command-palette footer{border-top:1px solid var(--app-border);color:var(--app-muted);display:flex;font-size:.65rem;gap:1rem;padding:.55rem 1rem}.command-palette footer span:last-child{margin-left:auto}
@media(max-width:900px){.topbar-command span:nth-child(2),.topbar-command kbd{display:none}.topbar-command{min-width:0}.command-palette{padding-top:3vh}.command-palette-box{max-height:88vh}.command-palette footer span:last-child{display:none}}

a {
  color: var(--app-accent);
}

.btn-primary {
  --bs-btn-bg: var(--app-accent);
  --bs-btn-border-color: var(--app-accent);
  --bs-btn-hover-bg: var(--app-accent-dark);
  --bs-btn-hover-border-color: var(--app-accent-dark);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #ffffff, 0 0 0 0.25rem rgba(37, 99, 235, 0.32);
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  background: var(--app-sidebar);
  bottom: 0;
  box-shadow: 6px 0 24px rgba(15, 23, 42, 0.16);
  color: #ffffff;
  flex-direction: column;
  left: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: fixed;
  scrollbar-color: rgba(148, 163, 184, 0.42) transparent;
  scrollbar-width: thin;
  top: 0;
  width: var(--app-sidebar-width);
  z-index: 1020;
}

.sidebar-brand {
  align-items: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  min-height: var(--app-topbar-height);
  padding: 0 1.25rem;
  gap: 0.5rem;
  overflow: visible;
  position: relative;
}

.sidebar-mode-toggle {
  align-items: center;
  background: rgba(148, 163, 184, 0.12);
  border: 0;
  border-radius: 7px;
  color: #e2e8f0;
  display: inline-flex;
  flex: 0 0 30px;
  height: 30px;
  justify-content: center;
  margin-left: auto;
  position: relative;
  z-index: 3;
}

.sidebar-mode-toggle:hover,
.sidebar-mode-toggle:focus-visible {
  background: rgba(96, 165, 250, 0.24);
  color: #fff;
  outline: 2px solid rgba(96, 165, 250, 0.65);
  outline-offset: 2px;
}

.sidebar-toggle-icon {
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  display: block;
  height: 8px;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  width: 8px;
}

.brand-link {
  align-items: center;
  color: #ffffff;
  display: inline-flex;
  font-weight: 700;
  gap: 0.75rem;
  min-width: 0;
  text-decoration: none;
}

.brand-link:hover {
  color: #ffffff;
}

.brand-mark {
  align-items: center;
  background: #ffffff;
  border-radius: 8px;
  color: var(--app-sidebar);
  display: inline-flex;
  flex: 0 0 38px;
  font-size: 0.9rem;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.brand-mark img {
  height: 100%;
  object-fit: contain;
  padding: 5px;
  width: 100%;
}

.sidebar-nav {
  padding: 0.75rem;
}

.nav-section + .nav-section {
  margin-top: 0.25rem;
}

.nav-dashboard {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  margin-bottom: 0.45rem;
  padding-bottom: 0.55rem;
}

.nav-heading {
  color: var(--app-sidebar-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 0.45rem;
  padding: 0 0.75rem;
  text-transform: uppercase;
}

.nav-subheading {
  margin-top: 0.8rem;
}

.sidebar-nav .nav-link {
  align-items: center;
  border-radius: 8px;
  color: #cbd5e1;
  display: flex;
  font-size: 0.93rem;
  font-weight: 500;
  gap: 0.65rem;
  min-height: 40px;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  text-decoration: none;
}

.nav-link-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: rgba(37, 99, 235, 0.18);
  color: #ffffff;
}

.sidebar-nav .nav-link.active {
  box-shadow: inset 3px 0 0 #60a5fa;
}

.sidebar-nav .nav-sublink {
  margin-left: 0.75rem;
}

.nav-icon {
  align-items: center;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  color: #e2e8f0;
  display: inline-flex;
  flex: 0 0 30px;
  font-size: 0.66rem;
  font-weight: 700;
  height: 26px;
  justify-content: center;
  letter-spacing: 0.01em;
  padding: 0 0.15rem;
  width: 30px;
}

.sidebar-svg-icon {
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
  width: 17px;
}

.app-sidebar::-webkit-scrollbar,
.app-mobile-sidebar .offcanvas-body::-webkit-scrollbar {
  width: 8px;
}

.app-sidebar::-webkit-scrollbar-thumb,
.app-mobile-sidebar .offcanvas-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.app-main {
  min-height: 100vh;
}

@media (min-width: 992px) {
  .app-main {
    margin-left: var(--app-sidebar-width);
    transition: margin-left 0.2s ease;
  }
}

@media (min-width: 992px) {
  .app-sidebar {
    transition: width 0.2s ease;
  }

  .sidebar-icon-only .app-sidebar {
    overflow-x: visible;
    width: var(--app-sidebar-collapsed-width);
  }

  .sidebar-icon-only .app-main {
    margin-left: var(--app-sidebar-collapsed-width);
  }

  .app-main {
    max-width: calc(100vw - var(--app-sidebar-width));
    width: calc(100% - var(--app-sidebar-width));
  }

  .sidebar-icon-only .app-main {
    max-width: calc(100vw - var(--app-sidebar-collapsed-width));
    width: calc(100% - var(--app-sidebar-collapsed-width));
  }

  .app-content,
  .app-content > * {
    min-width: 0;
  }
}

.app-topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--app-border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: var(--app-topbar-height);
  padding: 0.85rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1010;
}

.app-topnav {
  align-items: center;
  background: var(--app-sidebar);
  display: none;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.6rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1015;
}

.app-topnav .nav-section {
  display: contents;
}

.app-topnav .nav-link {
  align-items: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  text-decoration: none;
  white-space: nowrap;
}

.app-topnav .nav-link:hover,
.app-topnav .nav-link.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

body.nav-layout-topbar .app-sidebar {
  display: none !important;
}

@media (min-width: 992px) {
  body.nav-layout-sidebar .app-topnav {
    display: none !important;
  }

  body.nav-layout-topbar .app-topnav {
    display: flex;
  }

  body.nav-layout-topbar .app-main {
    margin-left: 0;
    max-width: 100vw;
    width: 100%;
  }
}

.theme-toggle {
  align-items: center;
  display: inline-flex;
  gap: 0.4rem;
}

.connection-status {
  align-items: center;
  color: var(--app-muted);
  display: inline-flex;
  font-size: 0.78rem;
  gap: 0.35rem;
}

.connection-status::before {
  background: #22c55e;
  border-radius: 50%;
  content: "";
  height: 0.5rem;
  width: 0.5rem;
}

.connection-status.is-offline {
  color: #dc2626;
}

.connection-status.is-offline::before {
  background: #ef4444;
}

.app-update-notice {
  align-items: center;
  background: #1d4ed8;
  bottom: 1rem;
  border-radius: 10px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.3);
  color: #fff;
  display: flex;
  gap: 0.75rem;
  left: 50%;
  max-width: calc(100vw - 2rem);
  padding: 0.7rem 0.85rem;
  position: fixed;
  transform: translateX(-50%);
  z-index: 1090;
}

.app-update-notice[hidden] {
  display: none;
}

@media (min-width: 768px) {
  .app-topbar {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.app-topbar .navbar-toggler-icon {
  background-image: var(--bs-navbar-toggler-icon-bg);
  height: 1.1em;
  width: 1.1em;
}

.topbar-title {
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.topbar-subtitle {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.topbar-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 0.65rem;
  min-width: 0;
}

.user-menu {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  min-width: 0;
}

.user-email {
  color: var(--app-muted);
  font-size: 0.86rem;
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .user-menu > .btn-primary,
  .user-email {
    display: none;
  }
}

.app-content {
  padding: 1rem;
}

@media (min-width: 768px) {
  .app-content {
    padding: 1.5rem;
  }
}

@media (min-width: 1400px) {
  .app-content {
    padding: 2rem;
  }
}

.app-mobile-sidebar {
  --bs-offcanvas-width: min(88vw, 320px);
  background: var(--app-sidebar);
  color: #ffffff;
}

.sidebar-icon-only .app-sidebar .brand-label,
.sidebar-icon-only .app-sidebar .nav-link-label,
.sidebar-icon-only .app-mobile-sidebar .brand-link span:last-child,
.sidebar-icon-only .app-mobile-sidebar .nav-link-label {
  display: none;
}

.sidebar-icon-only .app-sidebar .sidebar-brand,
.sidebar-icon-only .app-sidebar .sidebar-nav,
.sidebar-icon-only .app-mobile-sidebar .sidebar-nav {
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.sidebar-icon-only .app-sidebar .nav-link,
.sidebar-icon-only .app-mobile-sidebar .nav-link {
  justify-content: center;
  margin-left: 0;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.sidebar-icon-only .app-sidebar .sidebar-brand {
  justify-content: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.sidebar-icon-only .app-sidebar .brand-link {
  justify-content: center;
}

.sidebar-icon-only .app-sidebar .sidebar-mode-toggle {
  background: #2563eb;
  border: 2px solid var(--app-sidebar);
  border-radius: 50%;
  height: 30px;
  margin: 0;
  position: absolute;
  right: 4px;
  top: 44px;
  width: 30px;
}

.sidebar-icon-only .sidebar-toggle-icon {
  transform: rotate(225deg);
}

.sidebar-icon-only .app-sidebar [data-sidebar-label],
.sidebar-icon-only .app-mobile-sidebar [data-sidebar-label] {
  position: relative;
}

.sidebar-icon-only .app-sidebar [data-sidebar-label]::after,
.sidebar-icon-only .app-mobile-sidebar [data-sidebar-label]::after {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f8fafc;
  content: attr(data-sidebar-label);
  font-size: 0.78rem;
  font-weight: 600;
  left: calc(100% + 10px);
  letter-spacing: normal;
  opacity: 0;
  padding: 0.4rem 0.55rem;
  pointer-events: none;
  position: absolute;
  text-transform: none;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  visibility: hidden;
  white-space: nowrap;
  z-index: 1080;
}

.sidebar-icon-only .app-sidebar [data-sidebar-label]:hover::after,
.sidebar-icon-only .app-sidebar [data-sidebar-label]:focus-visible::after,
.sidebar-icon-only .app-mobile-sidebar [data-sidebar-label]:hover::after,
.sidebar-icon-only .app-mobile-sidebar [data-sidebar-label]:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  visibility: visible;
}

.sidebar-icon-only .app-sidebar .nav-link.active {
  background: rgba(37, 99, 235, 0.34);
  box-shadow: inset 3px 0 0 #60a5fa;
}

.sidebar-icon-only .app-mobile-sidebar {
  --bs-offcanvas-width: 84px;
}

.sidebar-icon-only .app-mobile-sidebar .offcanvas-header {
  padding-left: 0.55rem;
  padding-right: 0.35rem;
}

.sidebar-icon-only .app-mobile-sidebar .btn-close {
  display: block;
}

@media (max-width: 991.98px) {
  .app-main,
  .sidebar-icon-only .app-main {
    margin-left: 0;
    max-width: 100vw;
    width: 100%;
  }

  .app-content {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .table-responsive {
    max-width: 100%;
  }
}

.app-mobile-sidebar .offcanvas-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  min-height: var(--app-topbar-height);
}

.app-mobile-sidebar .offcanvas-body {
  padding: 0;
}

.dashboard-hero {
  align-items: stretch;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 12px 30px var(--app-shadow);
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
}

@media (min-width: 992px) {
  .dashboard-hero {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) 320px;
    padding: 1.75rem;
  }
}

.dashboard-hero h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  margin: 0 0 0.65rem;
}

.dashboard-lead {
  color: var(--app-muted);
  margin: 0;
  max-width: 760px;
}

.eyebrow,
.card-kicker {
  color: var(--app-accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.organization-chip {
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  justify-content: center;
  min-width: 0;
  padding: 1rem;
}

.organization-chip strong {
  overflow-wrap: anywhere;
}

.chip-label {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.dashboard-card,
.metric-card,
.roadmap-card {
  background: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 10px 24px var(--app-shadow);
}

.next-steps-card {
  border-color: color-mix(in srgb, var(--app-accent) 30%, var(--app-border));
  border-width: 1.5px;
}

.next-steps-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.next-step-action-form {
  display: contents;
}

.next-step-action {
  align-items: center;
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  color: var(--app-text);
  display: flex;
  flex: 1 1 220px;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  text-align: left;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

button.next-step-action {
  cursor: pointer;
  font: inherit;
  width: 100%;
}

.next-step-action:hover,
.next-step-action:focus-visible {
  border-color: var(--app-accent);
  box-shadow: 0 8px 20px var(--app-shadow);
  color: var(--app-text);
  transform: translateY(-1px);
}

.next-step-icon {
  align-items: center;
  background: color-mix(in srgb, var(--app-accent) 12%, transparent);
  border-radius: 8px;
  color: var(--app-accent);
  display: flex;
  flex: 0 0 auto;
  font-size: 1.05rem;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.next-step-action strong {
  display: block;
  font-size: 0.86rem;
}

.next-step-action small {
  color: var(--app-muted);
  display: block;
}

.doc-actions {
  align-items: stretch;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  box-shadow: 0 6px 16px var(--app-shadow);
  display: inline-flex;
  overflow: hidden;
}

.doc-action {
  align-items: center;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--app-border);
  color: var(--app-text);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 0.5rem;
  padding: 0 1rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.doc-action:first-child {
  border-left: 0;
}

.doc-action:hover,
.doc-action:focus-visible {
  background: var(--app-surface-muted);
  color: var(--app-accent);
}

.doc-action-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.doc-action.primary {
  background: var(--app-accent);
  color: #fff;
}

.doc-action.primary:hover,
.doc-action.primary:focus-visible {
  background: var(--app-accent-dark);
  color: #fff;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.quick-actions .btn {
  white-space: normal;
}

.dashboard-metric-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.dashboard-action-list .list-group-item {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.dashboard-action-list strong {
  align-items: center;
  background: #eff6ff;
  border-radius: 999px;
  color: var(--app-accent);
  display: inline-flex;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.55rem;
}

.quick-action-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

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

.dashboard-recent-activity {
  clear: both;
  padding-top: 0.25rem;
}

.dashboard-section-header {
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.dashboard-header-action {
  flex: 0 0 auto;
  position: static;
}

@media (max-width: 575.98px) {
  .dashboard-section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-header-action {
    align-self: flex-start;
  }

  .theme-toggle-label,
  .connection-status {
    display: none;
  }
}

[data-bs-theme="dark"] .app-topbar,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .list-group-item,
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer {
  background-color: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-text);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
  background-color: var(--app-input-bg);
  border-color: var(--app-border);
  color: var(--app-text);
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: #64748b;
}

[data-bs-theme="dark"] .table {
  --bs-table-bg: var(--app-surface);
  --bs-table-color: var(--app-text);
  --bs-table-border-color: var(--app-border);
  --bs-table-striped-bg: var(--app-table-stripe);
  --bs-table-hover-bg: #1e293b;
  --bs-table-hover-color: #f8fafc;
}

[data-bs-theme="dark"] .text-muted {
  color: var(--app-muted) !important;
}

[data-bs-theme="dark"] .btn-outline-secondary {
  --bs-btn-color: #cbd5e1;
  --bs-btn-border-color: #64748b;
  --bs-btn-hover-bg: #334155;
  --bs-btn-hover-border-color: #94a3b8;
}

[data-bs-theme="dark"] .alert {
  border-color: color-mix(in srgb, currentColor 35%, transparent);
}

[data-bs-theme="dark"] .dropdown-item {
  color: var(--app-text);
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
  background: #1e293b;
  color: #fff;
}

/* Keep Bootstrap and feature-specific content surfaces coherent in dark mode. */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card-body,
[data-bs-theme="dark"] .dashboard-hero,
[data-bs-theme="dark"] .organization-chip,
[data-bs-theme="dark"] .metric-card,
[data-bs-theme="dark"] .roadmap-card,
[data-bs-theme="dark"] .financial-statement-card,
[data-bs-theme="dark"] .ledger-summary-card,
[data-bs-theme="dark"] .trial-balance-summary-card,
[data-bs-theme="dark"] .profit-loss-summary-card,
[data-bs-theme="dark"] .balance-sheet-summary-card,
[data-bs-theme="dark"] .cash-flow-summary-card,
[data-bs-theme="dark"] .journal-register-summary-card,
[data-bs-theme="dark"] .finance-widget-card {
  background-color: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-text);
}

[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .list-group,
[data-bs-theme="dark"] .accordion-item,
[data-bs-theme="dark"] .accordion-button,
[data-bs-theme="dark"] .pagination .page-link,
[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  background-color: var(--app-surface-muted) !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-control[readonly],
[data-bs-theme="dark"] .form-select:disabled {
  background-color: #172033;
  color: #cbd5e1;
  opacity: 1;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom {
  border-color: var(--app-border) !important;
}

[data-bs-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(180%);
}

[data-bs-theme="dark"] .badge.text-bg-light {
  background-color: #243147 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .dashboard-action-list strong,
[data-bs-theme="dark"] .period-rule-list span,
[data-bs-theme="dark"] .metric-hint,
[data-bs-theme="dark"] .period-activity,
[data-bs-theme="dark"] .report-section,
[data-bs-theme="dark"] .report-summary,
[data-bs-theme="dark"] .empty-state-mark {
  background-color: var(--app-surface-muted);
  border-color: var(--app-border);
  color: var(--app-text);
}

.pos-shell { min-height:100vh; overflow-x:hidden; overflow-y:auto; }
.pos-topbar {align-items:center;background:var(--app-sidebar);color:#fff;display:flex;gap:1rem;height:52px;justify-content:space-between;padding:.35rem .8rem;position:fixed;top:0;left:0;right:0;z-index:1020}
.pos-topbar nav{align-items:center;display:flex;gap:.18rem;min-width:0;overflow-x:auto;white-space:nowrap}.pos-topbar nav a,.pos-topbar nav button{align-items:center;background:transparent;border:1px solid transparent;border-radius:6px;color:#dbe4f0;display:inline-flex;font-size:.7rem;font-weight:750;gap:.4rem;padding:.34rem .48rem;text-decoration:none}
.pos-nav-icon{display:inline-flex;flex:0 0 auto}.pos-nav-icon svg{height:14px;width:14px}.pos-topbar nav a:hover,.pos-topbar nav a:focus-visible,.pos-topbar nav button:hover,.pos-topbar nav button:focus-visible{background:#ffffff12;border-color:#ffffff35;color:#fff;outline:2px solid #ffffff55}.pos-topbar nav form{margin:0}.pos-topbar nav .pos-erp-link{background:#fff;color:#172033}.pos-topbar nav .pos-logout{background:#b91c1c;color:#fff}.pos-topbar .brand-link{font-size:.78rem;white-space:nowrap}
.pos-content {box-sizing:border-box;margin:0 auto;max-width:1900px;min-height:100vh;overflow:visible;padding:calc(52px + .45rem) .65rem 1.25rem}
.pos-terminal-page{overflow:hidden}.pos-terminal-page .pos-content{height:100vh;min-height:0;overflow:hidden;padding-bottom:.55rem}
.pos-document-page .table-responsive{max-height:none;overflow-x:auto;overflow-y:visible}
.pos-document-page .pos-cash-control{height:auto;overflow:visible}.pos-document-page .pos-cash-control .table-responsive{max-height:none}
.pos-workspace{display:grid;gap:.55rem;grid-template-rows:auto minmax(0,1fr);height:100%;min-height:0}
.pos-workspace-top{align-items:center;background:var(--app-surface);border:1px solid var(--app-border);border-radius:8px;display:grid;gap:.5rem;grid-template-columns:minmax(0,1fr) auto auto;min-height:42px;padding:.35rem .55rem}.pos-workspace-top h1{font-size:.92rem;line-height:1.1;margin:0}
.pos-status-strip,.pos-quick-actions{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem}
.pos-status-pill{background:var(--app-surface-muted);border:1px solid var(--app-border);border-radius:999px;color:var(--app-muted);font-size:.66rem;font-weight:750;padding:.25rem .45rem}
.pos-status-pill.is-open{background:#dcfce7;color:#166534}.pos-status-pill.is-closed{background:#fee2e2;color:#991b1b}
.pos-workspace > form{display:grid;gap:.55rem;grid-template-areas:"modes" "main";grid-template-rows:auto minmax(0,1fr);height:100%;min-height:0;overflow:hidden}
.pos-mode-tabs{display:flex;flex-wrap:wrap;gap:.2rem;min-height:0}
.pos-mode-tab{background:var(--app-surface);border:1px solid var(--app-border);border-radius:6px;color:var(--app-text);font-size:.68rem;font-weight:750;padding:.32rem .52rem;text-decoration:none}
.pos-mode-tab span{color:var(--app-muted);font-size:.75rem}.pos-mode-tab.active{background:#111827;border-color:#111827;color:#fff}.pos-mode-link{display:inline-flex;align-items:center}
.pos-mode-tabs{grid-area:modes}
.pos-panel-title{align-items:center;color:var(--app-text);display:flex;font-weight:850;gap:.6rem;justify-content:space-between}.pos-panel-title small{color:var(--app-muted);font-size:.76rem;font-weight:650}
.pos-layout{align-items:stretch;display:grid;gap:.65rem;grid-template-columns:minmax(300px,35%) minmax(410px,40%) minmax(300px,25%);height:100%;min-height:0;overflow:hidden}
.pos-layout{grid-area:main}
.pos-browse-panel{align-content:start;display:grid;gap:.45rem;grid-template-rows:auto auto auto minmax(0,1fr);min-height:0;min-width:0;overflow:hidden}
.pos-search-row{align-items:center;display:grid;gap:.45rem;grid-template-columns:1fr;min-height:0}
.pos-tax-toggle{background:var(--app-surface);border:1px solid var(--app-border);border-radius:8px;padding:.55rem .75rem .55rem 2.6rem;white-space:nowrap}
.pos-category-panel{background:var(--app-surface);border:1px solid var(--app-border);border-radius:8px;padding:.45rem}
.pos-category-toggle{background:transparent;border:0;color:var(--app-text);font-weight:850;padding:.35rem .45rem;text-align:left;width:100%}
.pos-category-filters{display:flex;flex-wrap:wrap;gap:.35rem;max-height:64px;overflow:auto;padding:.25rem .3rem .35rem}
.pos-category-filter{background:var(--app-surface-muted);border:1px solid var(--app-border);border-radius:999px;color:var(--app-text);font-size:.8rem;font-weight:750;padding:.38rem .65rem}
.pos-category-filter.active{background:#111827;border-color:#111827;color:#fff}
.pos-customer-widget{background:#eff6ff;border:1px solid #bfdbfe;border-radius:8px;color:#1e3a8a;display:flex;flex-wrap:wrap;gap:.75rem;padding:.55rem .7rem}
.pos-customer-widget span{font-weight:700}
.pos-item-grid{align-content:start;align-items:start;display:grid;gap:.45rem;grid-auto-rows:124px;grid-template-columns:repeat(auto-fill,minmax(138px,1fr));min-height:0;overflow:auto;padding-right:.25rem}
.pos-empty-products{align-items:center;background:var(--app-surface);border:1px dashed var(--app-border);border-radius:8px;color:var(--app-muted);display:flex;grid-column:1/-1;justify-content:center;min-height:160px;padding:1rem;text-align:center}
.pos-item-button{background:var(--app-surface);border:1px solid var(--app-border);border-radius:8px;color:var(--app-text);display:flex;flex-direction:column;gap:.12rem;height:124px;max-height:124px;min-height:0;overflow:hidden;padding:.55rem;text-align:left}
.pos-item-button:hover,.pos-item-button:focus{border-color:var(--app-accent);box-shadow:0 0 0 2px rgba(37,99,235,.15);outline:0}
.pos-card-title{display:-webkit-box;font-weight:850;line-height:1.18;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pos-card-code,.pos-card-meta,.pos-card-stock,.pos-card-cost,.pos-card-category{color:var(--app-muted);font-size:.76rem;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pos-card-category{color:#1d4ed8}.pos-card-cost{color:#7c2d12}
.pos-item-button b{color:var(--app-accent);font-size:1.12rem;margin-top:auto}
.pos-cart-card{background:var(--app-surface);border:1px solid var(--app-border);border-radius:8px;box-shadow:0 10px 24px var(--app-shadow);display:grid;grid-template-rows:auto minmax(0,1fr);height:100%;min-height:0;overflow:hidden;position:relative;top:auto}
.pos-cart-header{align-items:center;border-bottom:1px solid var(--app-border);display:flex;justify-content:space-between;min-height:44px;padding:.62rem .8rem}.pos-cart-header span{color:var(--app-muted);font-size:.82rem;font-weight:750}
.pos-cart-lines{min-height:0;overflow:auto}.pos-cart-table{font-size:.88rem}.pos-cart-table th{background:var(--app-surface);color:var(--app-muted);font-size:.68rem;position:sticky;text-transform:uppercase;top:0;white-space:nowrap;z-index:1}.pos-cart-table td{vertical-align:middle}.pos-cart-table td:first-child{min-width:150px}.pos-cart-table td:first-child span{color:var(--app-muted);display:block;font-size:.72rem}.pos-cart-table input{min-width:64px}
.pos-checkout-panel{background:var(--app-surface);border:1px solid var(--app-border);border-radius:8px;box-shadow:0 10px 24px var(--app-shadow);display:grid;grid-template-rows:minmax(0,1fr) auto;height:100%;min-height:0;overflow:hidden}
.pos-checkout-panel.is-document-mode .pos-checkout-scroll{grid-template-rows:auto minmax(0,1fr)}
.pos-checkout-scroll{display:grid;gap:.55rem;grid-auto-rows:max-content;min-height:0;overflow:auto;padding:.7rem}
.pos-checkout-section{background:var(--app-surface-muted);border:1px solid var(--app-border);border-radius:8px;display:grid;gap:.5rem;padding:.6rem}
.pos-payment-lines{background:var(--app-surface-muted);border:1px solid var(--app-border);border-radius:8px;padding:.6rem}
.pos-payment-line{display:grid;gap:.35rem;grid-template-columns:minmax(0,1fr) minmax(104px,42%) 32px}.pos-payment-line+.pos-payment-line{margin-top:.4rem}
.pos-action-footer{background:var(--app-surface);border-top:1px solid var(--app-border);padding:.65rem .85rem .75rem;z-index:2}
.pos-totals{background:var(--app-surface);display:grid;gap:.16rem}.pos-totals>div{align-items:center;display:flex;justify-content:space-between}.pos-totals span{color:var(--app-muted);font-size:.75rem;font-weight:800;text-transform:uppercase}.pos-totals strong{font-size:.96rem;font-variant-numeric:tabular-nums}.pos-totals .grand{border-top:2px solid var(--app-border);font-size:1.18rem;margin-top:.2rem;padding-top:.35rem}.pos-totals .grand strong{font-size:1.35rem}
[data-bs-theme="dark"] .pos-customer-widget{background:#10213f;border-color:#1e3a8a;color:#bfdbfe}
[data-bs-theme="dark"] .pos-category-filter.active,[data-bs-theme="dark"] .pos-mode-tab.active{background:#e5e7eb;border-color:#e5e7eb;color:#111827}
[data-bs-theme="dark"] .pos-card-category{color:#93c5fd}
.pos-profile-retail .pos-layout{grid-template-columns:minmax(300px,34%) minmax(420px,41%) minmax(300px,25%)}
.pos-profile-retail .pos-item-grid{grid-auto-rows:118px;grid-template-columns:repeat(auto-fill,minmax(132px,1fr))}
.pos-profile-retail .pos-item-button{height:118px;max-height:118px}
.pos-profile-retail .pos-card-meta,.pos-profile-retail .pos-card-category,.pos-profile-retail .pos-card-cost{display:none}
.pos-profile-hardware .pos-layout{grid-template-columns:minmax(320px,36%) minmax(430px,39%) minmax(300px,25%)}
.pos-profile-hardware .pos-item-grid{grid-auto-rows:142px;grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}
.pos-profile-hardware .pos-item-button{height:142px;max-height:142px}
.pos-profile-wholesale .pos-layout{grid-template-columns:minmax(280px,30%) minmax(470px,45%) minmax(300px,25%)}
.pos-profile-wholesale .pos-cart-card{min-width:0}
.pos-profile-wholesale .pos-cart-lines{min-height:0}
.pos-profile-wholesale .pos-item-grid{grid-auto-rows:124px;grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
.pos-profile-wholesale .pos-item-button{height:124px;max-height:124px}
@media(max-width:1199.98px){.pos-shell{overflow:auto}.pos-content{height:auto;overflow:auto}.pos-workspace{height:auto}.pos-workspace > form{grid-template-areas:"modes" "main";grid-template-columns:1fr;height:auto;overflow:visible}.pos-layout,.pos-profile-retail .pos-layout,.pos-profile-hardware .pos-layout,.pos-profile-wholesale .pos-layout{grid-template-columns:1fr;height:auto;overflow:visible}.pos-browse-panel{overflow:visible}.pos-cart-card{height:auto;max-height:calc(100vh - 80px);min-height:440px;position:sticky;top:76px}.pos-item-grid{max-height:38vh;overflow:auto}.pos-checkout-panel{height:auto;min-height:520px;position:sticky;top:76px}}
@media(max-width:767.98px){.pos-topbar,.pos-workspace-top{align-items:flex-start;grid-template-columns:1fr;flex-direction:column}.pos-search-row{grid-template-columns:1fr}.pos-tax-toggle{white-space:normal}.pos-payment-line{grid-template-columns:1fr 1fr 36px}.pos-content{height:auto;overflow:auto;padding:calc(110px + .75rem) .75rem .75rem}.pos-workspace{height:auto}.pos-cart-card{max-height:none;min-height:0;position:static}.pos-checkout-panel{max-height:none;min-height:0;position:static}.pos-item-grid{max-height:none}}

/* POS v4 retail workspace */
.pos-v4{--pos-gap:.65rem}.pos-v4>form{min-height:0}.pos-v4 .pos-layout,.pos-v4.pos-profile-retail .pos-layout,.pos-v4.pos-profile-hardware .pos-layout,.pos-v4.pos-profile-wholesale .pos-layout{gap:var(--pos-gap);grid-template-columns:minmax(285px,26%) minmax(520px,48%) minmax(300px,26%);min-height:0}
.pos-v4 .pos-browse-panel,.pos-v4 .pos-cart-card,.pos-v4 .pos-checkout-panel{border-color:color-mix(in srgb,var(--app-border) 82%,#94a3b8);border-radius:12px;box-shadow:0 8px 24px var(--app-shadow)}
.pos-v4 .pos-browse-panel{background:var(--app-surface);display:flex;flex-direction:column;gap:.55rem;min-height:0;overflow:hidden;padding:.7rem}.pos-v4 .pos-search-row{display:grid;gap:.4rem;grid-template-columns:minmax(0,1fr) 42px}.pos-v4 .pos-catalog-views{display:flex;gap:.25rem;overflow-x:auto}.pos-v4 .pos-catalog-views button{background:var(--app-surface-muted);border:1px solid var(--app-border);border-radius:99px;color:var(--app-muted);font-size:.68rem;font-weight:750;padding:.3rem .52rem;white-space:nowrap}.pos-v4 .pos-catalog-views button.active{background:color-mix(in srgb,var(--app-accent) 12%,var(--app-surface));border-color:var(--app-accent);color:var(--app-accent)}
.pos-v4 .pos-category-panel{flex:0 0 auto}.pos-v4 .pos-category-filters{max-height:72px;overflow:auto}.pos-v4 .pos-item-grid,.pos-v4.pos-profile-retail .pos-item-grid,.pos-v4.pos-profile-hardware .pos-item-grid,.pos-v4.pos-profile-wholesale .pos-item-grid{align-content:start;display:grid;flex:1;gap:.42rem;grid-auto-rows:minmax(150px,auto);grid-template-columns:repeat(2,minmax(0,1fr));min-height:0;overflow:auto;padding:0 .15rem .15rem 0}
.pos-v4 .pos-item-button{background:var(--app-surface);border:1px solid var(--app-border);border-radius:9px;display:block;height:auto;max-height:none;min-height:150px;overflow:hidden;padding:0;position:relative}.pos-v4 .pos-item-button:hover,.pos-v4 .pos-item-button.is-focused{border-color:var(--app-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--app-accent) 18%,transparent)}.pos-v4 .pos-product-add{background:transparent;border:0;color:var(--app-text);display:flex;flex-direction:column;gap:.12rem;height:100%;padding:.55rem;text-align:left;width:100%}.pos-v4 .pos-favorite{background:var(--app-surface);border:1px solid var(--app-border);border-radius:50%;color:#94a3b8;height:24px;line-height:1;position:absolute;right:.35rem;top:.35rem;width:24px;z-index:2}.pos-v4 .pos-favorite.active{color:#eab308}.pos-v4 .pos-card-title{padding-right:1.65rem}.pos-v4 .pos-card-meta,.pos-v4 .pos-card-code,.pos-v4 .pos-card-category,.pos-v4 .pos-card-cost,.pos-v4 .pos-card-supplier{display:block!important;font-size:.64rem;line-height:1.18;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pos-v4 .pos-card-stock.is-low{color:#dc2626;font-weight:750}.pos-v4 .pos-product-add b{color:var(--app-accent);font-size:1rem;margin-top:auto}
.pos-v4 .pos-cart-card{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto auto}.pos-v4 .pos-document-header{align-items:center;border-bottom:1px solid var(--app-border);display:flex;justify-content:space-between;min-height:58px;padding:.65rem .8rem}.pos-v4 .pos-document-header>div{display:grid}.pos-v4 .pos-document-header strong{font-size:1rem}.pos-v4 .pos-document-header small{color:var(--app-muted);font-size:.66rem}.pos-section-kicker{color:var(--app-accent);font-size:.6rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase}.pos-document-status{background:#fef3c7;border-radius:99px;color:#92400e;font-size:.67rem;font-weight:800;padding:.3rem .55rem}.pos-v4 .pos-cart-table{font-size:.76rem}.pos-v4 .pos-cart-table th{font-size:.58rem;padding:.48rem .35rem}.pos-v4 .pos-cart-table td{padding:.42rem .3rem}.pos-v4 .pos-cart-table td:first-child{min-width:125px}.pos-v4 .pos-cart-table input{font-size:.72rem;min-width:54px;padding:.25rem .32rem}.pos-v4 .pos-remove,.pos-v4 .pos-payment-remove{background:transparent;border:0;border-radius:6px;color:#dc2626;font-size:1rem;height:28px;width:28px}.pos-empty-cart{height:250px;text-align:center!important;vertical-align:middle!important}.pos-empty-cart strong,.pos-empty-cart span{display:block!important}.pos-empty-cart span{color:var(--app-muted);font-size:.76rem!important;margin-top:.3rem}
.pos-cart-tools{align-items:center;border-top:1px solid var(--app-border);display:flex;gap:.3rem;min-height:42px;padding:.35rem .6rem}.pos-cart-tools button{background:transparent;border:0;border-radius:7px;color:var(--app-muted);font-size:.68rem;font-weight:750;padding:.35rem .45rem}.pos-cart-tools button:hover{background:var(--app-surface-muted);color:var(--app-accent)}.pos-cart-tools button span{margin-right:.2rem}.pos-future-tool{color:var(--app-muted);font-size:.58rem;margin-left:auto;opacity:.65}.pos-sale-note{border-top:1px solid var(--app-border);padding:.45rem .6rem}.pos-cart-status{background:var(--app-sidebar);color:#fff;display:grid;grid-template-columns:repeat(5,1fr) 1.35fr;min-height:52px}.pos-cart-status span{display:flex;flex-direction:column;justify-content:center;padding:.4rem .55rem}.pos-cart-status small{color:#94a3b8;font-size:.55rem;font-weight:750;letter-spacing:.06em;text-transform:uppercase}.pos-cart-status strong{font-size:.78rem}.pos-cart-status .total{background:color-mix(in srgb,var(--app-accent) 75%,#0f172a)}.pos-cart-status .total strong{font-size:1rem}
.pos-v4 .pos-checkout-panel{grid-template-rows:minmax(0,1fr) auto}.pos-v4 .pos-checkout-scroll{display:flex;flex-direction:column;gap:.5rem;padding:.6rem}.pos-v4 .pos-checkout-section,.pos-settlement-card,.pos-summary-card,.pos-v4 .pos-payment-lines{background:var(--app-surface-muted);border:1px solid var(--app-border);border-radius:9px;padding:.58rem}.pos-customer-widget{display:block!important}.pos-cash-customer{display:grid;gap:.1rem;padding:.2rem}.pos-cash-customer span{color:var(--app-muted);font-size:.7rem}.pos-customer-name{align-items:center;display:flex;justify-content:space-between;margin-top:.4rem}.pos-customer-name span{color:var(--app-muted);font-size:.65rem}.pos-customer-widget dl{display:grid;gap:.2rem;grid-template-columns:1fr 1fr;margin:.4rem 0 0}.pos-customer-widget dl div{background:var(--app-surface);border-radius:6px;display:grid;padding:.3rem .4rem}.pos-customer-widget dt{color:var(--app-muted);font-size:.55rem;font-weight:750;text-transform:uppercase}.pos-customer-widget dd{font-size:.72rem;font-weight:700;margin:0}
.pos-settlement-options{display:grid;gap:.25rem;grid-template-columns:repeat(3,1fr)}.pos-settlement-options button{background:var(--app-surface);border:1px solid var(--app-border);border-radius:7px;color:var(--app-muted);font-size:.66rem;font-weight:750;padding:.42rem .25rem}.pos-settlement-options button.active{background:color-mix(in srgb,var(--app-accent) 12%,var(--app-surface));border-color:var(--app-accent);color:var(--app-accent)}.pos-credit-projection{margin-top:.45rem}.pos-credit-projection>div{display:flex;font-size:.68rem;justify-content:space-between}.pos-credit-projection p{background:#fef2f2;border-radius:6px;color:#b91c1c;font-size:.65rem;margin:.4rem 0 0;padding:.4rem}.pos-credit-projection .form-check{font-size:.68rem;margin-top:.35rem}
.pos-summary-card>span{color:var(--app-muted);font-size:.6rem;font-weight:800;text-transform:uppercase}.pos-summary-card>strong{color:var(--app-accent);display:block;font-size:1.65rem;line-height:1.1;margin:.1rem 0 .35rem}.pos-summary-card>div{display:flex;font-size:.68rem;justify-content:space-between}.pos-quick-payments{display:flex;gap:.25rem;margin:.45rem 0}.pos-quick-payments button{background:var(--app-surface);border:1px solid var(--app-border);border-radius:6px;color:var(--app-text);font-size:.62rem;padding:.3rem .42rem}.pos-quick-payments button:hover{border-color:var(--app-accent);color:var(--app-accent)}.pos-v4 .pos-payment-line{display:grid;gap:.25rem;grid-template-columns:1.1fr .72fr .9fr 28px}.pos-v4 .pos-payment-line+.pos-payment-line{margin-top:.3rem}.pos-v4 .pos-payment-line .form-control,.pos-v4 .pos-payment-line .form-select{font-size:.65rem;padding:.28rem}.pos-tax-row{font-size:.68rem;padding:.15rem .2rem}
.pos-v4 .pos-action-footer{padding:.6rem}.pos-balance-row,.pos-change-row{align-items:center;display:flex;justify-content:space-between}.pos-balance-row span,.pos-change-row span{color:var(--app-muted);font-size:.65rem;font-weight:800;text-transform:uppercase}.pos-balance-row strong{font-size:1.12rem}.pos-change-row{margin-bottom:.45rem}.pos-change-row strong{color:#059669}.pos-v4 .pos-action-footer kbd{background:#ffffff22;border:1px solid #ffffff33;box-shadow:none;color:inherit;font-size:.55rem}
.pos-reports-hub{margin:0 auto;max-width:1450px;padding-top:clamp(.75rem,2vh,1.5rem)}.pos-reports-hub header{margin-bottom:1rem}.pos-reports-hub h1{font-size:1.75rem;margin:.1rem 0}.pos-reports-hub header p:last-child{color:var(--app-muted)}.pos-report-toolbar{align-items:center;display:flex;gap:1rem;justify-content:space-between;margin-bottom:1rem}.pos-report-toolbar input{background:var(--app-surface);border:1px solid var(--app-border);border-radius:8px;color:var(--app-text);min-width:280px;padding:.65rem .8rem}.pos-report-toolbar nav{display:flex;flex-wrap:wrap;gap:.35rem}.pos-report-toolbar button{background:var(--app-surface);border:1px solid var(--app-border);border-radius:99px;color:var(--app-muted);font-size:.72rem;font-weight:750;padding:.45rem .75rem}.pos-report-toolbar button.active{background:var(--app-accent);border-color:var(--app-accent);color:#fff}.pos-report-cards,.report-catalog-grid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(270px,1fr))}.pos-report-cards article,.report-catalog-grid>a{background:var(--app-surface);border:1px solid var(--app-border);border-radius:13px;color:var(--app-text);display:grid;gap:.5rem;min-height:190px;padding:1.15rem;text-decoration:none}.pos-report-cards article:hover,.report-catalog-grid>a:hover{border-color:var(--app-accent);box-shadow:0 8px 24px var(--app-shadow)}.pos-report-cards span,.report-catalog-grid span{color:var(--app-accent);font-size:.62rem;font-weight:850;letter-spacing:.07em;text-transform:uppercase}.pos-report-cards strong,.report-catalog-grid strong{font-size:1rem}.pos-report-cards small,.report-catalog-grid small{color:var(--app-muted);font-size:.78rem}.pos-report-cards footer{align-items:end;display:flex;gap:.5rem;justify-content:space-between;margin-top:auto}.pos-report-cards footer i{color:var(--app-muted);font-size:.62rem;font-style:normal}.pos-report-cards a,.report-catalog-grid b{color:var(--app-accent);font-size:.72rem;font-weight:800;text-decoration:none}.report-hub-empty{color:var(--app-muted);padding:3rem;text-align:center}.report-catalog-page{padding:1rem}.report-catalog-page .page-header{margin-bottom:1rem}.pos-cash-control{height:100%;overflow:auto}.pos-cash-control .table-responsive{max-height:calc(100vh - 140px)}
[data-bs-theme="dark"] .pos-document-status{background:#422006;color:#fde68a}[data-bs-theme="dark"] .pos-credit-projection p{background:#450a0a;color:#fecaca}
@media(max-width:1199.98px){.pos-v4 .pos-layout,.pos-v4.pos-profile-retail .pos-layout,.pos-v4.pos-profile-hardware .pos-layout,.pos-v4.pos-profile-wholesale .pos-layout{grid-template-columns:minmax(260px,34%) minmax(0,66%);grid-template-areas:"catalog cart" "checkout checkout"}.pos-v4 .pos-browse-panel{grid-area:catalog;max-height:calc(100vh - 155px)}.pos-v4 .pos-cart-card{grid-area:cart;max-height:calc(100vh - 155px);min-height:520px;position:static}.pos-v4 .pos-checkout-panel{grid-area:checkout;min-height:0;position:static}.pos-v4 .pos-checkout-scroll{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.pos-v4 .pos-action-footer{position:sticky;bottom:0}}
@media(max-width:767.98px){.pos-v4 .pos-layout,.pos-v4.pos-profile-retail .pos-layout,.pos-v4.pos-profile-hardware .pos-layout,.pos-v4.pos-profile-wholesale .pos-layout{display:flex;flex-direction:column}.pos-v4 .pos-browse-panel,.pos-v4 .pos-cart-card{max-height:none}.pos-v4 .pos-item-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:48vh}.pos-v4 .pos-checkout-scroll{display:flex}.pos-cart-status{grid-template-columns:repeat(3,1fr)}.pos-future-tool{display:none}.pos-v4 .pos-payment-line{grid-template-columns:1fr 1fr}.pos-v4 .pos-payment-remove{grid-column:2}.pos-workspace-top{display:none}}

.section-header h2 {
  font-size: 1.2rem;
  font-weight: 750;
  margin: 0;
}

.metric-label {
  color: var(--app-muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.metric-value {
  color: var(--app-text);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.roadmap-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.table thead th {
  background: #f8fafc;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.table > :not(caption) > * > * {
  border-bottom-color: var(--app-border);
  padding: 1rem;
}

.user-form-card {
  max-width: 920px;
}

.account-form-card {
  max-width: 980px;
}

.account-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.accounting-period-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.accounting-period-toolbar .form-select {
  min-width: 120px;
}

.accounting-period-metric {
  background: #ffffff;
  border-left: 6px solid var(--app-accent);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.accounting-period-metric .card-body {
  padding: 1.15rem 1.2rem;
}

.accounting-period-metric .metric-label {
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.accounting-period-metric .metric-value {
  font-size: 2.05rem;
  margin-bottom: 0.35rem;
}

.metric-hint,
.current-period-year {
  color: var(--app-muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.period-metric-total {
  border-left-color: #2563eb;
}

.period-metric-open {
  border-left-color: #16a34a;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.period-metric-locked {
  border-left-color: #dc2626;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.period-metric-closed {
  border-left-color: #475569;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.period-metric-current {
  border-left-color: #0f172a;
}

.current-period-title {
  color: var(--app-text);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.2;
}

.current-period-empty {
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.accounting-period-rules {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.period-rule-list {
  align-content: start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  max-width: 560px;
}

.period-rule-list span {
  background: #eef2ff;
  border: 1px solid #dbe4ff;
  border-radius: 999px;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.7rem;
}

.period-activity {
  max-width: 420px;
}

.period-activity-title {
  color: var(--app-text);
  font-size: 0.84rem;
  font-weight: 750;
  margin-bottom: 0.15rem;
}

.period-activity-note,
.period-activity-empty {
  color: var(--app-muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.accounting-period-note {
  max-width: 360px;
  overflow-wrap: anywhere;
}

.accounting-period-table td:first-child {
  min-width: 150px;
}

.accounting-period-table td {
  vertical-align: middle;
}

.accounting-period-empty-state {
  text-align: center;
}

.accounting-period-empty-state .card-body {
  align-items: center;
  display: flex;
  flex-direction: column;
  padding: 3rem 1.25rem;
}

.empty-state-mark {
  align-items: center;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  color: var(--app-accent);
  display: inline-flex;
  font-weight: 850;
  height: 48px;
  justify-content: center;
  margin-bottom: 1rem;
  width: 48px;
}

@media (max-width: 575.98px) {
  .accounting-period-toolbar,
  .accounting-period-toolbar form,
  .accounting-period-toolbar .btn {
    width: 100%;
  }

  .accounting-period-toolbar form {
    align-items: stretch;
  }

  .accounting-period-table {
    min-width: 760px;
  }
}

.journal-filter-card .form-label,
.journal-form-card .form-label {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.journal-index-table,
.journal-entry-grid,
.journal-lines-readonly {
  min-width: 1080px;
}

.journal-description-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-action-group,
.journal-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.journal-status-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  min-height: 28px;
  padding: 0.42rem 0.68rem;
  white-space: nowrap;
}

.journal-status-draft {
  background: #fef3c7;
  color: #92400e;
}

.journal-status-posted {
  background: #dcfce7;
  color: #166534;
}

.journal-status-voided {
  background: #fee2e2;
  color: #991b1b;
}

.journal-form-card {
  overflow: hidden;
}

.journal-lines-card {
  overflow: visible;
}

.journal-lines-card .card-body {
  overflow: visible;
}

.journal-grid-scroll {
  overflow-x: auto;
  overflow-y: visible;
}

.journal-entry-statebar {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.journal-entry-statebar > div:first-child {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.journal-description-alert {
  border-left: 4px solid #dc2626;
  font-weight: 700;
}

.journal-header-description.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 0.18rem rgba(220, 38, 38, 0.12);
}

.journal-balance-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  min-height: 28px;
  padding: 0.42rem 0.68rem;
}

.journal-balance-ok {
  background: #dcfce7;
  color: #166534;
}

.journal-balance-out {
  background: #fee2e2;
  color: #991b1b;
}

.journal-entry-grid {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.journal-entry-grid thead th {
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  padding: 0.62rem 0.7rem;
  text-transform: uppercase;
}

.journal-entry-grid td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.42rem 0.55rem;
  vertical-align: top;
}

.journal-col-number {
  width: 56px;
}

.journal-col-account {
  width: 36%;
}

.journal-col-description {
  width: 25%;
}

.journal-col-amount {
  width: 150px;
}

.journal-col-action {
  width: 92px;
}

.journal-line-number,
.journal-row-number {
  width: 56px;
}

.journal-account-combobox {
  min-width: 340px;
  position: relative;
  z-index: 1;
}

.journal-account-search {
  background: #ffffff;
  border-color: transparent;
  box-shadow: none;
  font-weight: 700;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.journal-account-search:focus {
  background: #ffffff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.12);
}

.journal-account-results {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14);
  display: none;
  max-height: 260px;
  overflow-y: auto;
  position: fixed;
  z-index: 1200;
}

.journal-account-combobox.is-open .journal-account-results {
  display: block;
}

.journal-account-result {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  color: var(--app-text);
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  gap: 0.15rem;
  padding: 0.56rem 0.72rem;
  text-align: left;
  width: 100%;
}

.journal-account-result:last-child {
  border-bottom: 0;
}

.journal-account-result span {
  font-weight: 750;
}

.journal-account-result small {
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.journal-account-result:hover,
.journal-account-result.active,
.journal-account-result.keyboard-active {
  background: #eff6ff;
  color: #1d4ed8;
}

.journal-account-no-results {
  color: var(--app-muted);
  font-size: 0.88rem;
  padding: 0.7rem;
}

.journal-entry-grid .form-control {
  min-width: 0;
}

.journal-entry-grid .journal-description-input,
.journal-entry-grid .journal-debit-input,
.journal-entry-grid .journal-credit-input {
  border-color: transparent;
  box-shadow: none;
  padding: 0.42rem 0.55rem;
}

.journal-entry-grid .journal-description-input:focus,
.journal-entry-grid .journal-debit-input:focus,
.journal-entry-grid .journal-credit-input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.12);
}

.journal-amount-cell input {
  font-variant-numeric: tabular-nums;
}

.journal-action-cell .btn {
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.journal-entry-grid td:first-child,
.journal-lines-readonly td:first-child {
  color: var(--app-muted);
  font-weight: 750;
}

.journal-line-row.journal-line-invalid {
  background: #fff7ed;
}

.journal-line-row.journal-line-invalid td {
  border-bottom-color: #fed7aa;
}

.journal-line-error {
  color: #b91c1c;
  font-size: 0.74rem;
  font-weight: 650;
  margin-top: 0.3rem;
  max-width: 320px;
}

.journal-total-panel {
  background: #ffffff;
  border: 0;
  border-radius: 8px;
  display: grid;
  gap: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .journal-total-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.journal-total-panel > div {
  border-bottom: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.88rem 1rem;
}

@media (min-width: 768px) {
  .journal-total-panel > div {
    border-bottom: 0;
    border-right: 1px solid var(--app-border);
  }

  .journal-total-panel > div:last-child {
    border-right: 0;
  }
}

.journal-total-panel span {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.journal-total-panel strong {
  color: var(--app-text);
  font-size: 1.18rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.journal-difference-neutral {
  color: #64748b !important;
}

.journal-difference-balanced {
  color: #166534 !important;
}

.journal-difference-unbalanced {
  color: #b91c1c !important;
}

.journal-sticky-actions {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  position: sticky;
  bottom: 0.75rem;
  z-index: 90;
}

.journal-form-actions {
  align-items: center;
  border-top: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

@media (min-width: 768px) {
  .journal-form-actions {
    flex-direction: row;
  }
}

.journal-validation-checklist {
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem;
}

.journal-validation-checklist div {
  align-items: center;
  color: #334155;
  display: flex;
  font-size: 0.88rem;
  font-weight: 650;
  gap: 0.5rem;
}

.check-icon {
  align-items: center;
  background: #dcfce7;
  border-radius: 999px;
  color: #166534;
  display: inline-flex;
  flex: 0 0 22px;
  font-size: 0.8rem;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  width: 22px;
}

@media (max-width: 575.98px) {
  .journal-detail-actions,
  .journal-action-group,
  .journal-entry-form .btn {
    width: 100%;
  }

  .journal-detail-actions .btn,
  .journal-action-group .btn {
    flex: 1 1 100%;
  }
}

.ledger-filter-card .form-label {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.ledger-account-search {
  background: #f8fafc;
}

.ledger-summary-card {
  border-left: 4px solid #2563eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.ledger-summary-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
}

.ledger-summary-card span {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.ledger-summary-card strong {
  color: var(--app-text);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.ledger-summary-opening {
  border-left-color: #2563eb;
}

.ledger-summary-debit {
  border-left-color: #16a34a;
}

.ledger-summary-credit {
  border-left-color: #dc2626;
}

.ledger-summary-closing {
  border-left-color: #475569;
}

.ledger-card {
  overflow: hidden;
}

.ledger-table {
  min-width: 980px;
}

.ledger-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  padding: 0.7rem 0.85rem;
  text-transform: uppercase;
}

.ledger-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.72rem 0.85rem;
  vertical-align: top;
}

.ledger-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ledger-empty-state {
  margin: 0 auto;
  max-width: 560px;
  padding: 4rem 1.5rem;
  text-align: center;
}

.ledger-empty-state h3 {
  color: var(--app-text);
  font-size: 1.25rem;
  font-weight: 850;
  margin-bottom: 0.5rem;
}

.ledger-empty-state p {
  color: var(--app-muted);
  margin-bottom: 0;
}

.trial-balance-filter-card .form-label {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.trial-balance-zero-toggle {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: flex;
  gap: 0.55rem;
  min-height: 38px;
  padding: 0.45rem 0.75rem;
}

.trial-balance-zero-toggle .form-check-input {
  margin-left: 0;
  margin-top: 0;
}

.trial-balance-zero-toggle .form-check-label {
  color: var(--app-text);
  font-size: 0.88rem;
  font-weight: 700;
}

.trial-balance-summary-card {
  border-left: 4px solid #2563eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.trial-balance-summary-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
}

.trial-balance-summary-card span {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.trial-balance-summary-card strong {
  color: var(--app-text);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.trial-balance-summary-debit {
  border-left-color: #16a34a;
}

.trial-balance-summary-credit {
  border-left-color: #dc2626;
}

.trial-balance-summary-ok {
  border-left-color: #16a34a;
}

.trial-balance-summary-alert {
  border-left-color: #dc2626;
}

.trial-balance-card {
  overflow: hidden;
}

.trial-balance-integrity {
  align-self: flex-start;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 0.42rem 0.7rem;
}

.trial-balance-integrity-ok {
  background: #dcfce7;
  color: #166534;
}

.trial-balance-integrity-alert {
  background: #fee2e2;
  color: #991b1b;
}

.trial-balance-table {
  min-width: 980px;
}

.trial-balance-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  padding: 0.7rem 0.85rem;
  text-transform: uppercase;
}

.trial-balance-table td,
.trial-balance-table th {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.72rem 0.85rem;
}

.trial-balance-group-row td {
  background: #f8fafc;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.trial-balance-table tfoot th {
  background: #ffffff;
  border-top: 2px solid #cbd5e1;
  color: var(--app-text);
  font-size: 0.9rem;
}

.trial-balance-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trial-balance-empty-state {
  margin: 0 auto;
  max-width: 620px;
  padding: 4rem 1.5rem;
  text-align: center;
}

.trial-balance-empty-state h3 {
  color: var(--app-text);
  font-size: 1.25rem;
  font-weight: 850;
  margin-bottom: 0.5rem;
}

.trial-balance-empty-state p {
  color: var(--app-muted);
  margin-bottom: 0;
}

.profit-loss-filter-card .form-label {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.profit-loss-summary-card {
  border-left: 4px solid #2563eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.profit-loss-summary-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
}

.profit-loss-summary-card span {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.profit-loss-summary-card strong {
  color: var(--app-text);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.profit-loss-summary-revenue,
.profit-loss-summary-profit {
  border-left-color: #16a34a;
}

.profit-loss-summary-expense,
.profit-loss-summary-loss {
  border-left-color: #dc2626;
}

.profit-loss-card {
  overflow: hidden;
}

.profit-loss-net-badge {
  align-self: flex-start;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 0.42rem 0.7rem;
}

.profit-loss-net-profit {
  background: #dcfce7;
  color: #166534;
}

.profit-loss-net-loss {
  background: #fee2e2;
  color: #991b1b;
}

.profit-loss-statement {
  display: grid;
  gap: 0;
  padding: 0.4rem 0;
}

.profit-loss-section {
  border-bottom: 1px solid var(--app-border);
  padding: 1rem 1.25rem;
}

.profit-loss-section h3 {
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 850;
  margin: 0 0 0.7rem;
}

.profit-loss-subheading {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 850;
  margin: 0.85rem 0 0.35rem;
  text-transform: uppercase;
}

.profit-loss-row,
.profit-loss-total-row,
.profit-loss-net-row {
  align-items: baseline;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(130px, auto);
  padding: 0.42rem 0;
}

.profit-loss-row a,
.profit-loss-row span {
  color: var(--app-text);
  padding-left: 1rem;
  text-decoration: none;
}

.profit-loss-row a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.profit-loss-muted-row span {
  color: var(--app-muted);
}

.profit-loss-row strong,
.profit-loss-total-row strong,
.profit-loss-net-row strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.profit-loss-total-row {
  border-top: 1px solid #cbd5e1;
  color: var(--app-text);
  font-weight: 850;
  margin-top: 0.45rem;
  padding-top: 0.7rem;
}

.profit-loss-net-row {
  font-size: 1.02rem;
  font-weight: 900;
  padding: 1rem 1.25rem;
}

.profit-loss-net-row-profit {
  color: #166534;
}

.profit-loss-net-row-loss {
  color: #991b1b;
}

.profit-loss-empty-state {
  margin: 0 auto;
  max-width: 620px;
  padding: 4rem 1.5rem;
  text-align: center;
}

.profit-loss-empty-state h3 {
  color: var(--app-text);
  font-size: 1.25rem;
  font-weight: 850;
  margin-bottom: 0.5rem;
}

.profit-loss-empty-state p {
  color: var(--app-muted);
  margin-bottom: 0;
}

.financial-statements-dashboard {
  align-items: stretch;
}

.financial-statement-card {
  height: 100%;
}

.financial-statement-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  justify-content: space-between;
  min-height: 230px;
  padding: 1.25rem;
}

.financial-statement-card h2 {
  color: var(--app-text);
  font-size: 1.2rem;
  font-weight: 850;
  margin-bottom: 0.45rem;
}

.financial-statement-card p:not(.card-kicker) {
  color: var(--app-muted);
  margin-bottom: 0;
}

.financial-statement-card-disabled {
  opacity: 0.78;
}

.balance-sheet-filter-card .form-label {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.balance-sheet-summary-card {
  border-left: 4px solid #2563eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.balance-sheet-summary-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
}

.balance-sheet-summary-card span {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.balance-sheet-summary-card strong {
  color: var(--app-text);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.balance-sheet-summary-assets {
  border-left-color: #2563eb;
}

.balance-sheet-summary-liabilities {
  border-left-color: #dc2626;
}

.balance-sheet-summary-equity,
.balance-sheet-summary-ok {
  border-left-color: #16a34a;
}

.balance-sheet-summary-alert {
  border-left-color: #dc2626;
}

.balance-sheet-card {
  overflow: hidden;
}

.balance-sheet-integrity {
  align-self: flex-start;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 0.42rem 0.7rem;
}

.balance-sheet-integrity-ok {
  background: #dcfce7;
  color: #166534;
}

.balance-sheet-integrity-alert {
  background: #fee2e2;
  color: #991b1b;
}

.balance-sheet-statement {
  display: grid;
  gap: 0;
  padding: 0.4rem 0;
}

.balance-sheet-section {
  border-bottom: 1px solid var(--app-border);
  border-left: 4px solid #cbd5e1;
  padding: 1rem 1.25rem;
}

.balance-sheet-section:nth-of-type(1) {
  border-left-color: #2563eb;
}

.balance-sheet-section:nth-of-type(2) {
  border-left-color: #dc2626;
}

.balance-sheet-section:nth-of-type(3) {
  border-left-color: #16a34a;
}

.balance-sheet-section h3 {
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 850;
  margin: 0 0 0.7rem;
}

.balance-sheet-row,
.balance-sheet-total-row,
.balance-sheet-grand-total-row,
.balance-sheet-difference-row {
  align-items: baseline;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(130px, auto);
  padding: 0.42rem 0;
}

.balance-sheet-row a,
.balance-sheet-row span {
  color: var(--app-text);
  padding-left: 1rem;
  text-decoration: none;
}

.balance-sheet-row a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.balance-sheet-muted-row span {
  color: var(--app-muted);
}

.balance-sheet-row strong,
.balance-sheet-total-row strong,
.balance-sheet-grand-total-row strong,
.balance-sheet-difference-row strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.balance-sheet-total-row {
  background: #f8fafc;
  border-top: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--app-text);
  font-weight: 850;
  margin-top: 0.45rem;
  padding: 0.7rem 0.75rem;
}

.balance-sheet-grand-total-row {
  background: #f8fafc;
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 900;
  padding: 1rem 1.25rem;
}

.balance-sheet-difference-row {
  font-size: 1.02rem;
  font-weight: 900;
  padding: 1rem 1.25rem;
}

.balance-sheet-difference-ok {
  color: #166534;
}

.balance-sheet-difference-alert {
  color: #991b1b;
}

.balance-sheet-empty-state {
  margin: 0 auto;
  max-width: 660px;
  padding: 4rem 1.5rem;
  text-align: center;
}

.balance-sheet-empty-state h3 {
  color: var(--app-text);
  font-size: 1.25rem;
  font-weight: 850;
  margin-bottom: 0.5rem;
}

.balance-sheet-empty-state p {
  color: var(--app-muted);
  margin-bottom: 0;
}

.cash-flow-filter-card .form-label {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.cash-flow-summary-card {
  border-left: 4px solid #64748b;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.cash-flow-summary-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
}

.cash-flow-summary-card span {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.cash-flow-summary-card strong {
  color: var(--app-text);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.cash-flow-positive {
  border-left-color: #16a34a;
}

.cash-flow-negative {
  border-left-color: #dc2626;
}

.cash-flow-neutral {
  border-left-color: #64748b;
}

.cash-flow-card {
  overflow: hidden;
}

.cash-flow-integrity {
  align-self: flex-start;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 0.42rem 0.7rem;
}

.cash-flow-integrity-ok {
  background: #dcfce7;
  color: #166534;
}

.cash-flow-integrity-alert {
  background: #fee2e2;
  color: #991b1b;
}

.cash-flow-statement {
  display: grid;
  gap: 0;
  padding: 0.4rem 0;
}

.cash-flow-section {
  border-bottom: 1px solid var(--app-border);
  border-left: 4px solid #cbd5e1;
  padding: 1rem 1.25rem;
}

.cash-flow-section:nth-of-type(1) {
  border-left-color: #16a34a;
}

.cash-flow-section:nth-of-type(2) {
  border-left-color: #2563eb;
}

.cash-flow-section:nth-of-type(3) {
  border-left-color: #475569;
}

.cash-flow-section h3 {
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 850;
  margin: 0 0 0.7rem;
}

.cash-flow-row,
.cash-flow-total-row,
.cash-flow-grand-total-row,
.cash-flow-balance-row,
.cash-flow-reconciliation-row {
  align-items: baseline;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(130px, auto);
  padding: 0.42rem 0;
}

.cash-flow-row a,
.cash-flow-row span {
  color: var(--app-text);
  padding-left: 1rem;
  text-decoration: none;
}

.cash-flow-row a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.cash-flow-muted-row span {
  color: var(--app-muted);
}

.cash-flow-row strong,
.cash-flow-total-row strong,
.cash-flow-grand-total-row strong,
.cash-flow-balance-row strong,
.cash-flow-reconciliation-row strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.cash-flow-total-row {
  background: #f8fafc;
  border-top: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--app-text);
  font-weight: 850;
  margin-top: 0.45rem;
  padding: 0.7rem 0.75rem;
}

.cash-flow-grand-total-row {
  background: #f8fafc;
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 900;
  padding: 1rem 1.25rem;
}

.cash-flow-balance-row {
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text);
  font-weight: 850;
  padding: 0.82rem 1.25rem;
}

.cash-flow-closing-row {
  background: #f8fafc;
}

.cash-flow-reconciliation-row {
  font-size: 1.02rem;
  font-weight: 900;
  padding: 1rem 1.25rem;
}

.cash-flow-reconciliation-ok {
  color: #166534;
}

.cash-flow-reconciliation-alert {
  color: #991b1b;
}

.cash-flow-empty-state {
  margin: 0 auto;
  max-width: 680px;
  padding: 4rem 1.5rem;
  text-align: center;
}

.cash-flow-empty-state h3 {
  color: var(--app-text);
  font-size: 1.25rem;
  font-weight: 850;
  margin-bottom: 0.5rem;
}

.cash-flow-empty-state p {
  color: var(--app-muted);
  margin-bottom: 0;
}

.report-export-menu .dropdown-menu {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  min-width: 220px;
}

.report-export-menu .dropdown-item {
  font-size: 0.9rem;
  padding: 0.55rem 0.9rem;
}

.print-only {
  display: none;
}

.journal-register-filter-card .form-label {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.journal-register-summary-card {
  border-left: 4px solid #2563eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.journal-register-summary-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
}

.journal-register-summary-card span {
  color: var(--app-muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.journal-register-summary-card strong {
  color: var(--app-text);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.journal-register-summary-primary,
.journal-register-summary-debit,
.journal-register-summary-posted {
  border-left-color: #2563eb;
}

.journal-register-summary-credit {
  border-left-color: #16a34a;
}

.journal-register-summary-draft {
  border-left-color: #f59e0b;
}

.journal-register-summary-voided {
  border-left-color: #64748b;
}

.journal-register-card {
  overflow: hidden;
}

.journal-register-table th {
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.journal-register-table td {
  font-size: 0.88rem;
  vertical-align: top;
}

.journal-register-table tfoot th {
  background: #f8fafc;
  border-top: 1px solid #cbd5e1;
  color: var(--app-text);
  font-size: 0.82rem;
}

.journal-register-description {
  max-width: 360px;
  min-width: 220px;
}

.finance-widget-card {
  border-left: 4px solid #64748b;
}

.finance-widget-card .metric-value {
  font-variant-numeric: tabular-nums;
}

.finance-widget-positive {
  border-left-color: #16a34a;
}

.finance-widget-negative {
  border-left-color: #dc2626;
}

.finance-widget-neutral {
  border-left-color: #64748b;
}

.memorized-report-table th,
.adjustment-review-table th {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.memorized-report-form .form-label,
.adjustment-lines-table th {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.adjustment-lines-table td {
  vertical-align: top;
}

.adjustment-totals-panel {
  align-items: stretch;
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
  overflow: hidden;
}

.adjustment-totals-panel > div {
  border-right: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
}

.adjustment-totals-panel > div:last-child {
  border-right: 0;
}

.adjustment-totals-panel span {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.adjustment-totals-panel strong {
  color: var(--app-text);
  font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.adjustment-balanced strong {
  color: #166534;
}

.adjustment-unbalanced strong {
  color: #991b1b;
}

@media (max-width: 767.98px) {
  .adjustment-totals-panel {
    grid-template-columns: 1fr;
  }

  .adjustment-totals-panel > div {
    border-bottom: 1px solid var(--app-border);
    border-right: 0;
  }

  .adjustment-totals-panel > div:last-child {
    border-bottom: 0;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  .report-landscape {
    page: report-landscape;
  }

  @page report-landscape {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11px;
  }

  .app-shell {
    display: block;
  }

  .app-sidebar,
  .app-topbar,
  .app-mobile-sidebar,
  .no-print,
  .btn,
  .dropdown,
  form {
    display: none !important;
  }

  .app-main {
    margin-left: 0 !important;
    min-height: auto;
  }

  .app-content {
    padding: 0 !important;
  }

  .print-only {
    display: block !important;
  }

  .report-print-header {
    border-bottom: 1px solid #000;
    margin-bottom: 12px;
    padding-bottom: 8px;
    text-align: center;
  }

  .report-print-header h1 {
    color: #000;
    font-size: 18px;
    font-weight: 800;
    margin: 2px 0;
  }

  .report-print-header p {
    color: #000;
    margin: 1px 0;
  }

  .report-print-org {
    color: #000;
    font-size: 14px;
    font-weight: 800;
  }

  .card,
  .dashboard-card {
    border: 0 !important;
    box-shadow: none !important;
  }

  .card-header {
    background: #fff !important;
    border-bottom: 1px solid #000 !important;
    color: #000 !important;
    padding: 0 0 8px !important;
  }

  .card-body {
    padding: 0 !important;
  }

  .table-responsive {
    overflow: visible !important;
  }

  .table,
  .report-table {
    border-collapse: collapse !important;
    color: #000 !important;
    width: 100% !important;
  }

  .table th,
  .table td,
  .report-table th,
  .report-table td {
    border: 1px solid #000 !important;
    color: #000 !important;
    padding: 4px 5px !important;
  }

  .table thead th,
  .report-table thead th,
  .table tfoot th,
  .report-table tfoot th {
    background: #fff !important;
    color: #000 !important;
  }

  a {
    color: #000 !important;
    text-decoration: none !important;
  }

  .journal-status-badge {
    background: transparent !important;
    border: 0 !important;
    color: #000 !important;
    padding: 0 !important;
  }
}

.user-status-switch {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: inline-flex;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
}

@media (max-width: 575.98px) {
  .table .btn {
    width: 100%;
  }
}

.auth-layout-body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 34rem),
    linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.auth-layout-shell {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 1.25rem;
}

.auth-layout-brand {
  align-items: center;
  color: var(--app-text);
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.25rem;
}

.auth-layout-brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.auth-layout-brand strong {
  font-size: 1.05rem;
  font-weight: 800;
}

.auth-layout-brand span:last-child {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-page {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 0;
  width: 100%;
}

.auth-card {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  max-width: 460px;
  padding: 1.5rem;
  width: min(100%, 460px);
}

@media (min-width: 576px) {
  .auth-card {
    padding: 2rem;
  }
}

.auth-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.auth-header h1 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0;
}

.auth-brand-mark {
  background: var(--app-sidebar);
  color: #ffffff;
}

.auth-layout-logo {
  height: auto;
  margin-bottom: 1.25rem;
  max-width: 220px;
}

.auth-card .btn-primary {
  --bs-btn-bg: var(--app-accent-emerald);
  --bs-btn-border-color: var(--app-accent-emerald);
  --bs-btn-hover-bg: #00b386;
  --bs-btn-hover-border-color: #00b386;
}

.validation-summary-valid {
  display: none;
}

.customer-form-card .card-body {
  padding: 1.5rem;
}

.customer-form-sections {
  display: grid;
  gap: 1.25rem;
}

.customer-form-section {
  display: grid;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.customer-form-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.customer-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.customer-detail-grid div {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.customer-detail-grid span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.customer-detail-grid strong {
  display: block;
  margin-top: 0.2rem;
  color: #0f172a;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.customer-metric-card {
  border-left: 4px solid #2563eb;
}

.customer-activity-empty {
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: 8px;
  color: #64748b;
  padding: 2rem;
  text-align: center;
}

.quotation-details-totals {
  display: grid;
  gap: 0.35rem;
  min-width: min(100%, 360px);
}

.quotation-details-totals div {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.quotation-details-totals span {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.quotation-details-grand {
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  margin-top: 0.35rem;
  padding-top: 0.6rem;
}

.quotation-details-grand strong {
  font-size: 1.15rem;
}

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

  .customer-form-card .card-body {
    padding: 1rem;
  }
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}
