html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

:root {
  --app-header-height: 56px;
  --app-footer-height: 40px;
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 70px;
  --app-primary: #0d6efd;
  --app-primary-dark: #0a58ca;
  --app-primary-rgb: 13, 110, 253;
  --app-sidebar-bg: #173b74;
  --app-sidebar-active: #0d6efd;
  --primary-color: var(--app-primary);
  --sidebar-bg: var(--app-sidebar-bg);
}

body.app-layout {
  min-height: 100vh;
  margin: 0;
  padding-top: var(--app-header-height);
  padding-bottom: var(--app-footer-height);
  overflow-x: hidden;
  background: #f8f9fc;
}

.header-fixed {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1040;
  height: var(--app-header-height);
}

.navbar-custom {
  background-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14);
}

.navbar-custom > .container-fluid {
  min-width: 0;
  flex-wrap: nowrap;
}

.navbar-custom .navbar-brand {
  min-width: 0;
  margin-right: 1rem;
  overflow: hidden;
  color: #fff !important;
  font-size: 1.3rem;
  font-weight: 700;
  white-space: nowrap;
}

.navbar-custom .navbar-brand > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-toggle {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-right: 0.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 0.375rem;
  background: transparent;
}

.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.navbar-custom .user-menu-toggle {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.navbar-custom .user-menu-toggle:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.35);
}

.pwa-header-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
  margin-right: 0.75rem;
}

.connection-status {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.connection-dot {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 0.55rem;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
}

.connection-status.status-online .connection-dot {
  background: #22c55e;
}

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

.connection-status.status-offline {
  background: rgba(127, 29, 29, 0.42);
}

.pending-sync-indicator {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 0.38rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
  color: #fff !important;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.pending-sync-indicator:hover,
.pending-sync-indicator:focus-visible {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(15, 23, 42, 0.3);
}

.pending-sync-indicator.has-pending {
  border-color: rgba(253, 230, 138, 0.85);
  background: rgba(146, 64, 14, 0.55);
}

.pending-sync-count {
  display: inline-grid;
  min-width: 1.2rem;
  height: 1.2rem;
  place-items: center;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #fff;
  color: #1e3a8a;
  font-size: 0.72rem;
  font-weight: 800;
}

.pwa-install-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 0.4rem;
  border-color: rgba(255, 255, 255, 0.65);
  background: #fff;
  color: var(--app-primary-dark);
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.pwa-install-button:hover,
.pwa-install-button:focus {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.9);
  color: var(--app-primary-dark);
}

.pwa-install-button[hidden] {
  display: none !important;
}

.pwa-toast {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--app-footer-height) + 1rem);
  z-index: 1080;
  max-width: min(380px, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  box-shadow: 0 0.65rem 1.5rem rgba(15, 23, 42, 0.24);
  color: #fff;
  font-size: 0.9rem;
}

.pwa-toast-online {
  border-color: #15803d;
  background: #166534;
}

.pwa-toast-offline {
  border-color: #b91c1c;
  background: #991b1b;
}

.pwa-toast[hidden] {
  display: none !important;
}

.offline-form-message {
  margin-bottom: 1rem;
}

.offline-page-connection {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--app-border, #dfe5ec);
  border-radius: 999px;
  background: var(--app-surface, #fff);
  color: var(--app-text, #1f2937);
  font-size: 0.85rem;
  font-weight: 650;
}

.offline-page-connection.status-online .connection-dot {
  border-color: rgba(22, 101, 52, 0.3);
  background: #22c55e;
}

.offline-page-connection.status-offline .connection-dot {
  border-color: rgba(153, 27, 27, 0.3);
  background: #ef4444;
}

.offline-count-card .display-6 {
  color: var(--app-primary);
}

.offline-count-total {
  background: rgba(var(--app-primary-rgb), 0.08) !important;
}

.offline-count-failed {
  background: rgba(220, 38, 38, 0.08) !important;
}

.offline-count-failed .display-6 {
  color: #b91c1c;
}

.offline-record-error {
  max-width: 22rem;
  overflow: hidden;
  color: #b91c1c;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offline-records-page .progress {
  height: 1.25rem;
}

.company-logo {
  object-fit: contain;
  background: #fff;
}

.company-logo-navbar,
.company-logo-fallback.company-logo-navbar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.company-logo-fallback {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: #fff;
  color: var(--sidebar-bg);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.sidebar {
  position: fixed;
  top: var(--app-header-height);
  bottom: var(--app-footer-height);
  left: 0;
  z-index: 1030;
  width: var(--sidebar-width);
  padding-top: 20px;
  padding-bottom: 90px;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--sidebar-bg);
  scrollbar-gutter: stable;
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar .nav-item {
  padding: 0;
  margin: 0;
}

.sidebar .nav-link {
  min-height: 45px;
  padding: 12px 20px;
  overflow: hidden;
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, 0.82) !important;
  font-size: 0.95rem;
  text-overflow: clip;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, padding 0.2s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus-visible {
  padding-left: 17px;
  border-left-color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff !important;
}

.sidebar .nav-link.active {
  border-left-color: #fff;
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff !important;
  font-weight: 600;
}

.sidebar .nav-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}

.sidebar .nav-link i {
  width: 20px;
  flex: 0 0 20px;
  text-align: center;
}

.sidebar .menu-text {
  display: inline;
}

.sidebar .nav-item.submenu > .nav-link::after {
  content: '\f107';
  float: right;
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  transition: transform 0.2s ease;
}

.sidebar .nav-item.submenu.open > .nav-link::after {
  transform: rotate(180deg);
}

.sidebar .submenu-list {
  display: none;
  max-height: 0;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.2);
}

.sidebar .submenu-list.open {
  display: block;
  max-height: 600px;
}

.sidebar .submenu-list .nav-link {
  padding-left: 40px;
  font-size: 0.9rem;
}

.sidebar .submenu-list .nav-link:hover,
.sidebar .submenu-list .nav-link:focus-visible {
  padding-left: 37px;
}

.sidebar-section-title {
  padding: 15px 20px 10px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-section-title:first-child {
  margin-top: 0;
}

.sidebar-company-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
  margin: 0 15px 14px;
  padding: 0 5px 14px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  white-space: nowrap;
}

.company-logo-sidebar,
.company-logo-fallback.company-logo-sidebar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 0.5rem;
}

.sidebar-company-name {
  min-width: 0;
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar.sidebar-collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.sidebar-collapsed .sidebar-company-brand {
  justify-content: center;
  margin-right: 8px;
  margin-left: 8px;
  padding-right: 0;
  padding-left: 0;
}

.sidebar.sidebar-collapsed .sidebar-company-name,
.sidebar.sidebar-collapsed .sidebar-section-title,
.sidebar.sidebar-collapsed .menu-text,
.sidebar.sidebar-collapsed .nav-item.submenu > .nav-link::after {
  display: none;
}

.sidebar.sidebar-collapsed .nav-link,
.sidebar.sidebar-collapsed .nav-link:hover,
.sidebar.sidebar-collapsed .nav-link:focus-visible {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 0;
  padding-left: 0;
}

.sidebar.sidebar-collapsed .nav-link i {
  width: 24px;
  flex-basis: 24px;
  margin-right: 0 !important;
  font-size: 1rem;
}

.sidebar.sidebar-collapsed .submenu-list {
  display: none !important;
}

.main-content {
  min-width: 0;
  margin-left: var(--sidebar-width);
  padding-bottom: var(--app-footer-height);
  transition: margin-left 0.2s ease;
}

.main-content.main-content-expanded {
  margin-left: var(--sidebar-collapsed-width);
}

.main-content main {
  min-width: 0;
  padding: 20px;
}

.footer-fixed {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  height: var(--app-footer-height);
  align-items: center;
  justify-content: center;
  background: #fff;
  line-height: 1.2;
  white-space: nowrap;
}

.sidebar-backdrop {
  position: fixed;
  inset: var(--app-header-height) 0 var(--app-footer-height) 0;
  z-index: 1025;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
}

.alert-custom {
  margin-bottom: 20px;
}

@media (max-width: 1199.98px) {
  .pending-sync-label {
    display: none;
  }

  .navbar-custom .navbar-collapse {
    position: fixed;
    top: var(--app-header-height);
    right: 0;
    left: 0;
    z-index: 1045;
    max-height: calc(100vh - var(--app-header-height) - var(--app-footer-height));
    padding: 0.75rem 1rem;
    overflow-y: auto;
    background: var(--primary-color);
    box-shadow: 0 0.5rem 0.75rem rgba(0, 0, 0, 0.18);
  }

  .navbar-custom .navbar-collapse:not(.show) {
    display: none;
  }
}

@media (max-width: 767.98px) {
  body.app-layout.sidebar-mobile-open {
    overflow: hidden;
  }

  .navbar-custom .navbar-brand {
    flex: 1 1 auto;
    margin-right: 0.5rem;
    font-size: 1rem;
  }

  .navbar-custom .navbar-brand > span:last-child {
    display: none;
  }

  .sidebar {
    width: min(var(--sidebar-width), 86vw);
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content,
  .main-content.main-content-expanded {
    margin-left: 0;
  }

  .main-content main {
    padding: 15px;
  }
}

@media (max-width: 575.98px) {
  .pwa-header-controls {
    gap: 0.35rem;
    margin-right: 0.45rem;
  }

  .connection-status {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
  }

  .pwa-install-button {
    width: 34px;
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  .pwa-install-label {
    display: none;
  }

  .pwa-toast {
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .main-content,
  .sidebar .nav-link,
  .sidebar .nav-item.submenu > .nav-link::after {
    transition: none;
  }
}

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

.sales-invoice .card {
  border-radius: 0.6rem;
}

.purchase-invoice .card {
  border-radius: 0.6rem;
}

.expense-entry-invoice .card {
  border-radius: 0.6rem;
}

.sales-invoice .table > :not(caption) > * > * {
  padding: 0.8rem;
}

.purchase-invoice .table > :not(caption) > * > * {
  padding: 0.8rem;
}

.expense-entry-invoice .table > :not(caption) > * > * {
  padding: 0.8rem;
}

.sales-invoice input[readonly] {
  cursor: default;
}

@media (max-width: 576px) {
  .sales-invoice .card-body {
    padding: 1rem;
  }

  .purchase-invoice .card-body {
    padding: 1rem;
  }

  .expense-entry-invoice .card-body {
    padding: 1rem;
  }
}

.dashboard-report-link {
  color: inherit;
  text-decoration: none;
}

.dashboard-report-link .card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-report-link:hover .card,
.dashboard-report-link:focus .card {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12) !important;
}

.report-page .report-metric {
  border-radius: 0.6rem;
}

/* --- Compact Sales Entry Layout --- */
.sales-entry-page {
    height: calc(100dvh - var(--app-header-height, 56px) - var(--app-footer-height, 40px));
    min-height: 0;
    overflow: hidden;
    padding: 10px 14px;
}

#salesForm {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.sales-entry-page .card {
    margin-bottom: 8px;
}

.sales-entry-page .card-body {
    padding: 10px 12px;
}

.sales-entry-page .form-label {
    margin-bottom: 3px;
    font-size: 0.82rem;
    font-weight: 600;
}

.sales-entry-page .form-control,
.sales-entry-page .form-select {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 0.9rem;
}

.sales-entry-page .row {
    --bs-gutter-y: 6px;
}

.sales-entry-page h1,
.sales-entry-page h2,
.sales-entry-page h3 {
    margin-bottom: 6px;
}

.sales-items-section {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.sales-items-table-wrapper {
    flex: 1 1 auto;
    min-height: 140px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
}

.sales-items-table-wrapper thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.sales-items-table-wrapper .table {
    margin-bottom: 0;
}

.sales-items-table-wrapper th,
.sales-items-table-wrapper td {
    padding: 5px 6px;
    vertical-align: middle;
}

.sales-items-table-wrapper .form-control,
.sales-items-table-wrapper .form-select {
    min-height: 32px;
    padding: 3px 6px;
}

.sales-totals-section {
    flex: 0 0 auto;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.sales-totals-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
    gap: 8px;
    align-items: end;
}

@media (max-width: 991.98px) {
    .sales-entry-page {
        height: auto;
        min-height: 100%;
        overflow: visible;
    }

    #salesForm {
        height: auto;
    }

    .sales-items-table-wrapper {
        max-height: 45vh;
    }

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

/* --- Updated Sales Entry Layout v2 --- */
.sales-entry-workspace {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 8px 12px;
    box-sizing: border-box;
}

.sales-entry-header {
    min-height: 0;
}

.sales-entry-items {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.sales-entry-footer {
    min-height: 0;
    flex-shrink: 0;
}

.sales-items-table-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
}

.sales-items-table-wrapper table {
    margin-bottom: 0;
}

.sales-items-table-wrapper thead {
    position: sticky;
    top: 0;
    z-index: 5;
    /* Removed background: var(--bs-body-bg) to avoid white strip */
}

.sales-header-grid {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(140px, 0.8fr) minmax(200px, 1.5fr) minmax(180px, 1.2fr) auto;
    gap: 8px;
    align-items: end;
}

.sales-entry-workspace .card-body {
    padding: 8px 10px;
}

.sales-entry-workspace .form-label {
    margin-bottom: 2px;
    font-size: 0.8rem;
    font-weight: 600;
}

.sales-entry-workspace .form-control,
.sales-entry-workspace .form-select {
    min-height: 32px;
    padding: 4px 7px;
    font-size: 0.875rem;
}

.sales-entry-workspace .table th,
.sales-entry-workspace .table td {
    padding: 4px 5px;
}

.sales-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
    gap: 8px;
    align-items: end;
}

@media (min-width: 992px) {
    body.sales-create-active {
        height: 100dvh;
        overflow: hidden;
    }

    body.sales-create-active main,
    body.sales-create-active .main-content,
    body.sales-create-active .content-wrapper {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    body.sales-create-active footer {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    body.sales-create-active {
        height: auto;
        overflow: auto;
    }

    .sales-entry-workspace {
        display: block;
        height: auto !important;
        overflow: visible;
    }

    .sales-header-grid,
    .sales-footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sales-items-table-wrapper {
        max-height: 45vh;
    }
}

/* --- Theme-Aware Sales Grid Styling --- */

/* Light Mode */
body.mode-light .sales-items-card-header {
    background-color: var(--app-surface-alt, #f8fafc) !important;
    border-bottom: 1px solid var(--app-border) !important;
}

body.mode-light .sales-items-table .sales-items-header,
body.mode-light .sales-items-table .sales-items-header tr,
body.mode-light .sales-items-table .sales-items-header th {
    background-color: var(--app-surface-alt, #f8fafc) !important;
    color: var(--app-text) !important;
    border-bottom: 1px solid var(--app-border) !important;
    font-weight: 600;
}

/* Dark Mode */
body.mode-dark .sales-items-card-header {
    background-color: var(--app-surface, #172033) !important;
    border-bottom: 1px solid var(--app-border) !important;
}

body.mode-dark .sales-items-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--app-text);
    --bs-table-border-color: var(--app-border);
}

body.mode-dark .sales-items-table .sales-items-header,
body.mode-dark .sales-items-table .sales-items-header tr,
body.mode-dark .sales-items-table .sales-items-header th {
    background-color: var(--app-surface, #172033) !important;
    color: var(--app-text) !important;
    border-bottom: 1px solid var(--app-border) !important;
    font-weight: 600;
}

/* --- Sales Create Keyboard Focus Styles --- */
form[data-sales-mode="create"] .sales-keyboard-focus,
form[data-sales-mode="create"] input:focus,
form[data-sales-mode="create"] select:focus,
form[data-sales-mode="create"] button:focus,
form[data-sales-mode="create"] .select2-selection:focus,
form[data-sales-mode="create"] .select2-selection.sales-keyboard-focus {
    outline: none !important;
    border-color: var(--app-primary, #0f9f8f) !important;
    box-shadow: 
        0 0 0 2px rgba(var(--app-primary-rgb), 0.35),
        0 0 10px rgba(var(--app-primary-rgb), 0.35) !important;
    background-color: rgba(var(--app-primary-rgb), 0.08) !important;
    transition: 
        border-color 0.12s ease,
        box-shadow 0.12s ease,
        background-color 0.12s ease;
}

form[data-sales-mode="create"] .select2-container--focus .select2-selection {
    border-color: var(--app-primary, #0f9f8f) !important;
    box-shadow: 0 0 0 2px rgba(var(--app-primary-rgb), 0.35) !important;
}
body.sales-invoice-modal-open {
  overflow: hidden;
}

.sales-invoice-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.sales-invoice-modal.is-open {
  display: block;
}

.sales-invoice-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}

.sales-invoice-modal__dialog {
  position: absolute;
  inset: 2vh 2vw;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--app-surface, #fff);
  color: var(--app-text, #1f2937);
  border: 1px solid var(--app-border, #dfe5ec);
  border-radius: 0.625rem;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.sales-invoice-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--app-surface, #fff);
  border-bottom: 1px solid var(--app-border, #dfe5ec);
}

.sales-invoice-modal__actions {
  display: flex;
  gap: 0.5rem;
}

.sales-invoice-modal__body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #e5e7eb;
}

.sales-invoice-modal__body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.sales-invoice-modal__status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  padding: 2rem;
  text-align: center;
  background: var(--app-surface, #fff);
  color: var(--app-text, #1f2937);
}

.sales-invoice-modal__status[hidden] {
  display: none;
}

@media (max-width: 767.98px) {
  .sales-invoice-modal__dialog {
    inset: 0;
    border: 0;
    border-radius: 0;
  }

  .sales-invoice-modal__header {
    align-items: flex-start;
  }
}
