:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f3f6fb;
  --sidebar: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--soft);
  color: var(--ink);
  font-size: 14px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
  background: linear-gradient(90deg, var(--sidebar) 0, var(--sidebar) 270px, var(--soft) 270px, var(--soft) 100%);
}

.sidebar {
  position: sticky;
  top: 0;
  width: 270px;
  flex: 0 0 270px;
  height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  transition: width .2s ease, flex-basis .2s ease, padding .2s ease;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-icon, .brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
}

.sidebar-brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #475569;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #eaf1ff;
  color: var(--primary-dark);
}

.sidebar-group {
  display: grid;
  gap: 4px;
}

.sidebar-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #475569;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}

.sidebar-group-toggle > span {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-group-toggle:hover,
.sidebar-group-toggle.active {
  background: #eaf1ff;
  color: var(--primary-dark);
}

.sidebar-group-chevron {
  font-size: 12px;
  transition: transform .18s ease;
}

.sidebar-group-toggle[aria-expanded="true"] .sidebar-group-chevron {
  transform: rotate(180deg);
}

.sidebar-subgroup {
  display: grid;
  gap: 4px;
  margin: -2px 0 6px 22px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.sidebar-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-nav a.sidebar-subitem {
  padding: 9px 10px;
  font-size: 13px;
  border-radius: 7px;
}

.content-wrap {
  flex: 1;
  min-width: 0;
}

.app-shell.sidebar-collapsed .sidebar {
  width: 76px;
  flex-basis: 76px;
  padding: 22px 10px;
}

.app-shell.sidebar-collapsed {
  background: linear-gradient(90deg, var(--sidebar) 0, var(--sidebar) 76px, var(--soft) 76px, var(--soft) 100%);
}

.app-shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-brand span:not(.brand-icon),
.app-shell.sidebar-collapsed .sidebar-nav a span,
.app-shell.sidebar-collapsed .sidebar-group-toggle span span,
.app-shell.sidebar-collapsed .sidebar-group-chevron {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-nav a,
.app-shell.sidebar-collapsed .sidebar-group-toggle {
  justify-content: center;
  padding: 12px 10px;
}

.app-shell.sidebar-collapsed .sidebar-nav a i,
.app-shell.sidebar-collapsed .sidebar-group-toggle i {
  font-size: 18px;
}

.app-shell.sidebar-collapsed .sidebar-subgroup {
  display: none;
}

.sidebar-collapse-toggle {
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
}

.topbar {
  min-height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
}

.main-content {
  padding: 24px;
}

.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.module-page-title .btn,
.module-search-panel .btn,
.module-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.module-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.role-permission-table tbody tr:nth-child(odd) > * {
  background-color: #f8fafc;
}

.role-permission-table tbody tr:hover > * {
  background-color: #eef4ff;
}

.role-permission-table td,
.role-permission-table th {
  white-space: nowrap;
}

.role-permission-table td:first-child,
.role-permission-table th:first-child {
  min-width: 190px;
  white-space: normal;
}

.stat-card,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .04);
}

.stat-card {
  padding: 18px;
}

.dashboard-summary-card {
  min-height: 96px;
}

.dashboard-debt-list {
  display: grid;
  gap: 8px;
}

.dashboard-debt-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.dashboard-debt-main {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-debt-main strong {
  font-weight: 800;
}

.dashboard-debt-due {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.reminder-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-left: 4px solid #2563eb;
}

.reminder-stat span {
  color: var(--muted);
  font-weight: 700;
}

.reminder-stat strong {
  font-size: 28px;
  line-height: 1;
}

.reminder-stat.danger {
  border-left-color: #dc2626;
}

.reminder-stat.info {
  border-left-color: #0891b2;
}

.reminder-stat.warning {
  border-left-color: #f59e0b;
}

.reminder-stat.receivable {
  border-left-color: #0d9488;
}

.reminder-stat.note {
  border-left-color: #7c3aed;
}

.reminder-stat.general {
  border-left-color: #64748b;
}

.reminder-stat-link {
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.reminder-stat-link:hover,
.reminder-stat-link.active {
  color: inherit;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .09);
}

.reminder-stat-link.active {
  outline: 2px solid rgba(37, 99, 235, .16);
}

.reminder-list {
  display: grid;
  gap: 10px;
}

.reminder-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, max-content);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid #64748b;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}

.reminder-card.important {
  border-left-color: #f59e0b;
}

.reminder-card.urgent {
  border-left-color: #dc2626;
}

.reminder-card.receivable-group {
  border-left-color: #0d9488;
  background: linear-gradient(90deg, #ecfdf5 0, #fff 18%);
}

.reminder-card.is-done {
  opacity: .72;
}

.reminder-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.reminder-card h2 {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.reminder-card p,
.reminder-result {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.reminder-relation {
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.reminder-result {
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.reminder-result span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.reminder-card-side {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.reminder-card-side strong {
  color: var(--ink);
  font-size: 14px;
}

.reminder-card-side em {
  font-style: normal;
  font-weight: 800;
}

.reminder-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #edf2f7;
}

.reminder-actions form {
  margin: 0;
}

.reminder-dashboard-list {
  display: grid;
  gap: 8px;
}

.reminder-dashboard-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.reminder-dashboard-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-dashboard-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.service-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-left: 4px solid #2563eb;
}

.service-stat span {
  color: var(--muted);
  font-weight: 700;
}

.service-stat strong {
  font-size: 24px;
  line-height: 1;
}

.service-stat.warning {
  border-left-color: #f59e0b;
}

.service-stat.danger {
  border-left-color: #dc2626;
}

.service-stat.info {
  border-left-color: #0891b2;
}

.service-list {
  display: grid;
  gap: 10px;
}

.service-form-panel form {
  display: grid;
  gap: 10px;
}

.service-form-section {
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fbfdff;
}

.service-form-section h3 {
  margin: 0 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid #e6edf6;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.service-linked-note {
  padding: 8px 10px;
  border-radius: 7px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.service-transaction-link-row {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fbfdff;
}

.service-transaction-link-row .form-label {
  margin-bottom: 4px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.service-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, max-content);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid #2563eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}

.service-card.is-done {
  opacity: .72;
}

.service-card.needs-sales-invoice {
  border-left-color: #f59e0b;
  background: linear-gradient(90deg, #fffbeb 0, #fff 20%);
}

.service-card.needs-sales-invoice.is-done {
  opacity: 1;
}

.service-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.service-card h2 {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.service-card-line,
.service-card p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.service-relations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.service-relations a,
.service-relations span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.service-card-side {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.service-card-side strong {
  color: var(--ink);
  font-size: 13px;
}

.service-card-side em {
  font-style: normal;
  font-weight: 800;
}

.service-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #edf2f7;
}

.service-actions form {
  margin: 0;
}

.service-workflow-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fbff;
}

.service-workflow-panel strong,
.service-workflow-panel span {
  display: block;
}

.service-workflow-panel strong {
  font-size: 13px;
}

.service-workflow-panel span {
  color: var(--muted);
  font-size: 12px;
}

.service-workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.service-process-head {
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
}

.service-process-head strong,
.service-process-head span {
  display: block;
}

.service-process-head strong {
  color: #0f172a;
  font-size: 14px;
}

.service-process-head span {
  color: #475569;
  font-size: 12px;
}

.service-vendor-fields {
  padding: 10px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
}

.service-spare-autogrowth {
  padding: 8px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}

.service-spare-head,
.service-spare-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.6fr) 64px 76px 100px 148px;
  gap: 0;
  align-items: stretch;
}

.service-spare-head {
  border: 1px solid #e5e7eb;
  border-bottom: 0;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.service-spare-head span {
  padding: 4px 5px;
  border-right: 1px solid #e5e7eb;
}

.service-spare-head span:last-child {
  border-right: 0;
}

.service-spare-row {
  position: relative;
  border: 1px solid #e5e7eb;
  border-top: 0;
  background: #fff;
}

.service-spare-row:focus-within {
  box-shadow: inset 0 0 0 1px #2563eb;
  z-index: 2;
}

.service-spare-row .ag2-cell {
  position: relative;
  min-width: 0;
  border-right: 1px solid #e5e7eb;
}

.service-spare-row .ag2-cell:last-child {
  border-right: 0;
}

.service-spare-row .ag2-item-cell {
  border-right: 1px solid #e5dcf2 !important;
}

.service-spare-row .form-control {
  min-height: 24px;
  height: 24px;
  border: 0;
  border-radius: 0;
  padding: 2px 5px;
  font-size: 11px;
  line-height: 1.1;
  box-shadow: none !important;
}

.service-spare-row .ag2-suggestions {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  z-index: 30;
  width: min(300px, calc(100vw - 48px));
  max-height: 72px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
}

.service-spare-row .ag2-suggestion {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  height: 16px;
  min-height: 16px;
  padding: 1px 5px;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-size: 9px;
  line-height: 1;
  text-align: left;
}

.service-spare-row .ag2-suggestion strong,
.service-spare-row .ag2-suggestion small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-spare-row .ag2-suggestion small {
  flex: 0 0 auto;
  max-width: 46%;
  color: #64748b;
}

.service-spare-row .ag2-suggestion.active,
.service-spare-row .ag2-suggestion:hover {
  background: #e0f2fe;
}

.service-spare-row .ag2-empty {
  padding: 4px 6px;
  color: #64748b;
  font-size: 10px;
}

.service-photo-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.service-signature-pad {
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.service-signature-pad canvas {
  display: block;
  width: 100%;
  height: 180px;
  touch-action: none;
  cursor: crosshair;
}

@media (max-width: 768px) {
  .service-spare-autogrowth {
    overflow-x: auto;
  }
  .service-spare-head,
  .service-spare-row {
    min-width: 640px;
    grid-template-columns: 220px 64px 76px 100px 148px;
  }
}

.service-pickup-proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.service-pickup-proof img {
  max-width: 100%;
  max-height: 190px;
  object-fit: contain;
  border: 1px solid #d1d5db;
}

.service-pickup-proof span {
  display: block;
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.service-print-sheet {
  color: #111827;
}

.service-print-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid #111827;
}

.service-print-head h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
}

.service-print-head strong,
.service-print-head span {
  display: block;
}

.service-print-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-top: 16px;
}

.service-print-grid div,
.service-shipping-label div {
  padding: 8px 0;
  border-bottom: 1px solid #d1d5db;
}

.service-print-grid span,
.service-shipping-label span,
.service-print-note span,
.service-print-sign span {
  display: block;
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.service-print-note {
  margin-top: 16px;
}

.service-print-note p {
  min-height: 44px;
  margin: 4px 0 12px;
  padding: 8px;
  border: 1px solid #d1d5db;
}

.service-print-sign {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-top: 34px;
}

.service-print-sign strong {
  display: block;
  min-height: 48px;
  border-bottom: 1px solid #111827;
}

.service-print-qr {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 30px 0;
  text-align: center;
}

.service-print-qr img {
  width: 240px;
  height: 240px;
}

.service-print-qr h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
}

.service-shipping-label {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  font-size: 20px;
}

@media (max-width: 767.98px) {
  .reminder-form-panel {
    position: static;
  }

  .reminder-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .reminder-card-side {
    justify-items: start;
    grid-template-columns: auto auto auto;
    align-items: center;
    gap: 8px;
    white-space: normal;
  }

  .reminder-actions {
    justify-content: stretch;
  }

  .reminder-actions .btn,
  .reminder-actions form {
    flex: 1 1 auto;
  }

  .reminder-actions .btn {
    width: 100%;
  }

  .reminder-dashboard-item {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .reminder-dashboard-item span {
    white-space: normal;
  }

  .service-form-panel {
    position: static;
  }

  .service-form-section {
    padding: 10px;
  }

  .service-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-card-side {
    justify-items: start;
    grid-template-columns: minmax(0, 1fr);
    white-space: normal;
  }

  .service-actions {
    justify-content: stretch;
  }

  .service-actions .btn,
  .service-actions form {
    flex: 1 1 auto;
  }

  .service-actions .btn {
    width: 100%;
  }

  .service-workflow-actions .btn,
  .service-workflow-actions a {
    flex: 1 1 auto;
  }

  .service-pickup-proof {
    grid-template-columns: 1fr;
  }

  .service-print-head,
  .service-print-grid,
  .service-print-sign {
    grid-template-columns: 1fr;
    display: grid;
  }
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.login-page,
.install-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, .12), transparent 30%),
    linear-gradient(135deg, #eef4ff 0%, #f8fafc 48%, #ffffff 100%);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 16px;
}

.login-card {
  position: relative;
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 38px 38px 34px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .10);
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #f97316, #2563eb, #0ea5e9);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.login-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.login-brand span {
  font-weight: 800;
  font-size: 18px;
  color: var(--primary-dark);
}

.login-card h1 {
  font-size: 31px;
  line-height: 1.12;
  margin: 0 0 8px;
}

.login-card p {
  color: var(--muted);
  margin: 0;
}

.login-card .btn-primary {
  min-height: 48px;
  font-weight: 700;
}

.login-footer {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  color: #64748b;
  font-size: 12px;
  padding: 0 4px;
  text-align: center;
}

.table td,
.table th {
  vertical-align: middle;
}

.coa-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
}

.coa-tabs .nav-link {
  white-space: nowrap;
}

.coa-table {
  min-width: 940px;
}

.coa-table thead th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
}

.coa-code-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.coa-spacer {
  width: 16px;
  flex: 0 0 16px;
}

.coa-header-row {
  background: #f8fafc;
}

.coa-header-row td {
  font-weight: 700;
}

.coa-linked-row td {
  background: #fbfdff;
  border-top: 0;
}

.coa-edit-form,
.coa-create-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.account-map-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
  min-height: 100%;
}

.account-map-row .form-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.opening-balance-table {
  max-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.opening-balance-table table {
  margin-bottom: 0;
}

.opening-balance-table thead th,
.opening-balance-table tfoot th {
  background: #f8fafc;
  position: sticky;
  z-index: 1;
}

.opening-balance-table thead th {
  top: 0;
}

.opening-balance-table tfoot th {
  bottom: 0;
}

.journal-entry-total td {
  background: #f8fafc;
  border-bottom: 2px solid var(--line);
}

.report-detail-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  min-width: 360px;
  white-space: normal;
}

.report-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-bottom: 10px;
}

.report-detail-grid span,
.report-detail-note span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 2px;
}

.report-detail-grid strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.report-detail-note {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.receipt-preview {
  max-height: 360px;
  width: 100%;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  padding: 18px 2px 0;
}

.calculator-display {
  text-align: right;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calculator-grid button {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 8px;
  min-height: 42px;
  font-weight: 700;
}

.calculator-grid button:hover {
  background: #eaf1ff;
  color: var(--primary-dark);
}

.calculator-equals {
  background: var(--primary) !important;
  color: #fff;
  border-color: var(--primary) !important;
}

.sales-page-title {
  margin-bottom: 14px;
}

.sales-pos-page {
  display: grid;
  grid-template-columns: minmax(560px, 1.35fr) minmax(360px, .9fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
  height: calc(100vh - 210px);
  min-height: 620px;
  overflow: hidden;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #d7e0ec 0%, #d9e8ee 52%, #d8e7dc 100%);
}

.sales-pos-page.sales-input-backoffice {
  grid-template-columns: minmax(0, 1fr);
}

.sales-cart-panel {
  order: 1;
}

.sales-catalog-panel {
  order: 2;
}

.sales-catalog-panel,
.sales-cart-panel {
  display: flex;
  flex-direction: column;
  padding: 14px;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  background: #e3ebf1;
}

.sales-catalog-panel {
  border: 3px solid rgba(37, 99, 235, .34);
  overflow: hidden;
}

.sales-cart-panel {
  overflow: hidden;
}

.sales-cart-panel {
  padding-bottom: 0;
}

.sales-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sales-panel-head .form-control {
  max-width: 320px;
  min-height: 38px;
}

.sales-kind-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.sales-kind-tabs .btn {
  white-space: nowrap;
}

.sales-item-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 154px;
  align-content: start;
  gap: 8px;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
}

.sales-item-card {
  position: relative;
  display: grid;
  grid-template-rows: 64px minmax(38px, auto) 18px;
  align-content: start;
  gap: 5px;
  width: 100%;
  text-align: left;
  border: 3px solid rgba(37, 99, 235, .24);
  background: #edf3f8;
  border-radius: 8px;
  padding: 8px;
  color: #0f172a;
  min-height: 0;
  height: 154px;
  overflow: hidden;
  touch-action: manipulation;
}

.sales-item-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .10);
}

.sales-item-image {
  display: grid;
  place-items: center;
  height: 64px;
  border-radius: 7px;
  background: #dce5ee;
  color: #94a3b8;
  overflow: hidden;
  font-size: 30px;
}

.sales-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sales-item-name {
  display: -webkit-box;
  min-height: 36px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.22;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sales-item-meta {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-item-card strong {
  font-size: 13px;
  line-height: 1.2;
}

.sales-form-section {
  position: relative;
  border: 3px solid rgba(37, 99, 235, .38);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #eef4f8 0%, #e2edf6 58%, #d7e5f1 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}

.sales-form-header {
  border-color: rgba(37, 99, 235, .40);
  background: linear-gradient(135deg, #eef4f8 0%, #e1edf7 54%, #d6e4f1 100%);
}

.sales-form-detail {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-color: rgba(14, 165, 233, .36);
  background: linear-gradient(135deg, #edf4f7 0%, #e0edf3 56%, #d3e8ef 100%);
}

.sales-form-footer {
  flex: 0 0 auto;
  margin-bottom: 0;
  border-color: rgba(16, 185, 129, .34);
  background: linear-gradient(135deg, #edf5ef 0%, #e0eee5 54%, #d5e8db 100%);
}

.sales-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sales-section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(37, 99, 235, .34), rgba(37, 99, 235, 0));
}

.sales-invoice-head {
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
}

.sales-invoice-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.sales-invoice-number {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  background: #e0e9f1;
  padding: 6px 10px;
  font-weight: 800;
  color: #0f172a;
}

.sales-customer-summary {
  min-height: 104px;
  border: 3px solid rgba(37, 99, 235, .28);
  border-radius: 8px;
  background: rgba(232, 240, 247, .90);
  padding: 10px 12px;
  align-self: stretch;
}

.sales-customer-summary strong,
.sales-customer-summary span {
  display: block;
}

.sales-customer-summary span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 4px;
}

.sales-customer-detail {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.sales-customer-detail[hidden] {
  display: none;
}

.sales-customer-detail span {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 0;
}

.sales-customer-detail i {
  color: var(--primary);
  line-height: 1.35;
}

.purchase-compact-head {
  grid-template-columns: minmax(320px, 520px) minmax(240px, 1fr);
  align-items: stretch;
}

.purchase-compact-head .sales-invoice-fields {
  gap: 6px;
}

.purchase-compact-field {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.purchase-compact-field .form-label {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}

.purchase-compact-field .form-control,
.purchase-compact-field .btn {
  min-height: 34px;
  font-size: 13px;
}

.purchase-compact-field .form-control {
  padding-top: 5px;
  padding-bottom: 5px;
}

.purchase-compact-head .sales-customer-summary {
  min-height: 0;
  padding: 8px 10px;
}

.purchase-compact-head .sales-customer-summary .small {
  font-size: 12px;
}

.purchase-form-title {
  margin-top: -6px;
  margin-bottom: 10px;
}

.purchase-form-title h1 {
  font-size: 1.38rem;
  line-height: 1.12;
  margin-bottom: 0 !important;
}

.purchase-redesign {
  height: calc(100dvh - 168px);
  min-height: 640px;
  padding: 8px 8px 12px;
  background: #edf2f7;
}

.purchase-redesign-panel {
  display: grid;
  grid-template-rows: minmax(98px, 15%) minmax(300px, 1fr) auto 40px;
  gap: 2px;
  padding: 8px 8px 10px;
  background: #f6f8fb;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

.purchase-redesign .sales-form-section {
  min-height: 0;
  margin-bottom: 0;
  border-width: 1px;
  border-color: #d8e0ea;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}

.purchase-redesign-header {
  z-index: 8;
  display: grid;
  overflow: hidden !important;
}

.purchase-redesign-header .purchase-compact-head {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.sales-redesign .purchase-redesign-header .purchase-compact-head {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
}

.purchase-redesign-header .purchase-compact-field {
  grid-template-columns: 82px minmax(0, 360px);
  gap: 2px;
  min-width: 0;
  transform: translateY(3px);
}

.purchase-redesign-header .purchase-compact-field .form-control {
  min-height: 24px;
  height: 24px;
  padding-top: 2px;
  padding-bottom: 2px;
  line-height: 1.2;
  overflow: visible;
  text-overflow: clip;
}

.purchase-redesign-header .purchase-compact-field .form-select {
  min-height: 24px;
  height: 24px;
  padding-top: 2px;
  padding-bottom: 2px;
  font-size: 13px;
  line-height: 1.2;
}

.purchase-redesign-header .purchase-kind-field .form-select,
.purchase-redesign-header .sales-kind-field .form-select {
  max-width: 172px;
}

.purchase-redesign-header .purchase-kind-field .form-select-sm,
.purchase-redesign-header .sales-kind-field .form-select-sm {
  max-width: 172px;
}

.purchase-redesign-header .transaction-header-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: stretch;
  align-content: center;
  gap: 4px 6px;
  width: 100%;
  min-width: 0;
  justify-content: stretch;
}

.purchase-redesign-header .transaction-header-group {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.purchase-redesign-header .transaction-header-grid .purchase-compact-field {
  grid-template-columns: 76px minmax(0, 1fr);
  transform: none;
}

.return-redesign .purchase-redesign-header {
  min-height: 76px;
}

.return-redesign.purchase-redesign-panel,
.return-redesign .purchase-redesign-panel {
  grid-template-rows: minmax(78px, 12%) minmax(300px, 1fr) auto 40px;
}

.return-redesign .purchase-redesign-header .purchase-compact-head {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
}

.return-redesign .purchase-redesign-header .purchase-compact-field {
  grid-template-columns: 74px minmax(0, 220px);
}

.return-redesign .purchase-redesign-header .transaction-header-grid .purchase-compact-field {
  grid-template-columns: 74px minmax(0, 1fr);
}

.return-redesign .purchase-redesign-header .return-source-field {
  grid-template-columns: 74px minmax(0, 1fr);
}

.return-redesign .purchase-redesign-header .return-source-field .form-select {
  max-width: 360px;
}

.purchase-redesign-header .sales-invoice-number.form-control {
  min-height: 24px;
  height: 24px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
}

.purchase-redesign-header .purchase-compact-field .btn {
  min-height: 24px;
  height: 24px;
  width: 38px;
  padding: 0;
  line-height: 1;
}

.purchase-redesign-header .purchase-fixed-fields {
  display: grid;
  align-content: center;
  justify-content: start;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.purchase-redesign-header .purchase-fixed-fields.transaction-header-grid {
  justify-content: stretch;
}

@media (max-width: 1180px) {
  .purchase-redesign-header .transaction-header-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

.sales-redesign .sales-header-pair {
  display: grid;
  grid-template-columns: minmax(240px, 250px) minmax(300px, 360px);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sales-redesign .sales-header-pair .purchase-compact-field {
  grid-template-columns: 82px minmax(0, 1fr);
}

.sales-redesign .sales-service-link-field .input-group {
  max-width: 360px;
  min-width: 0;
}

.sales-redesign .sales-service-link-field .form-control {
  background: #fff;
  cursor: default;
}

.sales-service-link-list {
  max-height: 360px;
  overflow: auto;
}

.purchase-redesign-header .purchase-compact-field:nth-child(1) .form-control,
.sales-redesign .sales-header-pair .purchase-compact-field:nth-child(1) .form-control {
  max-width: 250px;
}

.purchase-redesign-header .purchase-compact-field:nth-child(2) .form-control {
  max-width: 172px;
}

.purchase-redesign-header .purchase-party-field .input-group {
  max-width: 360px;
  min-width: 0;
  align-items: stretch;
}

.purchase-redesign-header .sales-customer-summary {
  display: grid;
  align-content: start;
  min-height: 0;
  height: 100%;
  padding: 4px 8px;
  overflow: auto;
  min-width: 0;
}

.purchase-redesign-header .sales-customer-summary strong {
  font-size: 13px;
  line-height: 1.15;
}

.purchase-redesign-header .sales-customer-detail {
  font-size: 11px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.purchase-redesign-detail {
  padding: 8px;
}

.purchase-ag2-wrap {
  height: 100%;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fbfdff;
  overflow: auto;
}

.purchase-ag2-table {
  width: 100%;
  min-width: 760px;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  table-layout: fixed;
}

.purchase-ag2-col-code {
  width: 5%;
}

.purchase-ag2-col-name {
  width: 57%;
}

.purchase-ag2-col-qty {
  width: 8%;
}

.purchase-ag2-col-unit {
  width: 5%;
}

.purchase-ag2-col-price,
.purchase-ag2-col-discount {
  width: 7%;
}

.purchase-ag2-col-total {
  width: 9%;
}

.purchase-ag2-col-action {
  width: 2%;
}

.purchase-ag2-table th:nth-child(1),
.purchase-ag2-table td:nth-child(1) {
  width: 5%;
  min-width: 52px;
  max-width: 5%;
}

.purchase-ag2-table th:nth-child(2),
.purchase-ag2-table td:nth-child(2) {
  width: 57%;
  min-width: 300px;
}

.purchase-ag2-table th:nth-child(3),
.purchase-ag2-table td:nth-child(3) {
  width: 8%;
  min-width: 72px;
  max-width: 8%;
}

.purchase-ag2-table th:nth-child(4),
.purchase-ag2-table td:nth-child(4) {
  width: 5%;
  min-width: 48px;
}

.purchase-ag2-table th:nth-child(5),
.purchase-ag2-table td:nth-child(5),
.purchase-ag2-table th:nth-child(6),
.purchase-ag2-table td:nth-child(6) {
  width: 7%;
  min-width: 56px;
}

.purchase-ag2-table th:nth-child(7),
.purchase-ag2-table td:nth-child(7) {
  width: 9%;
  min-width: 86px;
}

.purchase-ag2-table th:nth-child(8),
.purchase-ag2-table td:nth-child(8) {
  width: 2%;
  min-width: 28px;
}

.purchase-ag2-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  border-right: 1px solid #d3dbe6;
  border-bottom: 1px solid #d8e0ea;
  background: #eef3f8 !important;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.purchase-ag2-table thead th:last-child {
  border-right: 0;
}

.purchase-ag2-row td {
  border-top: 0;
  border-right: 1px solid #d9e1ea;
  border-bottom: 1px solid #d9e1ea;
  background: #fff;
  height: 24px;
  padding: 0 4px !important;
  line-height: 1.15;
}

.purchase-ag2-row td:last-child {
  border-right: 0;
}

.purchase-ag2-row:hover td {
  background: #f7fbff;
}

.purchase-ag2-row .purchase-ag2-code-cell {
  border-right: 1px solid #e5eaf0;
  cursor: default;
  user-select: text;
}

.purchase-ag2-row .sales-line-code {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  color: #475569;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-ag2-row .sales-line-name {
  vertical-align: middle;
}

.purchase-ag2-row .purchase-line-item-input,
.purchase-ag2-row .sales-line-item-input,
.purchase-ag2-row .purchase-line-unit,
.purchase-ag2-row .sales-line-unit,
.purchase-ag2-row .sales-price,
.purchase-ag2-row .sales-qty {
  min-height: 24px;
  height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  line-height: 1.2;
  padding: 0 3px;
}

.purchase-ag2-row .sales-qty,
.purchase-ag2-row .sales-price,
.purchase-ag2-row .sales-line-discount-total,
.purchase-ag2-row .sales-line-total {
  font-weight: 400;
  white-space: nowrap;
}

.purchase-ag2-row .sales-line-discount-total {
  cursor: pointer;
  outline: 0;
}

.purchase-ag2-row .sales-line-discount-total:focus {
  background: #f8fbff;
  box-shadow: inset 0 -1px 0 #2563eb;
}

.purchase-ag2-row .purchase-line-item-input:focus,
.purchase-ag2-row .sales-line-item-input:focus,
.purchase-ag2-row .purchase-line-unit:focus,
.purchase-ag2-row .sales-line-unit:focus,
.purchase-ag2-row .sales-price:focus,
.purchase-ag2-row .sales-qty:focus {
  background: #f8fbff;
  box-shadow: inset 0 -1px 0 #2563eb;
}

.purchase-item-name-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 0;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.purchase-redesign .purchase-item-name-wrap {
  position: relative;
  display: flex;
  gap: 2px;
  padding-right: 24px;
}

.purchase-item-name-wrap .purchase-line-item-input,
.purchase-item-name-wrap .sales-line-item-input {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  pointer-events: auto;
}

.purchase-redesign .purchase-item-name-wrap .purchase-line-item-input,
.purchase-redesign .purchase-item-name-wrap .sales-line-item-input {
  flex: 0 1 auto;
  width: auto;
  max-width: min(340px, calc(100% - 110px));
}

.purchase-item-name-wrap .sales-line-detail-toggle {
  width: 24px;
  height: 24px;
  margin-left: 0;
  border-radius: 0;
  padding: 0;
  justify-self: end;
}

.purchase-redesign .purchase-item-name-wrap .sales-line-detail-toggle {
  position: absolute;
  top: 0;
  right: 0;
}

.purchase-redesign .purchase-item-name-wrap .sales-line-detail-separator {
  color: #94a3b8;
  font-size: 11px;
  line-height: 1;
  margin: 0 2px;
}

.purchase-redesign .purchase-item-name-wrap .sales-line-detail-separator[hidden] {
  display: none;
}

.purchase-redesign .purchase-item-name-wrap .sales-line-note-info {
  max-width: clamp(80px, 20vw, 240px);
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-ag2-row .sales-qty-cell {
  min-width: 58px;
}

.purchase-ag2-row .sales-qty-wrap,
.purchase-ag2-row .sales-qty-stepper {
  display: grid;
}

.purchase-ag2-row .sales-qty-wrap {
  grid-template-columns: minmax(54px, 1fr);
}

.purchase-ag2-row .sales-qty-stepper {
  grid-template-columns: clamp(16px, 2.4vw, 20px) minmax(24px, 1fr) clamp(16px, 2.4vw, 20px);
}

.purchase-ag2-row .sales-qty-btn {
  width: auto;
  height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-width: 0;
  padding: 0;
  font-size: clamp(10px, 1.6vw, 12px);
  color: #2563eb;
}

.purchase-ag2-row .sales-line-detail-toggle,
.purchase-ag2-row .sales-line-remove,
.purchase-ag2-table .sales-qty-btn,
.purchase-ag2-table .sales-summary-add {
  border-radius: 0;
}

.purchase-ag2-detail-row {
  display: none !important;
}

#purchaseLineDetailModal .sales-cart-detail,
#salesLineDetailModal .sales-cart-detail {
  display: grid;
  grid-template-columns: minmax(180px, .65fr) minmax(180px, .65fr) minmax(260px, 1fr);
  gap: 8px;
  padding: 8px;
}

#purchaseLineDetailModal .purchase-line-tracking,
#purchaseLineDetailModal .purchase-line-note-box,
#salesLineDetailModal .purchase-line-tracking,
#salesLineDetailModal .purchase-line-note-box {
  grid-column: 1 / -1;
}

#purchaseLineDetailModal .sales-line-discount-box,
#salesLineDetailModal .sales-line-discount-box {
  grid-column: 1 / -1;
}

.purchase-serial-entry {
  display: grid;
  grid-template-columns: minmax(360px, 1.35fr) minmax(220px, .65fr);
  gap: 8px;
  align-items: start;
}

#purchaseLineDetailModal .purchase-serial-input,
#purchaseLineDetailModal .sales-line-note,
#salesLineDetailModal .purchase-serial-input,
#salesLineDetailModal .sales-line-note {
  min-height: 32px;
}

.purchase-serial-side {
  display: grid;
  gap: 6px;
  min-height: 32px;
}

.purchase-serial-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 96px;
  overflow: auto;
}

.sales-serial-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 132px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #d8e0ea;
  background: #fff;
}

.sales-serial-picker[hidden] {
  display: none !important;
}

.sales-serial-picker .btn {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.purchase-serial-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid #d8e0ea;
  background: #f8fbff;
  font-size: 12px;
  line-height: 1.2;
}

.purchase-serial-remove {
  border: 0;
  background: transparent;
  color: #dc2626;
  padding: 0;
  line-height: 1;
}

.purchase-redesign-footer {
  align-self: end;
  padding: 2px 6px;
}

.purchase-redesign-footer .sales-total-panel {
  min-height: 0;
  overflow: hidden;
}

.purchase-redesign-footer .sales-summary-grid {
  height: auto;
  min-height: 0;
  padding: 4px 6px;
  border-width: 1px;
  background: #f8fbf9;
  gap: 4px 8px;
}

.sales-redesign .purchase-redesign-footer .sales-summary-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 31%);
}

.sales-redesign .purchase-redesign-footer .sales-summary-amounts {
  justify-self: end;
  width: 100%;
  max-width: 360px;
}

.purchase-redesign-footer .sales-summary-amounts {
  gap: 1px;
}

.purchase-redesign-footer .sales-summary-amounts > div {
  min-height: 18px;
  grid-template-columns: minmax(76px, .8fr) minmax(112px, 1fr) 24px;
  column-gap: 4px;
}

.purchase-redesign-footer .sales-summary-info > div {
  gap: 4px;
}

.purchase-redesign-footer .sales-summary-count-card {
  padding: 4px 6px;
}

.purchase-redesign-footer .sales-summary-count-card > div {
  gap: 4px;
}

.purchase-redesign-footer .sales-summary-label,
.purchase-redesign-footer .sales-summary-grid span {
  font-size: 11px;
  line-height: 16px;
}

.purchase-redesign-footer .sales-summary-amounts strong,
.purchase-redesign-footer .sales-summary-count-card strong {
  font-size: 12px;
  line-height: 16px;
}

.purchase-redesign-footer .sales-summary-control {
  width: 24px;
  min-height: 18px;
}

.purchase-redesign-footer .sales-summary-add,
.purchase-redesign-footer .sales-summary-check {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

.purchase-redesign-footer .sales-summary-total {
  margin-top: 0;
  font-size: 15px;
}

.purchase-redesign-actions {
  align-self: stretch;
  margin: 0 0 6px;
  min-height: 0;
  padding: 1px 6px 5px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  gap: 4px;
  overflow: visible;
  align-items: center;
}

.purchase-redesign-actions .sales-touch-btn {
  min-height: 34px;
  height: 34px;
  min-width: 86px;
  padding-top: 3px;
  padding-bottom: 3px;
  font-size: 13px;
}

.purchase-redesign-actions .sales-help-btn {
  min-height: 34px;
  height: 34px;
  width: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 8px;
}

.sales-customer-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
}

.sales-customer-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid #d3dce8;
  border-radius: 8px;
  background: #f6f9fc;
  padding: 10px 12px;
  text-align: left;
  color: var(--ink);
}

.sales-customer-option:hover,
.sales-customer-option.active {
  border-color: #93c5fd;
  background: #edf5ff;
}

.sales-customer-option.active {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .14);
}

.purchase-autocomplete-wrap {
  position: relative;
  overflow: visible;
}

.purchase-autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1080;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, .14);
  padding: 4px;
}

.sales-form-header .purchase-autocomplete-list,
.purchase-redesign-header .purchase-autocomplete-list {
  z-index: 3200;
  min-width: 100%;
}

.purchase-line-suggest {
  position: fixed;
  right: auto;
  z-index: 3000;
}

.purchase-autocomplete-list[hidden] {
  display: none;
}

.purchase-autocomplete-option {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  color: var(--ink);
}

.purchase-autocomplete-option strong,
.purchase-autocomplete-option small {
  display: block;
  line-height: 1.3;
}

.purchase-autocomplete-option small {
  color: var(--muted);
}

.purchase-autocomplete-option.active,
.purchase-autocomplete-option:hover {
  background: #edf5ff;
}

.sales-customer-option span,
.sales-customer-option small {
  display: block;
}

.sales-customer-option small {
  color: var(--muted);
  line-height: 1.35;
  margin-top: 3px;
}

.sales-cart-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  border: 3px solid rgba(37, 99, 235, .24);
  border-radius: 8px;
  background: #edf3f7;
}

.sales-empty-cart {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 18px;
  margin-top: 10px;
  text-align: center;
  color: var(--muted);
  background: #edf3f8;
}

.sales-cart-table {
  margin-bottom: 0;
  table-layout: fixed;
}

.sales-cart-table thead th {
  background: #dfe8f1;
  color: #334155;
  font-weight: 800;
  border-bottom: 1px solid var(--line);
}

.sales-cart-search-row td {
  padding: 8px;
  background: #edf3f7;
}

.sales-cart-table th:nth-child(1),
.sales-cart-table td:nth-child(1) {
  width: 34%;
}

.sales-cart-table th:nth-child(2),
.sales-cart-table td:nth-child(2) {
  width: 18%;
}

.sales-cart-table th:nth-child(3),
.sales-cart-table td:nth-child(3) {
  width: 15%;
}

.sales-cart-table th:nth-child(4),
.sales-cart-table td:nth-child(4) {
  width: 12%;
}

.sales-cart-table th:nth-child(5),
.sales-cart-table td:nth-child(5) {
  width: 20%;
}

.sales-cart-table th:nth-child(6),
.sales-cart-table td:nth-child(6) {
  width: 8%;
}

.sales-product-cell {
  min-width: 0;
  overflow: visible;
  position: relative;
}

.sales-line-code {
  display: inline-block;
  max-width: 84px;
  margin-right: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: baseline;
}

.sales-line-name {
  display: inline-block;
  max-width: calc(100% - 128px);
  color: #0284c7;
  font-weight: 700;
  line-height: 1.2;
  max-height: 2.4em;
  overflow: hidden;
  white-space: normal;
  vertical-align: baseline;
}

.sales-line-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-line-inline-info {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin-left: 4px;
  vertical-align: baseline;
}

.sales-line-note-info {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-line-discount-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  min-width: 42px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.sales-line-note-info {
  background: #eaf1ff;
  color: var(--primary-dark);
}

.sales-line-discount-info[hidden],
.sales-line-note-info[hidden] {
  display: none;
}

.sales-line-detail-toggle {
  margin-left: 4px;
  width: 32px;
  height: 30px;
  padding: 0;
  line-height: 1;
  vertical-align: baseline;
}

.sales-qty-cell {
  min-width: 156px;
}

.sales-qty-wrap {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.sales-qty-stepper {
  display: grid;
  grid-template-columns: 36px minmax(44px, 1fr) 36px;
  align-items: center;
}

.sales-qty-stepper .form-control {
  border-radius: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sales-qty-btn {
  display: grid;
  place-items: center;
  height: 38px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #16a34a;
  font-weight: 900;
}

.sales-qty-minus {
  color: #e11d48;
  border-radius: 6px 0 0 6px;
}

.sales-qty-plus {
  border-radius: 0 6px 6px 0;
}

.sales-price {
  min-width: 104px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.sales-cart-detail span,
.sales-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.sales-cart-detail {
  display: grid;
  grid-template-columns: minmax(240px, 34%) minmax(0, 1fr);
  gap: 8px;
  padding: 4px 10px 6px;
  background: #f8fafc;
  overflow: hidden;
}

.sales-line-discount-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  grid-column: 2;
}

.sales-line-note-box {
  grid-column: 1;
  min-width: 0;
}

.sales-invoice-discount-box {
  display: grid;
  grid-template-columns: auto minmax(110px, 140px) 18px minmax(150px, 1fr);
  align-items: start;
  gap: 8px;
}

.sales-tiered-discount {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.sales-discount-tier {
  display: grid;
  grid-template-columns: 22px minmax(76px, .85fr) 12px minmax(88px, 1fr) minmax(62px, auto);
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.sales-discount-tier-no {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
}

.sales-discount-tier-result {
  justify-self: end;
  color: #c2410c;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sales-discount-tier .input-group,
.sales-discount-tier .form-control {
  min-width: 0;
}

.sales-discount-tier .input-group-text {
  padding-inline: 6px;
}

.sales-line-discount-box strong {
  color: #334155;
  font-size: 12px;
  letter-spacing: 0;
  padding-top: 7px;
}

.sales-invoice-discount-box strong {
  color: #334155;
  font-size: 12px;
  letter-spacing: 0;
  padding-top: 10px;
}

.sales-discount-separator {
  display: inline-grid;
  place-items: center;
  min-height: 31px;
  color: #64748b;
  font-weight: 800;
}

.sales-discount-hint {
  min-height: 10px;
  margin-top: 2px;
  color: #c2410c;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
}

.sales-discount-hint:empty {
  min-height: 0;
  margin-top: 0;
}

.sales-line-note-box {
  width: 360px;
  max-width: 100%;
  margin-top: -6px;
}

.sales-line-note-box .form-label {
  margin-bottom: 2px;
}

.sales-cart-detail-row {
  display: none;
}

.sales-cart-detail-row.show-detail {
  display: table-row;
}

.purchase-cart-table-wrap {
  border-width: 2px;
}

.sales-cart-table.purchase-cart-table {
  font-size: 12px;
}

.sales-cart-table.purchase-cart-table thead th {
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
}

.sales-cart-table.purchase-cart-table td {
  padding: 3px 6px;
  line-height: 1.15;
}

.sales-cart-table.purchase-cart-table .sales-cart-search-row td {
  padding: 4px 6px;
}

.purchase-cart-table .input-group-sm > .form-control,
.purchase-cart-table .input-group-sm > .btn,
.purchase-cart-table .input-group-sm > .input-group-text,
.purchase-cart-table .form-control-sm {
  min-height: 26px;
  padding-top: 2px;
  padding-bottom: 2px;
  font-size: 12px;
}

.purchase-cart-table .sales-line-code {
  max-width: 74px;
  margin-right: 4px;
  font-size: 10px;
}

.purchase-cart-table .sales-line-name {
  max-width: calc(100% - 106px);
  font-size: 12px;
  line-height: 1.08;
  max-height: 2.16em;
}

.purchase-cart-table .sales-line-detail-toggle {
  width: 24px;
  height: 24px;
  margin-left: 2px;
  font-size: 11px;
}

.purchase-cart-table .sales-line-inline-info {
  margin-left: 2px;
}

.purchase-cart-table .sales-line-note-info,
.purchase-cart-table .sales-line-discount-info {
  min-height: 18px;
  padding: 1px 5px;
  font-size: 10px;
  line-height: 1.05;
}

.purchase-cart-table .sales-qty-cell {
  min-width: 120px;
}

.purchase-cart-table .sales-qty-wrap {
  grid-template-columns: minmax(88px, 1fr) auto;
  gap: 4px;
}

.purchase-cart-table .sales-qty-stepper {
  grid-template-columns: 26px minmax(36px, 1fr) 26px;
}

.purchase-cart-table .sales-qty-btn {
  height: 26px;
  font-size: 11px;
}

.purchase-cart-table .sales-line-meta {
  font-size: 10px !important;
}

.purchase-cart-table .sales-price {
  min-width: 86px;
}

.purchase-cart-table .sales-line-remove {
  padding: 0 3px;
  font-size: 12px;
}

.purchase-ag2-table.purchase-cart-table {
  font-size: 14px;
}

.purchase-ag2-table.purchase-cart-table thead th {
  font-size: 13px;
}

.purchase-ag2-table.purchase-cart-table th:nth-child(1),
.purchase-ag2-table.purchase-cart-table td:nth-child(1) {
  width: 5%;
  min-width: 52px;
  max-width: 5%;
}

.purchase-ag2-table.purchase-cart-table th:nth-child(2),
.purchase-ag2-table.purchase-cart-table td:nth-child(2) {
  width: 57%;
  min-width: 300px;
}

.purchase-ag2-table.purchase-cart-table th:nth-child(3),
.purchase-ag2-table.purchase-cart-table td:nth-child(3) {
  width: 8%;
  min-width: 72px;
  max-width: 8%;
}

.purchase-ag2-table.purchase-cart-table th:nth-child(4),
.purchase-ag2-table.purchase-cart-table td:nth-child(4) {
  width: 5%;
  min-width: 48px;
}

.purchase-ag2-table.purchase-cart-table th:nth-child(5),
.purchase-ag2-table.purchase-cart-table td:nth-child(5),
.purchase-ag2-table.purchase-cart-table th:nth-child(6),
.purchase-ag2-table.purchase-cart-table td:nth-child(6) {
  width: 7%;
  min-width: 56px;
}

.purchase-ag2-table.purchase-cart-table th:nth-child(7),
.purchase-ag2-table.purchase-cart-table td:nth-child(7) {
  width: 9%;
  min-width: 86px;
}

.purchase-ag2-table.purchase-cart-table th:nth-child(8),
.purchase-ag2-table.purchase-cart-table td:nth-child(8) {
  width: 2%;
  min-width: 28px;
  max-width: 2%;
}

.purchase-ag2-table.purchase-cart-table .purchase-ag2-row td {
  border-right: 1px solid #d9e1ea;
  border-bottom: 1px solid #d9e1ea;
  height: 24px;
  padding: 0 4px !important;
  font-size: 14px;
  line-height: 1.15;
}

.purchase-ag2-table.purchase-cart-table .purchase-ag2-row td:last-child {
  border-right: 0;
}

.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-line-code {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  margin-right: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #475569;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-line-detail-toggle {
  margin-left: 0;
}

.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .purchase-line-item-input,
.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-line-item-input,
.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .purchase-line-unit,
.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-line-unit,
.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-price,
.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-qty {
  min-height: 24px;
  height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  line-height: 1.2;
  padding-top: 0;
  padding-bottom: 0;
}

.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-qty-cell {
  min-width: 58px;
}

.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-qty-wrap {
  grid-template-columns: minmax(54px, 1fr);
  gap: 0;
}

.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-qty-stepper {
  grid-template-columns: clamp(16px, 2.4vw, 20px) minmax(24px, 1fr) clamp(16px, 2.4vw, 20px);
}

.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-qty-btn {
  height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: clamp(10px, 1.6vw, 12px);
}

.purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-price {
  min-width: 0;
}

.purchase-cart-table .sales-cart-detail {
  grid-template-columns: minmax(180px, 30%) minmax(0, 1fr);
  gap: 6px;
  padding: 3px 6px 4px;
}

.purchase-cart-table .sales-line-note-box {
  width: 300px;
  margin-top: -3px;
}

.purchase-cart-table .sales-discount-tier {
  grid-template-columns: 18px minmax(66px, .8fr) 10px minmax(78px, 1fr) minmax(54px, auto);
  gap: 3px;
}

.purchase-cart-table .sales-discount-tier-no {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

.purchase-cart-table .sales-line-discount-box strong,
.purchase-cart-table .sales-discount-tier-result,
.purchase-cart-table .sales-cart-detail span {
  font-size: 10px;
}

.sales-total-panel {
  flex: 0 0 auto;
}

.sales-total-panel .form-label {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
}

.sales-total-panel textarea {
  min-height: 44px;
}

.sales-summary-grid {
  display: grid;
  grid-template-columns: minmax(140px, .65fr) minmax(280px, 1fr);
  gap: 8px 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(231, 242, 235, .84);
  border: 3px solid rgba(16, 185, 129, .26);
}

.sales-summary-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sales-summary-info > div:not(.sales-summary-description):not(.sales-summary-count-card),
.sales-summary-amounts > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.sales-summary-info {
  justify-self: start;
  min-width: 190px;
  max-width: 300px;
}

.sales-summary-count-card {
  display: block;
  max-width: 300px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.sales-summary-count-card > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.sales-summary-amounts {
  justify-self: end;
  width: 100%;
  margin-right: 0;
}

.sales-summary-amounts > div {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(135px, 1fr) 28px;
  align-items: center;
  justify-content: end;
  text-align: right;
  column-gap: 6px;
}

.sales-summary-label {
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

.sales-summary-control {
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 20px;
}

.sales-summary-amounts strong {
  min-width: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.sales-summary-add {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
}

.sales-summary-check {
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}

.purchase-payment-row #purchasePaymentAmount {
  justify-self: end;
  width: min(116px, 100%);
  min-width: 0;
  height: 30px;
}

.purchase-payment-row #salesBackofficePaymentAmount {
  justify-self: end;
  width: min(116px, 100%);
  min-width: 0;
  height: 24px;
}

.sales-redesign .purchase-payment-row .sales-summary-control {
  display: grid;
}

.purchase-payment-account-btn {
  margin-left: 0;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  min-width: 24px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  border-radius: 4px;
  padding: 0;
  line-height: 1;
}

.sales-payment-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.sales-payment-method-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 104px;
  padding: 10px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fff;
  color: #334155;
}

.sales-payment-method-card.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .14);
}

.sales-payment-method-image,
.payment-method-preview {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  overflow: hidden;
}

.sales-payment-method-image i,
.payment-method-preview i {
  font-size: 26px;
}

.sales-payment-method-image img,
.payment-method-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sales-payment-entry .input-group {
  max-width: 420px;
  margin-left: auto;
}

.sales-split-list {
  display: grid;
  gap: 8px;
}

.sales-split-row {
  display: grid;
  grid-template-columns: 36px minmax(110px, auto) 1fr 28px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.sales-split-logo {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff;
  color: #1d4ed8;
  overflow: hidden;
}

.sales-split-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.payment-method-setting-card {
  display: flex;
  gap: 12px;
  height: 100%;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.sales-summary-total {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 900;
}

.sales-summary-total .sales-summary-label {
  font-size: 16px;
  font-weight: 900;
}

.sales-summary-description {
  display: block !important;
  max-width: 300px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.sales-summary-description[hidden] {
  display: none !important;
}

.sales-summary-description span,
.sales-summary-description strong {
  display: block;
}

.sales-summary-description strong {
  margin-top: 2px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}

.sales-action-bar {
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px -14px -14px;
  padding: 10px 14px;
  border-top: 2px solid rgba(16, 185, 129, .22);
  border-radius: 0 0 8px 8px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 -10px 24px rgba(15, 23, 42, .06);
}

.sales-touch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  min-width: 104px;
  font-weight: 800;
  line-height: 1.1;
}

.sales-touch-btn:disabled,
.sales-touch-btn.disabled {
  pointer-events: none;
  opacity: .45;
  color: #64748b;
  border-color: #cbd5e1;
  background: #e5e7eb;
  box-shadow: none;
}

.sales-touch-btn:disabled:hover,
.sales-touch-btn.disabled:hover {
  color: #64748b;
  border-color: #cbd5e1;
  background: #e5e7eb;
}

.sales-help-btn {
  display: inline-grid;
  place-items: center;
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 8px;
  font-weight: 900;
}

.sales-shortcut-list {
  display: grid;
  gap: 10px;
}

.sales-shortcut-list > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.sales-shortcut-list kbd {
  min-width: 34px;
  text-align: center;
}

.sales-shortcut-list span {
  margin-left: 4px;
}

.sales-action-total {
  display: grid;
  align-content: center;
  justify-items: end;
  min-height: 58px;
  min-width: 150px;
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 8px;
  background: #082f49;
  color: #fff;
}

.sales-action-total span {
  font-size: 12px;
  font-weight: 700;
}

.sales-action-total strong {
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.sales-fullscreen-active .sidebar,
.sales-fullscreen-active .topbar,
.sales-fullscreen-active .app-footer {
  display: none !important;
}

.sales-fullscreen-active .main-content {
  padding: 14px;
}

.sales-fullscreen-active .sales-pos-page {
  grid-template-columns: minmax(640px, 1.25fr) minmax(560px, 1fr);
  height: calc(100vh - 132px);
  min-height: 620px;
}

.sales-fullscreen-active .sales-pos-page.sales-input-backoffice {
  grid-template-columns: minmax(0, 1fr);
}

.sales-fullscreen-active .sales-catalog-panel,
.sales-fullscreen-active .sales-cart-panel {
  max-height: calc(100vh - 132px);
}

.print-only {
  display: none;
}

@media (max-width: 1180px) {
  .main-content {
    padding-inline: 16px;
  }

  .sales-pos-page {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: auto;
    overflow: visible;
    padding: 8px;
  }

  .sales-catalog-panel,
  .sales-cart-panel {
    min-height: auto;
    max-height: none;
  }

  .sales-input-touchscreen .sales-catalog-panel {
    order: 1;
  }

  .sales-input-touchscreen .sales-cart-panel {
    order: 2;
  }

  .sales-item-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 148px;
    max-height: none;
  }

  .sales-item-card {
    grid-template-rows: 56px minmax(38px, auto) 18px;
    height: 148px;
  }

  .sales-item-image {
    height: 56px;
  }

  .sales-panel-head {
    flex-wrap: wrap;
  }

  .sales-panel-head > div,
  .sales-panel-head form,
  .sales-panel-head .form-control {
    width: 100%;
    max-width: none;
  }

  .sales-cart-table {
    min-width: 700px;
  }

  .sales-summary-grid {
    grid-template-columns: minmax(160px, .55fr) minmax(300px, 1fr);
  }

  .sales-payment-method-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sales-action-bar {
    flex-wrap: wrap;
  }

  .sales-touch-btn {
    flex: 1 1 132px;
    min-width: 0;
  }

  .payment-method-setting-card {
    flex-direction: column;
  }

  .purchase-redesign {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .purchase-redesign-panel {
    grid-template-rows: auto minmax(420px, 1fr) auto auto;
  }

  .purchase-redesign-header .purchase-compact-head {
    grid-template-columns: 1fr;
  }

  .purchase-redesign-header .sales-customer-summary {
    max-height: 140px;
  }

  .purchase-redesign-detail {
    min-height: 420px;
  }
}

@media (max-width: 991.98px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    background: var(--soft);
  }
  .sidebar {
    display: none;
  }
  .main-content {
    padding: 18px;
  }
  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .app-footer {
    flex-direction: column;
  }
  .sales-pos-page {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
    overflow: visible;
  }
  .sales-cart-panel,
  .sales-catalog-panel {
    order: initial;
    max-height: none;
  }
  .sales-catalog-panel,
  .sales-cart-panel {
    min-height: auto;
  }
  .sales-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 146px;
    max-height: none;
  }

  .sales-item-card {
    height: 146px;
  }
  .sales-summary-grid {
    grid-template-columns: 1fr;
  }
  .sales-summary-amounts {
    justify-self: stretch;
    width: 100%;
  }
  .sales-invoice-head {
    grid-template-columns: 1fr;
  }
  .sales-cart-detail {
    grid-template-columns: 1fr;
  }
  .sales-line-discount-box,
  .sales-line-note-box {
    grid-column: 1;
  }
  .sales-line-discount-box,
  .sales-discount-tier {
    grid-template-columns: 1fr;
  }
  .sales-discount-tier-no,
  .sales-discount-tier-result {
    justify-self: start;
  }
  .sales-cart-table {
    min-width: 620px;
  }
  .sales-action-bar {
    flex-wrap: wrap;
  }
  .sales-touch-btn {
    flex: 1 1 140px;
  }
  .sales-action-total {
    flex: 1 1 100%;
  }

  .purchase-redesign-panel {
    padding: 8px;
  }

  .purchase-ag2-detail-row .sales-cart-detail {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .main-content {
    padding: 12px;
  }

  .sales-pos-page {
    gap: 10px;
    padding: 6px;
  }

  .sales-catalog-panel,
  .sales-cart-panel {
    padding: 10px;
  }

  .sales-item-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    max-height: none;
  }

  .sales-item-card {
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-rows: minmax(38px, auto) 18px;
    align-items: center;
    min-height: 82px;
    height: auto;
    padding: 8px;
  }

  .sales-item-image {
    grid-row: 1 / span 2;
    width: 58px;
    height: 58px;
    font-size: 24px;
  }

  .sales-item-name {
    min-height: auto;
    font-size: 13px;
  }

  .sales-item-meta {
    align-self: end;
  }

  .sales-invoice-fields {
    grid-template-columns: 1fr;
  }

  .sales-panel-head {
    gap: 8px;
  }

  .sales-catalog-panel .sales-panel-head .text-muted {
    display: none;
  }

  .sales-panel-head .btn,
  .sales-kind-tabs .btn {
    min-height: 38px;
  }

  .sales-summary-grid {
    padding: 8px;
  }

  .sales-summary-info {
    justify-self: stretch;
    min-width: 0;
    max-width: none;
  }

  .sales-summary-count-card,
  .sales-summary-description {
    max-width: none;
  }

  .sales-summary-amounts > div {
    grid-template-columns: minmax(86px, .8fr) minmax(112px, 1fr) 24px;
  }

  .sales-summary-label {
    font-size: 12px;
  }

  .sales-summary-total {
    font-size: 19px;
  }

  .purchase-payment-row .purchase-payment-wrap {
    width: 132px;
    margin-right: -20px;
    grid-template-columns: minmax(82px, 106px) 20px;
  }

  .sales-cart-table {
    min-width: 560px;
    font-size: 12px;
  }

  .sales-cart-table th,
  .sales-cart-table td {
    padding-inline: 6px;
  }

  .sales-line-code {
    max-width: 58px;
    font-size: 11px;
  }

  .sales-line-name {
    max-width: calc(100% - 88px);
  }

  .sales-action-bar {
    gap: 6px;
    margin-inline: -10px;
    padding: 8px 10px;
  }

  .sales-touch-btn {
    flex-basis: calc(50% - 6px);
    min-height: 40px;
    font-size: 13px;
  }

  .sales-help-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

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

  .sales-payment-method-card {
    min-height: 86px;
    padding: 8px;
  }

  .sales-payment-method-image,
  .payment-method-preview {
    width: 42px;
    height: 42px;
  }

  .sales-payment-entry .input-group {
    max-width: none;
  }

  .modal-dialog {
    margin: 8px;
  }

  .modal-body {
    max-height: calc(100dvh - 128px);
    overflow: auto;
  }

  .purchase-redesign {
    padding: 4px;
  }

  .purchase-redesign-panel {
    gap: 6px;
    padding: 6px;
  }

  .purchase-redesign .sales-form-section {
    padding: 8px;
  }

  .purchase-compact-field {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .purchase-redesign-detail {
    min-height: 360px;
  }

  .purchase-ag2-table {
    min-width: 760px;
  }

  .purchase-ag2-table th:nth-child(1),
  .purchase-ag2-table td:nth-child(1) {
    width: 5%;
    min-width: 52px;
    max-width: 5%;
  }

  .purchase-ag2-row .sales-line-code {
    width: 100%;
    max-width: 100%;
  }

  .purchase-ag2-table.purchase-cart-table th:nth-child(1),
  .purchase-ag2-table.purchase-cart-table td:nth-child(1) {
    width: 5%;
    min-width: 52px;
    max-width: 5%;
  }

  .purchase-ag2-table.purchase-cart-table th:nth-child(2),
  .purchase-ag2-table.purchase-cart-table td:nth-child(2) {
    width: 57%;
    min-width: 300px;
  }

  .purchase-ag2-table.purchase-cart-table th:nth-child(3),
  .purchase-ag2-table.purchase-cart-table td:nth-child(3) {
    width: 8%;
    min-width: 72px;
    max-width: 8%;
  }

  .purchase-ag2-table.purchase-cart-table th:nth-child(4),
  .purchase-ag2-table.purchase-cart-table td:nth-child(4) {
    width: 5%;
    min-width: 48px;
  }

  .purchase-ag2-table.purchase-cart-table th:nth-child(5),
  .purchase-ag2-table.purchase-cart-table td:nth-child(5),
  .purchase-ag2-table.purchase-cart-table th:nth-child(6),
  .purchase-ag2-table.purchase-cart-table td:nth-child(6) {
    width: 7%;
    min-width: 56px;
  }

  .purchase-ag2-table.purchase-cart-table th:nth-child(7),
  .purchase-ag2-table.purchase-cart-table td:nth-child(7) {
    width: 9%;
    min-width: 86px;
  }

  .purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-line-code {
    width: 100%;
    max-width: 100%;
    font-size: 14px;
    font-weight: 400;
  }

  .purchase-ag2-table.purchase-cart-table .purchase-ag2-row .purchase-line-item-input,
  .purchase-ag2-table.purchase-cart-table .purchase-ag2-row .purchase-line-unit,
  .purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-price,
  .purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-qty,
  .purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-line-discount-total,
  .purchase-ag2-table.purchase-cart-table .purchase-ag2-row .sales-line-total {
    font-size: 14px;
  }

  .purchase-redesign-footer .sales-summary-grid {
    grid-template-columns: 1fr;
  }

  .purchase-redesign-footer .sales-action-bar {
    margin-inline: -8px;
  }

  .purchase-redesign-actions {
    gap: 4px;
    margin-inline: 0;
    margin-block: 0 6px;
    padding: 1px 6px 5px;
  }

  .purchase-redesign-actions .sales-touch-btn {
    flex-basis: auto;
    min-height: 34px;
    height: 34px;
  }
}

@media (max-width: 640px) {
  .purchase-serial-entry {
    grid-template-columns: 1fr;
  }

  .purchase-ag2-wrap {
    overflow: auto;
  }

  .purchase-ag2-table {
    display: block;
    min-width: 0;
  }

  .purchase-ag2-table colgroup,
  .purchase-ag2-table thead {
    display: none;
  }

  .purchase-ag2-table tbody {
    display: grid;
    gap: 6px;
  }

  .purchase-ag2-table .purchase-ag2-row {
    display: grid;
    grid-template-columns: 56px minmax(58px, .8fr) minmax(62px, 1fr) minmax(62px, 1fr) minmax(82px, 1.1fr) 30px;
    border: 1px solid #d9e1ea;
    background: #fff;
  }

  .purchase-ag2-table .purchase-ag2-row td {
    display: flex;
    align-items: center;
    min-width: 0;
    width: auto !important;
    max-width: none !important;
    min-height: 32px;
    border-right: 1px solid #d9e1ea;
    border-bottom: 1px solid #d9e1ea;
  }

  .purchase-ag2-table .purchase-ag2-row td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .purchase-ag2-table .purchase-ag2-row td:nth-child(2) {
    grid-column: 2 / 7;
    grid-row: 1;
  }

  .purchase-ag2-table .purchase-ag2-row td:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
  }

  .purchase-ag2-table .purchase-ag2-row td:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
  }

  .purchase-ag2-table .purchase-ag2-row td:nth-child(5) {
    grid-column: 3;
    grid-row: 2;
  }

  .purchase-ag2-table .purchase-ag2-row td:nth-child(6) {
    grid-column: 4;
    grid-row: 2;
  }

  .purchase-ag2-table .purchase-ag2-row td:nth-child(7) {
    grid-column: 5;
    grid-row: 2;
  }

  .purchase-ag2-table .purchase-ag2-row td:nth-child(8) {
    grid-column: 6;
    grid-row: 2;
    justify-content: center;
    border-right: 0;
  }

  .purchase-ag2-table .purchase-ag2-row td:nth-child(3),
  .purchase-ag2-table .purchase-ag2-row td:nth-child(4),
  .purchase-ag2-table .purchase-ag2-row td:nth-child(5),
  .purchase-ag2-table .purchase-ag2-row td:nth-child(6),
  .purchase-ag2-table .purchase-ag2-row td:nth-child(7),
  .purchase-ag2-table .purchase-ag2-row td:nth-child(8) {
    border-bottom: 0;
  }

  .purchase-ag2-table .sales-qty-stepper {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .sales-item-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .sales-item-card {
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-rows: minmax(36px, auto) 17px;
    min-height: 76px;
    height: auto;
    padding: 7px;
  }

  .sales-item-image {
    width: 52px;
    height: 52px;
  }

  .sales-summary-amounts > div {
    grid-template-columns: minmax(74px, .7fr) minmax(96px, 1fr) 22px;
    column-gap: 4px;
  }

  .sales-summary-add,
  .sales-summary-check {
    width: 18px;
    height: 18px;
  }

  .purchase-payment-row .purchase-payment-wrap {
    width: 118px;
    margin-right: -16px;
    grid-template-columns: minmax(74px, 92px) 18px;
    gap: 5px;
  }

  .sales-cart-table {
    min-width: 520px;
  }

  .sales-payment-method-grid {
    grid-template-columns: 1fr;
  }

  .sales-payment-entry .input-group {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sales-payment-entry .input-group .btn {
    border-radius: 8px;
  }

  .sales-split-row {
    grid-template-columns: 32px minmax(92px, auto) 1fr 24px;
    gap: 6px;
  }
}

.compact-invoice-print {
  width: 210mm;
  max-width: 100%;
  min-height: 148mm;
  margin: 0 auto;
  padding: 20px 18px 14px !important;
  border: 0;
  color: #111827;
  background: #fff;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.compact-invoice-print.compact-invoice-paper-a4 {
  width: 210mm;
  min-height: 297mm;
}

.compact-invoice-print.compact-invoice-paper-a5 {
  width: 210mm;
  min-height: 148mm;
}

.compact-invoice-head {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 52%);
  gap: 24px;
  align-items: start;
  margin-bottom: 20px;
}

.compact-invoice-company {
  font-weight: 800;
  letter-spacing: 0;
}

.compact-invoice-meta > div,
.compact-invoice-code,
.compact-invoice-notes > div,
.compact-invoice-totals > div {
  display: grid;
  grid-template-columns: 118px 14px minmax(0, 1fr);
  gap: 6px;
  line-height: 1.35;
}

.compact-invoice-meta strong,
.compact-invoice-code strong,
.compact-invoice-notes strong,
.compact-invoice-totals strong {
  font-weight: 700;
}

.compact-invoice-address {
  display: block !important;
  margin-left: 144px;
  text-align: left;
  font-weight: 700;
}

.compact-invoice-code {
  width: 42%;
  margin-bottom: 6px;
}

.compact-invoice-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.compact-invoice-table th {
  border-top: 1px solid #303030;
  border-bottom: 1px solid #303030;
  padding: 4px 6px;
  font-weight: 800;
  text-align: left;
}

.compact-invoice-table td {
  padding: 3px 6px;
  vertical-align: top;
}

.compact-invoice-table .compact-no {
  width: 34px;
}

.compact-invoice-table .compact-qty {
  width: 78px;
  text-align: right;
}

.compact-invoice-table .compact-money {
  width: 92px;
  text-align: right;
}

.compact-line-note {
  color: #4b5563;
  font-size: 12px;
}

.compact-blank-row td {
  height: 32px;
}

.compact-invoice-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  border-top: 1px solid #303030;
  padding-top: 6px;
  margin-top: auto;
}

.compact-signatures {
  display: flex !important;
  gap: 72px;
  margin-top: 14px;
  text-align: center;
}

.compact-signatures > div {
  min-width: 120px;
}

.compact-signatures strong {
  display: block;
  min-height: 24px;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 700;
}

.compact-signatures span,
.compact-signatures small {
  display: block;
}

.compact-signature-footer,
.compact-invoice-signature-footer-wide {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.compact-signature-footer {
  max-width: 180px;
}

.compact-invoice-signature-footer-wide {
  width: 100%;
  max-width: none;
  text-align: left;
}

.compact-invoice-printed-at {
  margin-top: 2px;
  text-align: right;
  font-size: 11px;
  line-height: 1.2;
  color: #111827;
}

.compact-invoice-totals > div {
  grid-template-columns: 110px 14px minmax(0, 1fr);
}

.compact-invoice-totals strong {
  text-align: right;
}

.compact-invoice-notes > div:first-child strong {
  display: -webkit-box;
  max-height: 2.5em;
  overflow: hidden;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.compact-grand-total {
  margin-top: 4px;
}

.compact-invoice-footer {
  margin-top: 6px;
  font-weight: 800;
  line-height: 1.25;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }
  @page compact-invoice-page {
    size: A4 portrait;
    margin: 2mm;
  }
  @page compact-invoice-a4-page {
    size: A4 portrait;
    margin: 2mm;
  }
  @page compact-invoice-a5-page {
    size: A4 portrait;
    margin: 2mm;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11px;
  }
  .sidebar,
  .topbar,
  .no-print,
  .collapse,
  .dt-container .dt-search,
  .dt-container .dt-length,
  .dt-container .dt-info,
  .dt-container .dt-paging,
  .dt-container .dt-layout-row:not(.dt-layout-table),
  .dataTables_filter,
  .dataTables_length,
  .dataTables_info,
  .dataTables_paginate {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .content-wrap,
  .app-shell {
    display: block;
    min-height: auto;
    background: #fff;
  }
  .main-content {
    padding: 0;
  }
  .page-title {
    display: block;
    margin-bottom: 8px;
  }
  .page-title h1 {
    display: block;
    font-size: 18px;
    margin: 0 0 2px;
  }
  .page-title .text-muted {
    display: block;
    font-size: 10px;
    color: #000 !important;
    margin-bottom: 8px;
  }
  .panel,
  .stat-card {
    box-shadow: none;
    border: 0;
    padding: 0 !important;
    background: #fff;
  }
  .row.g-3.mb-3 {
    display: table;
    width: 100%;
    margin: 0 0 8px !important;
  }
  .row.g-3.mb-3 > [class*="col-"] {
    display: table-cell;
    width: auto;
    padding: 0 6px 0 0;
  }
  .stat-card {
    border: 1px solid #000 !important;
    padding: 5px 6px !important;
  }
  .stat-card .text-muted {
    color: #000 !important;
    font-size: 9px;
  }
  .stat-card .h4 {
    font-size: 13px;
    margin: 2px 0 0;
  }
  .table-responsive {
    overflow: visible !important;
  }
  .table {
    width: 100% !important;
    table-layout: fixed;
    border-collapse: collapse !important;
    font-size: 9px;
  }
  .table th,
  .table td {
    border: 1px solid #000 !important;
    padding: 4px 5px !important;
    vertical-align: top;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  .table thead th {
    background: #e5e5e5 !important;
    color: #000 !important;
    font-weight: 700;
    text-align: center;
  }
  .ledger-title {
    text-align: center;
    margin-bottom: 10px;
  }
  .ledger-title h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 2px;
    letter-spacing: 0;
  }
  .ledger-title div {
    font-size: 11px;
  }
  .ledger-table {
    width: 100% !important;
    table-layout: auto;
    border-collapse: collapse !important;
  }
  .ledger-table th,
  .ledger-table td {
    border: 1px solid #000 !important;
    padding: 5px 6px !important;
    vertical-align: top;
  }
  .ledger-table thead th {
    background: #e5e5e5 !important;
    color: #000 !important;
    font-weight: 700;
    text-align: center;
  }
  .ledger-table .badge {
    border: 0 !important;
    color: #000 !important;
    background: transparent !important;
    padding: 0;
  }
  .compact-invoice-print {
    width: 206mm;
    max-width: 206mm;
    min-height: 95mm;
    height: auto;
    border: 0 !important;
    padding: 5mm 5mm 3mm !important;
    font-size: 9.5pt;
    page-break-inside: avoid;
    overflow: hidden;
  }
  .compact-invoice-print.compact-invoice-paper-a4 {
    page: compact-invoice-a4-page;
    min-height: 293mm;
  }
  .compact-invoice-print.compact-invoice-paper-a5 {
    page: compact-invoice-a5-page;
    min-height: 146.5mm;
  }
  .compact-invoice-table,
  .compact-invoice-table th,
  .compact-invoice-table td {
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    background: #fff !important;
  }
  .compact-invoice-table th {
    border-top: 0.75pt solid #000 !important;
    border-bottom: 0.75pt solid #000 !important;
    color: #000 !important;
  }
  .compact-invoice-table {
    font-size: 9pt;
  }
  .compact-invoice-table .compact-no {
    width: 8mm;
  }
  .compact-invoice-table .compact-qty {
    width: 18mm;
    text-align: right;
  }
  .compact-invoice-table .compact-money {
    width: 24mm;
    text-align: right;
  }
  .compact-blank-row td {
    height: 4.5mm;
  }
  .compact-invoice-bottom {
    border-top: 0.75pt solid #000 !important;
    margin-top: auto !important;
  }
  .compact-signatures strong {
    font-size: 8pt;
    line-height: 1.1;
  }
  .compact-invoice-head {
    margin-bottom: 5mm;
  }
  .compact-invoice-code {
    margin-bottom: 2mm;
  }
  .compact-signatures {
    margin-top: 3mm;
  }
  .compact-invoice-footer {
    margin-top: 2mm;
  }
}
