﻿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 rgba(11, 125, 26, 0.35);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

:root {
  --avit-bg: #d6ffe1;
  --avit-panel: #e9fff1;
  --avit-border: #7bbf8b;
  --avit-accent: #0b7d1a;
  --avit-accent-dark: #075f12;
  --avit-text: #13401b;
  --avit-muted: #4b6f54;
  --avit-input: #f7fff9;
  --avit-hover: #e2f5e8;
  --avit-list-accent: #5dff87;
  --avit-list-accent-muted: #9bffb6;
  --avit-list-hover: #e4ffee;
}

body {
  background-color: var(--avit-bg);
  color: var(--avit-text);
}

.navbar {
  background-color: var(--avit-panel) !important;
  border-bottom: 1px solid var(--avit-border) !important;
}

@media (min-width: 576px) {
  .navbar > .container {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
  }

  .navbar-collapse {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-basis: auto !important;
    flex-wrap: nowrap !important;
  }

  .navbar-brand {
    margin-right: 1rem;
    white-space: nowrap;
  }

  .navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.15rem;
    margin-right: auto;
  }

  .navbar-nav .nav-link {
    white-space: nowrap;
  }
}

.navbar-brand,
.navbar-nav .nav-link {
  color: var(--avit-text) !important;
  font-size: 1.1rem;
}

.navbar-brand {
  font-size: 1.2rem;
  font-weight: 600;
}

.navbar-shortcuts-wrapper {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding-left: 1rem;
}

.navbar-shortcuts-wrapper:empty {
  display: none;
}

.navbar-shortcuts {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-initial-badge {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0d6efd;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid #0a58ca;
  text-transform: uppercase;
}

.dashboard-logo {
  margin: 0 0 0.5rem;
}

.dashboard-logo img {
  height: 64px;
  width: auto;
  max-width: 100%;
  display: inline-block;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  color: var(--avit-accent-dark) !important;
}

@media (hover: hover) and (pointer: fine) {
  .navbar .dropdown:hover > .dropdown-menu {
    display: block;
  }

  .navbar .dropdown:hover > .dropdown-toggle {
    color: var(--avit-accent-dark) !important;
  }

  .navbar .dropdown-menu {
    margin-top: 0;
  }

  .navbar .dropdown-submenu:hover > .dropdown-menu {
    display: block;
  }
}

.navbar .dropdown-submenu .dropdown-menu {
  top: 0;
  left: 100%;
  margin-left: 0.1rem;
}

.card,
.table,
.table > :not(caption) > * > * {
  background-color: var(--avit-panel);
}

.table {
  border-color: var(--avit-border);
}

.table th,
.table td {
  border-color: var(--avit-border);
}

.form-control,
.form-select {
  background-color: var(--avit-input);
  border-color: var(--avit-border);
  color: var(--avit-text);
}

.form-check-input {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--avit-accent);
  background-color: var(--avit-input);
}

.form-check-input:checked {
  background-color: var(--avit-accent);
  border-color: var(--avit-accent-dark);
}

.table input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid var(--avit-accent);
  border-radius: 3px;
  background-color: var(--avit-input);
  position: relative;
}

.table input[type="checkbox"]:checked {
  background-color: var(--avit-accent);
  border-color: var(--avit-accent-dark);
}

.table input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.05rem;
  width: 0.2rem;
  height: 0.45rem;
  border: solid #ffffff;
  border-width: 0 0.12rem 0.12rem 0;
  transform: rotate(45deg);
}

.table input[type="checkbox"][disabled] {
  opacity: 1;
  filter: none;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.page-header h1 {
  margin: 0;
}

.page-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.page-toolbar form {
  margin: 0;
}

.page-toolbar .form-check {
  margin: 0;
}

.alert-success {
  background-color: var(--avit-panel);
  border-color: var(--avit-border);
  color: var(--avit-text);
  border-left: 4px solid var(--avit-accent);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: 1px solid var(--avit-border);
  color: var(--avit-accent);
  background-color: var(--avit-input);
  text-decoration: none;
}

.icon-button:hover,
.icon-button:focus {
  color: #ffffff;
  background-color: var(--avit-accent);
  border-color: var(--avit-accent-dark);
}

.icon-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  color: var(--avit-text);
  background-color: var(--avit-panel);
  border-color: var(--avit-border);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.footer {
  margin-top: auto;
  padding-top: 0.585rem;
  padding-bottom: 0.585rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1;
}

main[role="main"] {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--avit-accent);
  box-shadow: 0 0 0 0.2rem rgba(11, 125, 26, 0.2);
}

.btn-primary {
  background-color: var(--avit-accent);
  border-color: var(--avit-accent);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--avit-accent-dark);
  border-color: var(--avit-accent-dark);
}

.btn-outline-primary {
  color: var(--avit-accent);
  border-color: var(--avit-accent);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: #ffffff;
  background-color: var(--avit-accent);
  border-color: var(--avit-accent);
}

.btn-outline-secondary {
  color: var(--avit-text);
  border-color: var(--avit-border);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  color: #ffffff;
  background-color: var(--avit-accent);
  border-color: var(--avit-accent);
}

.border,
.border-top,
.border-bottom {
  border-color: var(--avit-border) !important;
}

.text-muted {
  color: var(--avit-muted) !important;
}

.action-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.action-icons .action-icon {
  color: var(--avit-accent-dark);
  text-decoration: none;
}

.action-icons button.action-icon {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.action-icons .action-icon:hover,
.action-icons .action-icon:focus {
  color: var(--avit-accent);
}

.action-icons .action-icon.delete {
  color: #a61b1b;
}

.action-icons .action-icon.delete:hover,
.action-icons .action-icon.delete:focus {
  color: #d12b2b;
}

.action-icons svg {
  width: 16px;
  height: 16px;
  display: block;
}

.x-square-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--avit-accent-dark);
  border-radius: 6px;
  background-color: var(--avit-input);
  color: var(--avit-accent-dark);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
}

.x-square-button:hover,
.x-square-button:focus {
  background-color: var(--avit-accent);
  border-color: var(--avit-accent-dark);
  color: #ffffff;
}

#template-items-table td.template-remove-cell {
  vertical-align: middle;
}

#template-items-table td.template-remove-cell .x-square-button {
  width: 26px;
  height: 26px;
  font-size: 0.9rem;
  border-width: 1.5px;
}

.allocation-removed td {
  opacity: 0.6;
  text-decoration: line-through;
}

.transaction-search {
  padding-left: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%237bbf8b'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.868-3.834zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
  background-size: 1rem 1rem;
}

.table-scroll {
  max-height: calc(100vh - 260px);
  overflow: auto;
  border: 1px solid var(--avit-border);
  border-radius: 6px;
  background-color: var(--avit-panel);
}

.credit-notes-scroll {
  max-height: calc(100vh - 320px);
}

.table-scroll .table {
  margin-bottom: 0;
}

.dashboard-scroll {
    max-height: calc(clamp(220px, 35vh, 320px) - 48px);
  background-color: #0b0b0b;
  color: var(--avit-list-accent);
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
}

.dashboard-scroll-body {
    height: calc(clamp(220px, 35vh, 320px) - 48px);
    max-height: calc(clamp(220px, 35vh, 320px) - 48px);
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.dashboard-scroll-body {
  scrollbar-color: var(--avit-list-accent) #0b0b0b;
  scrollbar-width: thin;
}

.dashboard-scroll-body::-webkit-scrollbar {
  width: 12px;
}

.dashboard-scroll-body::-webkit-scrollbar-track {
  background: #0b0b0b;
}

.dashboard-scroll-body::-webkit-scrollbar-thumb {
  background-color: var(--avit-list-accent);
  border-radius: 8px;
  border: 3px solid #0b0b0b;
}

.dashboard-metric {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--avit-border);
  text-align: center;
}

.dashboard-metric-title {
    background-color: var(--avit-accent);
    color: #ffffff;
    font-weight: 600;
    padding: 0.38rem 0.75rem;
}

.dashboard-metric-value {
    background-color: #0b0b0b;
    color: var(--avit-list-accent);
    font-size: 2rem;
    font-weight: 600;
    padding: 0.72rem 0.75rem;
}

.dashboard-metric-link {
  display: block;
  text-decoration: none;
  color: var(--avit-list-accent-muted);
}

.dashboard-metric-link:hover,
.dashboard-metric-link:focus {
  color: var(--avit-list-accent);
}

.dashboard-scroll .table {
  margin-bottom: 0;
  background-color: transparent;
  color: inherit;
}

.dashboard-scroll .table > :not(caption) > * > * {
    border-color: transparent;
    background-color: transparent;
    color: inherit;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.dashboard-task-table {
  table-layout: fixed;
  width: 100%;
}

.dashboard-task-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-task-table .dashboard-date-col {
  width: 90px;
}

.dashboard-task-table .dashboard-customer-col {
  width: 35%;
}

.dashboard-task-table .dashboard-issue-col {
  width: 55%;
}

.dashboard-invoice-table {
  table-layout: fixed;
  width: 100%;
}

.dashboard-invoice-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-invoice-table .dashboard-invoice-number-col {
  width: 80px;
}

.dashboard-invoice-table .dashboard-date-col {
  width: 90px;
}

.dashboard-invoice-table .dashboard-amount-col {
  width: 90px;
}

.dashboard-scroll tbody tr {
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease;
    line-height: 1.2;
}

.dashboard-scroll tbody tr:hover {
  color: var(--avit-list-accent);
}

.dashboard-scroll tbody tr:hover td {
  background-color: var(--avit-list-hover);
  background-color: color-mix(in srgb, var(--avit-list-hover) 35%, #0b0b0b);
  color: inherit;
}

.dashboard-scroll a {
  color: var(--avit-list-accent);
}

.dashboard-scroll a:hover,
.dashboard-scroll a:focus {
    color: var(--avit-list-accent-muted);
}

.dashboard-scroll .table td.invoice-age-good {
    color: #7dff9a;
}

.dashboard-scroll .table td.invoice-age-warn {
    color: #ffd166;
}

.dashboard-scroll .table td.invoice-age-bad {
    color: #ff6b6b;
}

.dashboard-list-title {
    background-color: var(--avit-accent);
  color: #ffffff;
  padding: 0.45rem 0.75rem;
  border-radius: 6px 6px 0 0;
  margin: 0;
  font-weight: 600;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 3;
}

.dashboard-chart {
  background-color: #0b0b0b;
  color: var(--avit-list-accent);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--avit-border);
}

.dashboard-chart-title {
  background-color: var(--avit-accent);
  color: #ffffff;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
  text-align: center;
}

.dashboard-chart-body {
  padding: 0.65rem 0.75rem 0.85rem;
  height: clamp(160px, 24vh, 220px);
}

.dashboard-chart-body canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.news-ticker {
  width: 100%;
  margin-top: auto;
  background-color: #0b0b0b;
  color: var(--avit-list-accent);
  border-top: 1px solid var(--avit-border);
  border-bottom: 1px solid var(--avit-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem;
  min-height: 40px;
  overflow: hidden;
}

.news-ticker-label {
    background-color: #ffeb3b;
    color: #111111;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  white-space: nowrap;
}

.news-ticker-viewport {
  overflow: hidden;
  flex: 1;
}

.news-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 2rem;
  width: max-content;
  white-space: nowrap;
  animation: news-ticker-scroll 144s linear infinite;
  will-change: transform;
}

.news-ticker:hover .news-ticker-track {
  animation-play-state: paused;
}

.news-ticker-item {
  color: var(--avit-list-accent-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
}

.news-ticker-title::after {
  content: "     ";
  white-space: pre;
}

.news-ticker-item:hover,
.news-ticker-item:focus {
  color: var(--avit-list-accent);
}

.news-ticker-source {
  font-size: 0.8rem;
  color: #ff4d4d;
  opacity: 0.85;
}

@keyframes news-ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-ticker-track {
    animation: news-ticker-scroll 144s linear infinite;
  }

  .news-ticker-viewport {
    overflow-x: hidden;
  }
}

.dashboard-empty {
  padding: 0.6rem 0.75rem 0.7rem;
}

.dashboard-truncate {
  max-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-date-col {
  width: 90px;
  white-space: nowrap;
}

.dashboard-customer-col {
  width: 30%;
}

.dashboard-issue-col {
  width: 70%;
}

.metrics-panel {
  height: clamp(345.6px, 51.84vh, 460.8px);
}

.metrics-chart-panel {
  display: flex;
  flex-direction: column;
}

.metrics-chart-panel canvas {
  width: 100% !important;
  height: 100% !important;
}

.metrics-page {
  margin-bottom: -2.1rem;
}

.metrics-table-scroll {
  max-height: 100%;
}

.transaction-row-link {
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.transaction-row-link:hover td {
  background-color: var(--avit-hover);
}

.manual-revision-table {
  table-layout: fixed;
}

.manual-revision-entity-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-menu {
  position: fixed;
  z-index: 1080;
  width: max-content;
  background-color: var(--avit-panel);
  border: 1px solid var(--avit-border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(8, 57, 18, 0.18);
  padding: 0.35rem 0;
  display: none;
}

.context-menu.show {
  display: block;
}

.context-menu-item {
  display: block;
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.45rem 0.9rem;
  color: var(--avit-text);
  font-size: 0.95rem;
  white-space: nowrap;
  width: 100%;
  box-sizing: border-box;
}

.context-menu-item:hover,
.context-menu-item:focus {
  background-color: rgba(11, 125, 26, 0.12);
  color: var(--avit-accent-dark);
}

.context-menu-item:disabled {
  color: #9bb5a3;
  cursor: not-allowed;
}


.transaction-history-scroll {
  --transaction-scrollbar-size: 12px;
  height: clamp(351px, 60.75vh, 567px);
  max-height: clamp(351px, 60.75vh, 567px);
  border-radius: 8px;
  background-color: var(--avit-panel);
  border: 1px solid var(--avit-border);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.transaction-history-scroll--short {
  height: clamp(309px, calc(60.75vh - 42px), 525px);
  max-height: clamp(309px, calc(60.75vh - 42px), 525px);
}

.transaction-history-header {
  background-color: var(--avit-accent-dark);
  color: #ffffff;
  padding-right: var(--transaction-scrollbar-size);
}

.transaction-history-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  scrollbar-color: var(--avit-accent) var(--avit-panel);
  scrollbar-width: thin;
}

.transaction-history-scroll-body::-webkit-scrollbar {
  width: 12px;
}

.transaction-history-scroll-body::-webkit-scrollbar-track {
  background: var(--avit-panel);
}

.transaction-history-scroll-body::-webkit-scrollbar-thumb {
  background-color: var(--avit-accent);
  border-radius: 8px;
  border: 3px solid var(--avit-panel);
}

.transaction-history-table {
  background-color: transparent;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 0;
  table-layout: fixed;
  width: 100%;
}

.transaction-history-header-table thead th {
  background-color: var(--avit-accent-dark) !important;
  color: #ffffff !important;
  border-bottom: 1px solid var(--avit-border);
}

.transaction-history-header-table thead th:first-child {
  border-top-left-radius: 8px;
}

.transaction-history-header-table thead th:last-child {
  border-top-right-radius: 8px;
}

.transaction-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.transaction-sort-indicator {
  font-size: 0.95rem;
  line-height: 1;
}

.transaction-history-header-table thead th:first-child .transaction-sort-button {
  margin-left: 1ch;
  font-weight: 700;
}

.transaction-history-body-table > :not(caption) > tbody > * > * {
  background-color: transparent;
}

.transaction-history-totals {
  justify-content: flex-end;
}

.transaction-history-total-col {
  flex: 0 0 16%;
  max-width: 16%;
}

.transaction-history-total-box .aging-value {
  padding-top: 0.575rem;
  padding-bottom: 0.575rem;
}

@media (max-width: 991.98px) {
  .transaction-history-total-col {
    flex: 0 0 40%;
    max-width: 40%;
  }
}

@media (max-width: 575.98px) {
  .transaction-history-total-col {
    flex: 0 0 80%;
    max-width: 80%;
  }
}


.table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--avit-accent);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
}

.table thead th:first-child {
  text-align: left;
}

.th-left {
  text-align: left !important;
}

.th-center {
  text-align: center !important;
}

.th-right {
  text-align: right !important;
}

.amount-col {
  text-align: right !important;
}

th.amount-col {
  text-align: center !important;
}

.invoice-create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "left-top ."
    "left-bottom right";
  gap: 24px;
}

.invoice-left-top {
  grid-area: left-top;
}

.invoice-left-bottom {
  grid-area: left-bottom;
}

.invoice-right {
  grid-area: right;
}

.invoice-create-grid .form-group {
  margin-bottom: 1rem;
}

.invoice-create-grid .form-group > label {
  font-size: 1.25rem;
  font-weight: 500;
}

.no-spinner::-webkit-inner-spin-button,
.no-spinner::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.no-spinner {
  -moz-appearance: textfield;
  appearance: textfield;
}

@media (max-width: 991.98px) {
  .invoice-create-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left-top"
      "left-bottom"
      "right";
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.db-explorer-results {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--avit-border);
  border-radius: 6px;
  background-color: var(--avit-panel);
}

.db-explorer-results .table {
  margin-bottom: 0;
}

.db-explorer-results td.editable-cell.editing {
  background-color: var(--avit-input);
}

.db-explorer-results td.changed {
  outline: 2px solid var(--avit-accent);
  outline-offset: -2px;
}

.db-explorer-results td.pk-cell {
  background-color: var(--avit-hover);
  font-weight: 600;
}

.db-explorer-results tr.row-deleted td {
  opacity: 0.5;
  text-decoration: line-through;
}

.legacy-progress-dialog {
  max-width: 620px;
}

.truncate-one-line {
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-name-truncate {
  max-width: 280px;
}

.header-sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.header-sort-link:hover,
.header-sort-link:focus {
  color: inherit;
  text-decoration: none;
}

.sort-indicator {
  font-size: 0.9em;
  line-height: 1;
}

.job-create-mileage-input {
  width: 15%;
  min-width: 6rem;
}

.job-create-field-60 {
  width: 60%;
  max-width: 100%;
}

.job-create-issue-field {
  width: 84%;
  max-width: 100%;
}

.job-create-mileage-onsite {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.job-create-onsite-check {
  margin-bottom: 0.35rem;
}

@media (max-width: 991.98px) {
  .job-create-field-60 {
    width: 100%;
  }

  .job-create-issue-field {
    width: 100%;
  }
}

.invoice-number-col {
  width: 110px;
  min-width: 110px;
  white-space: nowrap;
}

.invoice-table-scroll {
  max-height: var(--invoice-list-max-height, calc(100vh - 420px));
}

.statement-table-scroll {
  max-height: var(--statement-list-max-height, calc(100vh - 420px));
}

.customer-ledger-page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.customer-ledger-header {
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.customer-ledger-header h1 {
  margin-bottom: 0.35rem;
}

.customer-ledger-customer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.customer-ledger-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.2rem;
}

.customer-ledger-summary {
  flex: 0 0 auto;
  margin-bottom: 0.9rem;
}

.customer-ledger-scroll {
  --transaction-scrollbar-size: 12px;
  flex: 0 0 auto;
  height: clamp(320px, calc(100vh - 335px), 565px);
  max-height: clamp(320px, calc(100vh - 335px), 565px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--avit-border);
  border-radius: 8px;
  background-color: var(--avit-panel);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.customer-ledger-scroll .transaction-history-header {
  flex: 0 0 auto;
}

.customer-ledger-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  scrollbar-color: var(--avit-accent) var(--avit-panel);
  scrollbar-width: thin;
}

.customer-ledger-scroll-body::-webkit-scrollbar {
  width: 12px;
}

.customer-ledger-scroll-body::-webkit-scrollbar-track {
  background: var(--avit-panel);
}

.customer-ledger-scroll-body::-webkit-scrollbar-thumb {
  background-color: var(--avit-accent);
  border-radius: 8px;
  border: 3px solid var(--avit-panel);
}

.customer-ledger-table {
  background-color: transparent;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  margin-bottom: 0;
  width: 100%;
}

.customer-ledger-table + .customer-ledger-section-title,
.customer-ledger-empty + .customer-ledger-section-title {
  margin-top: 1rem;
}

.customer-ledger-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--avit-accent-dark) !important;
  color: #ffffff !important;
  border-bottom: 1px solid var(--avit-border);
}

.customer-ledger-table thead th:first-child {
  border-top-left-radius: 8px;
}

.customer-ledger-table thead th:last-child {
  border-top-right-radius: 8px;
}

.customer-ledger-table thead th:first-child .transaction-sort-button {
  font-weight: 700;
}

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

.customer-ledger-table > :not(caption) > tbody > * > * {
  background-color: transparent;
}

.customer-ledger-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-ledger-section-title {
  font-size: 1rem;
  line-height: 1.2;
  margin: 1rem 0.65rem 0.45rem;
  color: var(--avit-text);
}

.customer-ledger-empty {
  margin: 0;
  padding: 0.75rem 0.65rem;
}

.mileage-list-scroll {
  max-height: var(--mileage-list-max-height, calc(100vh - 460px));
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 42px;
}

.mileage-table {
  width: 100%;
  table-layout: fixed;
}

.mileage-table tbody tr {
  height: 42px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.mileage-table td {
  vertical-align: middle;
}

.statement-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.statement-table-scroll {
  flex: 1 1 auto;
}

.statement-aging {
  margin-top: auto;
}

.invoice-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.invoice-table-scroll {
  flex: 1 1 auto;
}

.invoice-aging {
  margin-top: auto;
}

.aging-box {
  position: relative;
  padding: 0 !important;
  overflow: hidden;
}

.aging-header {
  display: block;
  background-color: var(--avit-accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.4rem 0.75rem;
  margin: 0;
  text-align: center;
}

.aging-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--avit-text);
  padding: 0.75rem;
  text-align: center;
}

.mileage-claim-box .aging-value {
  padding: 0.75rem;
}

.mileage-summary-row {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.mileage-summary-col {
  width: clamp(180px, 11vw, 220px);
}

.mileage-summary-row .aging-box {
  display: flex;
  flex-direction: column;
  height: 107px;
}

.mileage-summary-row .aging-header {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mileage-summary-row .aging-value {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mileage-claim-input-group {
  width: 100%;
}

.mileage-claim-input-group .form-control,
.mileage-claim-input-group .input-group-text {
  font-size: 1.1rem;
  font-weight: 600;
}

.mileage-table th:nth-child(3),
.mileage-table td:nth-child(3) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.mileage-table th:nth-child(4) {
  text-align: left;
}

.mileage-table .mileage-issue-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mileage-date-input {
  width: 40%;
  min-width: 140px;
}

.mileage-entry-miles-input {
  width: 33.3333%;
  min-width: 120px;
}

@media (max-width: 767.98px) {
  .mileage-date-input {
    width: 100%;
    min-width: 0;
  }
}

.top-customers-grid {
  --top-customers-row-height: 44px;
  --top-customers-visible-rows: 6;
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 0.9rem;
  align-items: stretch;
}

.top-customers-box {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.top-customers-body {
  padding: 0;
  flex: 1 1 auto;
  height: calc(var(--top-customers-row-height) * var(--top-customers-visible-rows));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.top-customers-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.top-customers-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  box-sizing: border-box;
  height: var(--top-customers-row-height);
  padding: 0 0.35rem;
  border-bottom: 1px solid var(--avit-border);
}

.top-customers-item:last-child {
  border-bottom: 0;
}

.top-customers-rank {
  min-width: 2.1rem;
  font-weight: 700;
  color: var(--avit-muted);
  text-align: right;
}

.top-customers-name {
  min-width: 0;
  color: var(--avit-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-customers-name:hover,
.top-customers-name:focus {
  color: var(--avit-accent-dark);
  text-decoration: underline;
}

.top-customers-amount {
  white-space: nowrap;
  font-weight: 700;
  color: var(--avit-text);
}

.top-customers-empty {
  color: var(--avit-muted);
  padding: 0.75rem 0.35rem;
}

@media (max-width: 991.98px) {
  .top-customers-grid {
    grid-template-columns: 1fr;
  }
}

.loading-modal .modal-content {
  background-color: var(--avit-panel);
  border: 1px solid var(--avit-border);
}

.loading-modal .spinner-border {
  width: 3rem;
  height: 3rem;
}

.detail-section {
  margin-top: 0.5rem;
}

.detail-list {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0.6rem 1rem;
  margin: 0;
}

.detail-list dt {
  font-weight: 600;
  color: var(--avit-text);
  align-self: center;
}

.detail-list dd {
  margin: 0;
  background: #ffffff;
  border: 1px solid var(--avit-border);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  min-height: 2.2rem;
  display: flex;
  align-items: center;
  color: var(--avit-text);
}

.detail-list-compact dd {
  width: 520px;
  max-width: 100%;
}

.detail-list dd.detail-list-plain {
  background: transparent;
  border: none;
  padding: 0;
  min-height: auto;
  width: auto;
}

.detail-list-compact dd.detail-list-date {
  width: 120px;
  max-width: 120px;
  justify-self: start;
}

.detail-list-compact dd.detail-list-number {
    width: 15%;
    max-width: 120px;
    justify-self: start;
    padding-right: 0;
}

.detail-list dd a {
  color: var(--avit-accent-dark);
  text-decoration: none;
}

.detail-list dd a:hover,
.detail-list dd a:focus {
  text-decoration: underline;
}

.detail-list-input .form-control,
.detail-list-input .form-select {
  border: none;
  background: transparent;
  padding: 0;
  width: 100%;
  box-shadow: none;
}

.detail-list-input .detail-input-plain {
  resize: none;
}

.date-input-no-placeholder::-webkit-datetime-edit,
.date-input-no-placeholder::-webkit-datetime-edit-fields-wrapper,
.date-input-no-placeholder::-webkit-datetime-edit-text,
.date-input-no-placeholder::-webkit-datetime-edit-month-field,
.date-input-no-placeholder::-webkit-datetime-edit-day-field,
.date-input-no-placeholder::-webkit-datetime-edit-year-field {
  color: transparent;
}

.date-input-no-placeholder {
  color: transparent;
}

.date-input-no-placeholder:focus {
  color: inherit;
}

.date-input-no-placeholder:focus::-webkit-datetime-edit,
.date-input-no-placeholder:focus::-webkit-datetime-edit-fields-wrapper,
.date-input-no-placeholder:focus::-webkit-datetime-edit-text,
.date-input-no-placeholder:focus::-webkit-datetime-edit-month-field,
.date-input-no-placeholder:focus::-webkit-datetime-edit-day-field,
.date-input-no-placeholder:focus::-webkit-datetime-edit-year-field {
  color: inherit;
}

.date-input-no-placeholder.date-has-value {
  color: inherit;
}

.date-input-no-placeholder.date-has-value::-webkit-datetime-edit,
.date-input-no-placeholder.date-has-value::-webkit-datetime-edit-fields-wrapper,
.date-input-no-placeholder.date-has-value::-webkit-datetime-edit-text,
.date-input-no-placeholder.date-has-value::-webkit-datetime-edit-month-field,
.date-input-no-placeholder.date-has-value::-webkit-datetime-edit-day-field,
.date-input-no-placeholder.date-has-value::-webkit-datetime-edit-year-field {
  color: inherit;
}

.yearly-date-edit-input {
  position: relative;
  width: 8.2rem;
  min-width: 8.2rem;
  padding-right: 2.35rem;
}

.yearly-date-edit-input::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0.4rem;
  margin: 0;
  padding: 0;
}

.yearly-date-edit-input::-webkit-datetime-edit {
  padding-right: 0.2rem;
}

.detail-list-input .text-danger {
  margin-left: 0.5rem;
  font-size: 0.85rem;
}

.job-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 4.5rem;
  row-gap: 1.25rem;
  align-items: start;
}

.job-details-grid .detail-list {
  width: 100%;
}

.job-details-grid .detail-list dd {
  width: 100%;
  justify-self: stretch;
}

.job-details-grid .detail-list-compact dd.detail-list-date {
  width: 132px;
  max-width: 132px;
}

.job-details-grid .detail-list-compact dd.detail-list-number {
    width: 16.5%;
    max-width: 132px;
    padding-right: 0;
}

.detail-list.detail-list-right {
  grid-template-columns: 140px 1fr;
}

.detail-list.detail-list-right dd {
  width: 100%;
}

.customer-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 4rem;
  row-gap: 1.25rem;
  align-items: start;
}

.customer-details-grid .detail-list {
  width: 100%;
  grid-template-columns: 200px 1fr;
}

.customer-details-grid .detail-list dd {
  width: 100%;
  max-width: 520px;
  justify-self: start;
}

.customer-details-grid .detail-list dd.customer-field-compact {
  max-width: 130px;
}

.customer-details-grid .detail-list dd.customer-field-wide {
  max-width: 390px;
}

.customer-details-grid .detail-list dd.customer-field-narrow {
  max-width: 338px;
}

.invoice-id-taxpoint-row {
  display: flex;
  align-items: flex-end;
  gap: 0.9rem;
}

.invoice-id-taxpoint-item {
  display: flex;
  flex-direction: column;
}

.invoice-id-item {
  width: 25%;
  min-width: 120px;
}

.invoice-taxpoint-item {
  width: 45%;
  min-width: 150px;
}

.invoice-total-item {
  width: 30%;
  min-width: 120px;
}

.invoice-field-compact {
  width: 100%;
}

.invoice-field-wide {
  width: 80%;
  max-width: 100%;
}

.invoice-lines-scroll {
  --invoice-lines-header-height: 2.5rem;
  --invoice-lines-row-height: 2.5rem;
  --invoice-lines-visible-rows: 6;
  max-height: calc(
    var(--invoice-lines-header-height) +
    (var(--invoice-lines-row-height) * var(--invoice-lines-visible-rows))
  );
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--avit-border);
  border-radius: 8px;
}

.invoice-lines-scroll thead tr {
  height: var(--invoice-lines-header-height);
}

.invoice-lines-scroll tbody tr {
  height: var(--invoice-lines-row-height);
}

.invoice-lines-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: var(--avit-panel);
}

.invoice-lines-scroll thead th,
.invoice-lines-scroll tbody td {
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
  line-height: 1.25rem;
  white-space: nowrap;
}

.customer-tabs {
  margin-top: 0.15rem;
  border-bottom: 1px solid var(--avit-border);
}

.customer-tabs .nav-link {
  color: var(--avit-text);
  border: 1px solid transparent;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.customer-tabs .nav-link:hover,
.customer-tabs .nav-link:focus {
  border-color: var(--avit-border);
  background-color: var(--avit-hover);
}

.customer-tabs .nav-link.active {
  color: #ffffff;
  background-color: var(--avit-accent);
  border-color: var(--avit-accent-dark);
}

.customer-tab-content {
  --customer-doc-library-height: clamp(320px, 56vh, 540px);
  --customer-tab-matched-extra-height: 8rem;
  border: 1px solid var(--avit-border);
  border-top: none;
  background-color: var(--avit-panel);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  padding: 0.85rem 1rem 1rem;
}

.customer-tab-content .detail-section {
  margin: 0;
}

#customer-info-pane .detail-section {
  min-height: calc(var(--customer-doc-library-height) + var(--customer-tab-matched-extra-height));
}

.customer-doc-pathbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.customer-doc-path-label {
  font-weight: 600;
  color: var(--avit-muted);
}

.customer-doc-path-link {
  color: var(--avit-accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.customer-doc-path-link:hover,
.customer-doc-path-link:focus-visible {
  text-decoration: underline;
}

.customer-doc-path-sep {
  color: var(--avit-muted);
}

.customer-doc-up-link {
  margin-left: auto;
}

.customer-doc-folder-form {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0;
}

.customer-doc-action-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.customer-doc-upload-form {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0;
}

.customer-doc-dropzone {
  border: 2px dashed var(--avit-border);
  border-radius: 8px;
  background-color: var(--avit-input);
  padding: 0.72rem 1rem;
  text-align: center;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.customer-doc-dropzone:hover,
.customer-doc-dropzone:focus-visible,
.customer-doc-dropzone.is-dragover {
  border-color: var(--avit-accent);
  background-color: var(--avit-hover);
  box-shadow: 0 0 0 3px rgba(11, 125, 26, 0.14);
  outline: none;
}

.customer-doc-dropzone-title {
  font-weight: 700;
  color: var(--avit-text);
  line-height: 1.15;
}

.customer-doc-dropzone-subtitle {
  color: var(--avit-muted);
  font-size: 0.84rem;
  line-height: 1.15;
}

.customer-doc-dropzone-status {
  margin-top: 0.32rem;
  color: var(--avit-accent-dark);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.15;
}

.customer-doc-library-scroll {
  border: 1px solid var(--avit-border);
  border-radius: 8px;
  background-color: var(--avit-input);
  height: var(--customer-doc-library-height);
  overflow: auto;
  padding: 1rem;
}

.customer-doc-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
}

.customer-doc-card {
  border: 1px solid var(--avit-border);
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--avit-panel);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.customer-doc-card:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: var(--avit-accent);
  box-shadow: 0 10px 18px rgba(8, 57, 18, 0.18);
}

.customer-doc-folder-card {
  display: block;
  border: 1px solid var(--avit-border);
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--avit-panel);
  text-decoration: none;
  color: inherit;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.customer-doc-folder-card:hover,
.customer-doc-folder-card:focus-visible {
  transform: translateY(-2px) scale(1.01);
  border-color: var(--avit-accent);
  box-shadow: 0 10px 18px rgba(8, 57, 18, 0.18);
}

.customer-doc-folder-thumb {
  background: linear-gradient(140deg, #f8fbeb, #e6f3dc);
}

.customer-doc-folder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 36px;
  border-radius: 999px;
  padding: 0 0.8rem;
  background: linear-gradient(135deg, #b08f23, #8a6e15);
  color: #fff;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.customer-doc-card.is-selected {
  border-color: var(--avit-accent-dark);
  box-shadow: 0 0 0 2px rgba(11, 125, 26, 0.2);
}

.customer-doc-card-button {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.customer-doc-thumb {
  height: 128px;
  border-bottom: 1px solid var(--avit-border);
  background: linear-gradient(140deg, var(--avit-hover), var(--avit-input));
  display: flex;
  align-items: center;
  justify-content: center;
}

.customer-doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.customer-doc-thumb iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  background-color: #ffffff;
}

.customer-doc-pdf-thumb {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 0.4rem;
  text-align: center;
  background:
    linear-gradient(160deg, #f6f8f7 0%, #e8efeb 100%);
}

.customer-doc-pdf-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 64px;
  margin: 0 auto;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background-color: #c73232;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 0.82rem;
}

.customer-doc-pdf-hint {
  color: var(--avit-muted);
  font-size: 0.82rem;
}

.customer-doc-text-thumb {
  width: 100%;
  height: 100%;
  padding: 0.6rem;
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow: hidden;
  color: var(--avit-text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 65%, rgba(244, 250, 246, 0.95) 100%),
    #f8fcf9;
}

.customer-doc-office-thumb {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.35rem;
}

.customer-doc-office-badge {
  justify-self: start;
  font-size: 0.68rem;
  font-weight: 700;
  color: #ffffff;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  letter-spacing: 0.04em;
}

.customer-doc-office-badge.is-word {
  background-color: #1f4e9d;
}

.customer-doc-office-badge.is-excel {
  background-color: #1f7f3a;
}

.customer-doc-office-preview {
  overflow: hidden;
  white-space: pre-wrap;
  line-height: 1.3;
}

.customer-doc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 72px;
  padding: 0 0.8rem;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  background: linear-gradient(135deg, var(--avit-accent), var(--avit-accent-dark));
}

.customer-doc-meta {
  padding: 0.65rem 0.7rem 0.7rem;
}

.customer-doc-name {
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-doc-sub {
  margin-top: 0.2rem;
  font-size: 0.86rem;
  color: var(--avit-muted);
}

.customer-doc-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--avit-muted);
  font-weight: 600;
}

.customer-doc-preview-body {
  min-height: 74vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.8rem 3.2rem;
  overflow: hidden;
  background-color: #0b1110;
}

.customer-doc-preview-dialog {
  max-width: min(96vw, 1500px);
}

.customer-doc-preview-content {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.customer-doc-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 2;
}

.customer-doc-nav:hover:not(:disabled),
.customer-doc-nav:focus-visible:not(:disabled) {
  background: rgba(0, 0, 0, 0.72);
  border-color: rgba(255, 255, 255, 0.75);
}

.customer-doc-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.customer-doc-nav-prev {
  left: 0.7rem;
}

.customer-doc-nav-next {
  right: 0.7rem;
}

.customer-doc-preview-image {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 6px;
}

.customer-doc-preview-pdf {
  width: 100%;
  height: calc(72vh - 2.7rem);
  border: none;
  border-radius: 6px;
  background-color: #ffffff;
}

.customer-doc-preview-pdf-wrap {
  width: min(100%, 1100px);
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.6rem;
}

.customer-doc-preview-pdf-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.customer-doc-preview-fallback {
  color: #e4f0ea;
  display: grid;
  gap: 1rem;
  text-align: center;
}

.customer-doc-preview-office {
  width: min(100%, 980px);
}

.customer-doc-preview-office .customer-doc-preview-text {
  text-align: left;
}

.customer-doc-preview-loading {
  color: #e4f0ea;
  font-weight: 600;
}

.customer-doc-preview-text {
  width: 100%;
  max-height: 72vh;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  border-radius: 6px;
  background-color: #fcfffd;
  color: #0d3021;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: left;
}

.customer-doc-preview-footer {
  justify-content: center;
}

.customer-doc-preview-counter {
  color: var(--avit-muted);
  font-weight: 600;
}

.payment-details-list dd.payment-field-medium {
  width: 312px;
  max-width: 312px;
}

.payment-details-list dd.payment-field-small {
  width: 182px;
  max-width: 182px;
}

.payment-details-list dd.payment-field-amount {
  width: 129px;
  max-width: 129px;
  justify-content: flex-end;
  text-align: right;
}

.payment-details-list dd.payment-field-received {
  width: 129px;
  max-width: 129px;
}

.payment-create-narrow {
  width: 30%;
  max-width: 30%;
}

.payment-edit-header-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 0.75rem 1.25rem;
  align-items: start;
}

.payment-edit-header-grid .payment-details-list {
  margin-bottom: 0;
}

.payment-allocations-existing-scroll {
  max-height: calc(100vh - 520px);
}

.payment-allocations-scroll {
  max-height: calc(100vh - 440px);
}

.floating-remaining-badge {
  position: fixed;
  right: 1.75rem;
  bottom: 1.75rem;
  z-index: 1050;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.2rem;
  border-radius: 0;
  border: 2px solid var(--avit-accent-dark);
  background: var(--avit-input);
  color: var(--avit-accent-dark);
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16), 0 6px 12px rgba(0, 0, 0, 0.08);
}

.floating-remaining-label {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.floating-remaining-value {
  font-size: 1.2rem;
}

.alloc-amount {
  width: 59%;
  margin-left: auto;
  color: #b00020;
  font-size: 1.05rem;
  height: 28px;
  min-height: 28px;
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
}

.alloc-select-col {
  width: 36px;
  min-width: 36px;
  text-align: center;
  padding-left: 0.35rem !important;
  padding-right: 0.35rem !important;
}

.alloc-select-col .form-check-input {
  margin-left: 0;
  margin-right: 0;
}

.table-context-menu {
  position: fixed;
  z-index: 2000;
  min-width: 170px;
  display: none;
  background: var(--avit-input);
  border: 1px solid var(--avit-border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.table-context-menu.open {
  display: block;
}

.table-context-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--avit-text);
  text-decoration: none;
}

.table-context-menu a:hover,
.table-context-menu a:focus {
  background-color: var(--avit-accent);
  color: #fff;
}

@media (max-width: 992px) {
  .payment-edit-header-grid {
    grid-template-columns: 1fr;
  }

  .payment-allocations-existing-scroll,
  .payment-allocations-scroll {
    max-height: calc(100vh - 360px);
  }
}

.theme-config-card {
  border: 1px solid var(--avit-border);
  background-color: var(--avit-panel);
  border-radius: 8px;
  padding: 1rem;
}

.theme-config-card h4 {
  margin-bottom: 0.75rem;
}

.theme-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.theme-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.theme-config-row .form-label {
  margin: 0;
  font-weight: 600;
}

.theme-preview {
  --avit-bg: var(--avit-bg);
  --avit-panel: var(--avit-panel);
  --avit-border: var(--avit-border);
  --avit-accent: var(--avit-accent);
  --avit-accent-dark: var(--avit-accent-dark);
  --avit-text: var(--avit-text);
  --avit-muted: var(--avit-muted);
  --avit-input: var(--avit-input);
  --avit-hover: var(--avit-hover);
  --avit-list-accent: var(--avit-list-accent);
  --avit-list-accent-muted: var(--avit-list-accent-muted);
  --avit-list-hover: var(--avit-list-hover);
  background-color: var(--avit-bg);
  border: 1px solid var(--avit-border);
  border-radius: 8px;
  overflow: hidden;
}

.theme-preview-header {
  background-color: var(--avit-accent);
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
}

.theme-preview-card {
  background-color: var(--avit-panel);
  color: var(--avit-text);
  padding: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.theme-preview-row {
  background-color: var(--avit-list-hover);
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--avit-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.theme-preview-pill {
  background-color: var(--avit-list-accent);
  color: var(--avit-text);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.theme-preview-input {
  background-color: var(--avit-input);
  border: 1px solid var(--avit-border);
  padding: 0.45rem 0.6rem;
}

.theme-preview-button {
  align-self: start;
  background-color: var(--avit-accent);
  border: 1px solid var(--avit-accent-dark);
  color: #ffffff;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.creditnote-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2rem;
  row-gap: 1rem;
  align-items: start;
}

.creditnote-form-grid .creditnote-span {
  grid-column: 1 / -1;
}

.detail-edit-form .detail-list-input input.form-control,
.detail-edit-form .detail-list-input select.form-select {
  height: 1.2em;
  min-height: 0;
  line-height: 1.2;
  padding: 0;
}

@media (max-width: 992px) {
  .job-details-grid {
    grid-template-columns: 1fr;
  }

  .customer-details-grid {
    grid-template-columns: 1fr;
  }

  .invoice-id-taxpoint-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .invoice-id-item,
  .invoice-taxpoint-item,
  .invoice-total-item,
  .invoice-field-wide {
    width: 100%;
    min-width: 0;
  }

  .customer-doc-upload-form {
    grid-template-columns: 1fr;
  }

  .customer-doc-folder-form {
    grid-template-columns: 1fr;
  }

  .customer-doc-action-bar {
    grid-template-columns: 1fr;
  }

  .creditnote-form-grid {
    grid-template-columns: 1fr;
  }
}

.detail-list-top {
  align-self: start;
}

.detail-list dt.detail-list-multiline-label {
  align-self: start;
  padding-top: 0.45rem;
  line-height: 1.4;
}

.detail-list-multiline {
  display: flex;
  align-items: flex-start;
  line-height: 1.4;
  height: calc(3 * 1.4em + 1rem);
  max-height: calc(3 * 1.4em + 1rem);
  overflow: auto;
}

.detail-list-multiline .detail-list-text {
  white-space: pre-wrap;
  align-self: stretch;
}

.detail-list-multiline.customer-notes-multiline {
  height: calc(4 * 1.4em + 1rem);
  max-height: calc(4 * 1.4em + 1rem);
}

.review-queue-bubble {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1039;
  width: min(320px, 92vw);
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  color: #ffffff;
  background: linear-gradient(135deg, #f59f00, #f97316);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.review-queue-bubble--tasks {
  top: 6.5rem;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.review-queue-bubble.is-dragging {
  transition: none;
  user-select: none;
}

.review-queue-bubble.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.review-queue-bubble__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: grab;
}

.review-queue-bubble.is-dragging .review-queue-bubble__header {
  cursor: grabbing;
}

.review-queue-bubble__pill {
  min-width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.review-queue-bubble__title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.review-queue-bubble__meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
}

.review-queue-bubble__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.review-queue-bubble__select {
  min-width: 120px;
  max-width: 160px;
  background-color: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.review-queue-bubble__select:focus {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
}

.review-queue-bubble__select option {
  color: #1f2937;
}

.review-queue-bubble .btn-light {
  color: #1f2937;
}

.review-queue-bubble__actions .btn {
  flex: 0 0 auto;
}

@media (max-width: 576px) {
  .review-queue-bubble {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }

  .review-queue-bubble--tasks {
    top: 6rem;
  }
}

