:root {
  --app-bg: #eef3f7;
  --app-surface: #ffffff;
  --app-surface-soft: #f8fafc;
  --app-border: #d8e1ea;
  --app-text: #182433;
  --app-muted: #617083;
  --app-blue: #0b74bd;
  --app-blue-dark: #07548d;
  --app-sidebar: #101827;
  --app-sidebar-soft: #172338;
  --app-sidebar-text: #93a4bb;
  --app-slate: #2d3745;
  --app-green: #198754;
  --app-shadow: 0 18px 45px rgba(22, 34, 51, 0.10);
}

html {
  font-size: 14px;
}

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

html {
  position: relative;
  min-height: 100%;
}

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

.btn {
  border-radius: 7px;
  font-weight: 650;
}

.btn-primary {
  border-color: var(--app-blue);
  background: var(--app-blue);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--app-blue-dark);
  background: var(--app-blue-dark);
}

.btn-success {
  border-color: var(--app-green);
  background: var(--app-green);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.18rem rgba(11, 116, 189, 0.18);
}

.app-frame {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--app-sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  height: 86px;
  padding: 0 28px;
  text-decoration: none;
}

.sidebar-brand img {
  width: 112px;
  height: 42px;
  object-fit: contain;
  background: #ffffff;
  padding: 6px 10px;
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 18px 10px;
}

.sidebar-primary-links {
  display: grid;
  gap: 8px;
}

.sidebar-nav > .sidebar-link:last-child {
  margin-top: auto;
}

.sidebar-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-radius: 8px;
  color: var(--app-sidebar-text);
  padding: 13px 14px;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.sidebar-link:hover {
  background: var(--app-sidebar-soft);
  color: #ffffff;
}

.sidebar-link.is-active {
  background: #2f6bed;
  color: #ffffff;
}

.sidebar-link span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: currentColor;
  font-size: 14px;
  font-weight: 800;
}

.sidebar-link strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  font-weight: 650;
}

.sidebar-link.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.app-main {
  min-width: 0;
  background: var(--app-bg);
  color: var(--app-text);
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  border-bottom: 1px solid rgba(216, 225, 234, 0.85);
  background: var(--app-surface-soft);
  color: var(--app-text);
  padding: 0 32px;
}

.app-topbar > div {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--app-slate);
  font-size: 23px;
  line-height: 1;
}

.topbar-menu:hover {
  background: #eef3f7;
}

.topbar-title {
  color: var(--app-muted);
  font-size: 0.94rem;
  font-weight: 800;
}

.navbar-user {
  align-items: center;
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

.navbar-user span {
  color: var(--app-muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.app-shell {
  width: 100%;
  padding: 28px 32px 44px;
}

.auth-shell {
  padding-top: 18px;
}

.login-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 190px);
}

.login-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
  max-width: 430px;
  padding: 28px;
  width: 100%;
}

.login-brand {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
}

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

.login-brand h1 {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

.login-brand p {
  color: var(--app-muted);
  margin: 4px 0 0;
}

.login-form {
  display: grid;
  gap: 14px;
}

.dashboard-home {
  display: grid;
  grid-template-columns: minmax(360px, 640px) minmax(280px, 1fr);
  gap: 24px;
  align-items: stretch;
  max-width: 1180px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 24px 0;
}

.queue-heading {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  padding: 24px;
  box-shadow: var(--app-shadow);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(11, 116, 189, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(11, 116, 189, 0.10), rgba(255, 255, 255, 0) 58%),
    var(--app-surface);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 12px 32px rgba(22, 34, 51, 0.07);
}

.upload-panel span {
  color: var(--app-blue-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.upload-panel h2 {
  margin: 4px 0 6px;
  font-size: 22px;
  font-weight: 800;
}

.upload-panel p {
  margin: 0;
  color: var(--app-muted);
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.summary-strip div {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  padding: 18px;
  box-shadow: 0 10px 28px rgba(22, 34, 51, 0.06);
}

.summary-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.1;
}

.invoice-control-bar {
  align-items: end;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.filter-bar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 980px;
  margin-bottom: 0;
}

.filter-bar label {
  font-weight: 700;
}

.page-size-hint {
  align-self: center;
  color: var(--app-muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.excel-column-panel {
  display: flex;
  justify-content: flex-end;
}

.excel-column-menu {
  max-height: 360px;
  min-width: 280px;
  overflow-y: auto;
}

.excel-line-wrap {
  max-width: 900px;
}

.excel-line-table {
  margin-bottom: 0;
  min-width: 720px;
}

.excel-line-table th,
.excel-line-table td {
  font-size: 0.84rem;
  white-space: nowrap;
}

.excel-line-table th {
  background: var(--app-surface-soft);
  color: var(--app-muted);
  font-weight: 800;
}

.invoice-excel-col {
  white-space: nowrap;
}

.customer-form-panel {
  max-width: 720px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  padding: 24px;
  box-shadow: 0 12px 32px rgba(22, 34, 51, 0.07);
}

.stock-edit-form-panel {
  width: 100%;
  max-width: none;
}

.customer-search-panel {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 12px 32px rgba(22, 34, 51, 0.07);
}

.customer-search-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
}

.customer-admin-actions {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.customer-import-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  max-width: 620px;
}

.customer-export-form {
  display: flex;
}

.customer-search-results {
  margin-top: 16px;
}

.customer-search-results table {
  margin-bottom: 0;
}

.customer-column-menu {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.column-toggle-item {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 180px;
}

.customer-code-col {
  white-space: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 150px;
}

.customer-form {
  display: grid;
  gap: 16px;
}

.customer-form .modal-body {
  display: grid;
  gap: 16px;
}

.stock-card-shell {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  margin-bottom: 18px;
  box-shadow: 0 12px 32px rgba(22, 34, 51, 0.07);
}

.stock-page-heading {
  margin: 16px 0;
  padding: 16px 20px;
}

.stock-page-heading h1 {
  margin-bottom: 4px;
  font-size: 2rem;
}

.stock-page-heading p {
  margin: 0;
}

.stock-card-summary {
  padding: 16px 20px;
  color: var(--app-slate);
  cursor: pointer;
  font-weight: 800;
  user-select: none;
}

.stock-card-shell[open] .stock-card-summary {
  border-bottom: 1px solid var(--app-border);
}

.stock-card-form {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.stock-card-head {
  display: grid;
  grid-template-columns: 180px 180px minmax(220px, 1fr) 170px 170px 130px 130px;
  gap: 12px;
  align-items: end;
}

.stock-span-2 {
  grid-column: span 2;
}

.stock-card-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(280px, 0.75fr);
  gap: 14px;
}

.stock-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 16px;
}

.stock-panel legend {
  float: none;
  width: auto;
  margin: 0;
  padding: 0 6px;
  color: var(--app-slate);
  font-size: 0.95rem;
  font-weight: 800;
}

.stock-unit-row {
  display: grid;
  grid-template-columns: 86px minmax(120px, 1fr) auto minmax(90px, 0.75fr) 70px;
  gap: 8px;
  align-items: center;
}

.stock-unit-row:first-of-type {
  grid-template-columns: 86px minmax(120px, 1fr);
  max-width: 300px;
}

.stock-unit-row label {
  margin: 0;
  font-weight: 700;
}

.stock-unit-row span {
  color: var(--app-muted);
  font-weight: 700;
  white-space: nowrap;
}

.stock-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stock-description-panel {
  grid-column: span 2;
}

.stock-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.stock-list-panel {
  margin-bottom: 0;
}

.stock-list-table {
  width: 100%;
  min-width: 1420px;
  table-layout: fixed;
}

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

.stock-list-table thead th {
  border-bottom: 2px solid var(--app-border);
  background: var(--app-surface-soft);
  white-space: nowrap;
}

.stock-list-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.stock-list-table th[data-stock-column] { --stock-column-width: 150px; width: var(--stock-column-width); }
.stock-list-table th[data-stock-column="code"] { --stock-column-width: 185px; }
.stock-list-table th[data-stock-column="name"] { --stock-column-width: 390px; }
.stock-list-table th[data-stock-column="type"] { --stock-column-width: 125px; }
.stock-list-table th[data-stock-column="unit"],
.stock-list-table th[data-stock-column="in"],
.stock-list-table th[data-stock-column="out"],
.stock-list-table th[data-stock-column="balance"],
.stock-list-table th[data-stock-column="vat"] { --stock-column-width: 90px; }
.stock-list-table th[data-stock-column="purchase"],
.stock-list-table th[data-stock-column="sale"] { --stock-column-width: 115px; }
.stock-list-table th[data-stock-column="minimum"],
.stock-list-table th[data-stock-column="maximum"] { --stock-column-width: 200px; }
.stock-list-table th[data-stock-column="actions"] { --stock-column-width: 160px; }
.stock-list-table th[data-stock-column="description"] { --stock-column-width: 300px; }

.stock-list-table [data-stock-column][hidden] { display: none !important; }

.stock-list-table td[data-stock-column] {
  white-space: nowrap;
}

.stock-list-table td[data-stock-column="name"],
.stock-list-table td[data-stock-column="description"] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-column-menu {
  min-width: 260px;
  max-width: calc(100vw - 40px);
  font-weight: 400;
}

.stock-column-options {
  max-height: min(360px, 55vh);
  overflow-y: auto;
}

.stock-column-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  color: var(--app-text);
  cursor: pointer;
}

.stock-column-option:hover { background: var(--app-surface-soft); }
.stock-column-option .form-check-input { flex-shrink: 0; margin: 0; }

.stock-list-summary,
.stock-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--app-muted);
  font-weight: 700;
}

.stock-pagination {
  justify-content: flex-end;
}

.stock-row {
  cursor: pointer;
}

.stock-movement-panel {
  margin-top: 18px;
}

.stock-balance-pill {
  border: 1px solid rgba(25, 135, 84, 0.24);
  border-radius: 999px;
  background: #edf8f2;
  color: #12633f;
  padding: 8px 12px;
  font-size: 0.92rem;
}

.stock-balance-pill.is-negative {
  border-color: rgba(180, 35, 24, 0.24);
  background: #fff0ee;
  color: #a42116;
}

.stock-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.stock-detail-grid div {
  min-width: 0;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface-soft);
  padding: 10px 12px;
}

.stock-detail-grid span {
  display: block;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stock-detail-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--app-text);
  font-size: 0.94rem;
}

.stock-movement-edit-row .form-control,
.stock-movement-edit-row .form-select {
  min-width: 110px;
}

.stock-movement-edit-row td:nth-child(4) {
  min-width: 150px;
}

.stock-movement-edit-row td:nth-child(8) {
  min-width: 190px;
}

.stock-movement-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-control {
  border-color: var(--app-border);
  border-radius: 7px;
}

.invoice-table-wrap {
  max-height: calc(100vh - 260px);
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: 0 12px 32px rgba(22, 34, 51, 0.07);
}

.invoice-table-wrap table {
  width: max-content;
  margin-bottom: 0;
  min-width: 100%;
}

.invoice-table-wrap th,
.invoice-table-wrap td {
  min-width: 140px;
}

.invoice-table-wrap .select-col {
  min-width: 72px;
}

.invoice-table-wrap .expand-col {
  min-width: 52px;
  width: 52px;
  text-align: center;
}

.income-category-panel,
.income-category-table-wrap {
  max-width: 920px;
  margin-right: auto;
}

.income-category-panel {
  margin-bottom: 14px;
}

.income-category-panel .customer-form {
  padding: 14px 16px 16px;
  gap: 12px;
}

.income-category-form-grid {
  display: grid;
  grid-template-columns: 180px minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
}

.income-category-table-wrap {
  max-height: calc(100vh - 390px);
}

.income-category-table-wrap th,
.income-category-table-wrap td {
  min-width: 0;
}

.income-category-table-wrap th:nth-child(1),
.income-category-table-wrap td:nth-child(1) {
  width: 120px;
}

.income-category-table-wrap th:nth-child(3),
.income-category-table-wrap td:nth-child(3) {
  width: 120px;
}

.income-category-table-wrap th:nth-child(4),
.income-category-table-wrap td:nth-child(4) {
  width: 120px;
}

.customer-detail-toggle {
  align-items: center;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  padding: 0;
  width: 30px;
}

.expand-arrow {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.customer-detail-toggle.is-open .expand-arrow {
  transform: rotate(90deg);
}

.invoice-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--app-border);
  background: #f3f7fa;
  color: #3c4858;
  font-size: 13px;
  text-transform: uppercase;
}

.invoice-table-wrap tbody td {
  border-color: #e8eef4;
}

.customer-detail-row > td {
  background: #f8fafc;
  padding: 0 !important;
}

.customer-detail-panel {
  border-top: 1px solid #dbe4ee;
  padding: 10px 14px 14px 126px;
}

.detail-table {
  margin-bottom: 0;
  min-width: 720px;
}

.detail-table th,
.detail-table td {
  min-width: 110px;
  white-space: nowrap;
}

.detail-table th {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.line-items {
  display: grid;
  gap: 8px;
  min-width: 520px;
}

.line-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 80px 100px 110px;
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 8px;
}

.line-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.line-item div {
  min-width: 0;
}

.line-item strong,
.line-item span {
  overflow-wrap: anywhere;
}

.line-item div span {
  display: block;
  margin-top: 2px;
  color: var(--app-muted);
  font-size: 12px;
}

.line-item > span,
.line-item > strong:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.select-col {
  width: 72px;
}

.empty-row {
  padding: 32px !important;
  text-align: center;
  color: var(--app-muted);
}

.badge {
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 700;
}

.export-time {
  display: block;
  margin-top: 4px;
  color: var(--app-muted);
  font-size: 12px;
}

.action-bar,
.export-bar {
  display: inline-flex;
  margin-top: 16px;
  margin-right: 8px;
}

.feature-panel {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 22px;
  box-shadow: 0 16px 38px rgba(22, 34, 51, 0.08);
}

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

.section-title span {
  color: var(--app-blue-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.section-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.section-title h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

.dashboard-menu-panel,
.dashboard-brand-panel {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: 0 16px 38px rgba(22, 34, 51, 0.08);
}

.dashboard-menu-panel {
  padding: 24px;
}

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

.module-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.module-row:hover {
  border-color: rgba(11, 116, 189, 0.45);
  box-shadow: 0 12px 30px rgba(22, 34, 51, 0.09);
  color: inherit;
  transform: translateX(2px);
}

.module-row > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #eef6fc;
  color: var(--app-blue-dark);
  font-weight: 850;
}

.module-row strong {
  display: block;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
  font-size: 17px;
  font-weight: 800;
}

.module-row small {
  display: block;
  color: var(--app-muted);
  line-height: 1.35;
}

.module-row em {
  border-radius: 999px;
  background: #e9f8ef;
  color: #147343;
  padding: 5px 10px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.module-row.disabled {
  background: var(--app-surface-soft);
  color: #64748b;
}

.module-row.disabled:hover {
  border-color: var(--app-border);
  box-shadow: none;
  transform: none;
}

.module-row.disabled em {
  background: #eef2f6;
  color: #64748b;
}

.dashboard-brand-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 520px;
  padding: 36px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(11, 116, 189, 0.10), rgba(255, 255, 255, 0) 52%),
    #ffffff;
}

.dashboard-brand-panel img {
  width: min(260px, 70%);
  background: #ffffff;
  object-fit: contain;
}

.dashboard-brand-panel h2 {
  margin: 22px 0 8px;
  font-size: 30px;
  font-weight: 850;
}

.dashboard-brand-panel p {
  max-width: 420px;
  margin: 0;
  color: var(--app-muted);
}

.brand-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 28px;
}

.brand-status-grid span {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
  color: var(--app-muted);
  font-weight: 700;
}

.brand-status-grid strong {
  display: block;
  color: var(--app-text);
  font-size: 24px;
}

.finance-heading {
  margin-bottom: 18px;
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.finance-single-grid {
  grid-template-columns: minmax(280px, 520px);
}

.cash-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.cash-summary-strip div {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: 0 10px 28px rgba(22, 34, 51, 0.06);
  padding: 16px;
}

.cash-summary-strip span {
  display: block;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.cash-summary-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.1;
}

.cash-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  margin-bottom: 18px;
}

.cash-entry-panel,
.cash-filter-panel {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: 0 14px 34px rgba(22, 34, 51, 0.08);
  padding: 20px;
}

.cash-entry-panel.cash-direction-giris {
  border-color: rgba(18, 135, 74, 0.28);
  background:
    linear-gradient(135deg, rgba(18, 135, 74, 0.12), rgba(255, 255, 255, 0) 42%),
    var(--app-surface);
}

.cash-entry-panel.cash-direction-cikis {
  border-color: rgba(180, 35, 24, 0.28);
  background:
    linear-gradient(135deg, rgba(180, 35, 24, 0.12), rgba(255, 255, 255, 0) 42%),
    var(--app-surface);
}

.cash-direction-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.cash-direction-button {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  color: var(--app-muted);
  font-weight: 800;
  min-height: 42px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cash-direction-button.is-active[data-direction="giris"] {
  border-color: #12874a;
  background: #12874a;
  color: #fff;
}

.cash-direction-button.is-active[data-direction="cikis"] {
  border-color: #b42318;
  background: #b42318;
  color: #fff;
}

.cash-form-grid,
.cash-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.cash-field-wide {
  grid-column: 1 / -1;
}

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

.cash-filter-grid button {
  justify-self: start;
}

.cash-period-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.cash-period-totals span {
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-soft);
  padding: 7px 11px;
  color: var(--app-muted);
  font-weight: 700;
}

.cash-period-totals strong {
  color: var(--app-text);
}

.cash-table-wrap {
  max-height: calc(100vh - 420px);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
  max-width: 980px;
}

.finance-admin-panel {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: 0 14px 34px rgba(22, 34, 51, 0.08);
  margin-bottom: 18px;
  padding: 18px;
}

.finance-panel {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: 0 14px 34px rgba(22, 34, 51, 0.08);
  overflow: hidden;
}

.finance-panel-head {
  border-bottom: 1px solid var(--app-border);
  padding: 18px 20px;
}

.finance-panel-head span {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.finance-panel-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 800;
}

.finance-income .finance-panel-head {
  border-top: 4px solid var(--app-green);
}

.finance-expense .finance-panel-head {
  border-top: 4px solid #b42318;
}

.finance-action-grid {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.finance-action {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface-soft);
  padding: 14px;
  color: inherit;
  text-decoration: none;
}

.finance-action:hover {
  border-color: rgba(11, 116, 189, 0.38);
  background: #ffffff;
  color: inherit;
}

.finance-action.is-disabled {
  background: var(--app-surface-soft);
  color: #64748b;
  cursor: default;
}

.finance-action.is-disabled:hover {
  border-color: var(--app-border);
  background: var(--app-surface-soft);
}

.finance-action span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #e8eef5;
  color: var(--app-slate);
  font-weight: 800;
}

.finance-action strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.ledger-window {
  border: 1px solid #9fb4c7;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(22, 34, 51, 0.08);
  overflow: hidden;
}

.ledger-titlebar {
  border-bottom: 1px solid #b9c7d4;
  background: linear-gradient(180deg, #f7fbff, #e8f0f7);
  color: #405062;
  font-size: 13px;
  padding: 7px 10px;
}

.ledger-menu-strip,
.ledger-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #d5dde5;
  background: #f6f7f8;
  padding: 6px 10px;
  color: #263544;
  font-size: 13px;
  font-weight: 650;
}

.ledger-menu-strip {
  gap: 0;
  position: relative;
}

.ledger-menu-strip > button,
.ledger-printer-menu > button {
  border: 0;
  border-right: 1px solid #d5dde5;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 6px 10px;
}

.ledger-menu-strip > button:hover,
.ledger-printer-menu > button:hover,
.ledger-menu-strip > button.is-active {
  background: #ffffff;
  color: #173f61;
}

.ledger-printer-menu {
  position: relative;
}

.ledger-printer-actions {
  position: absolute;
  z-index: 40;
  top: calc(100% + 2px);
  left: 0;
  min-width: 150px;
  border: 1px solid #c7d2dd;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 48, 67, 0.16);
}

.ledger-printer-actions button,
.ledger-printer-actions a {
  display: block;
  width: 100%;
  border: 0;
  background: #ffffff;
  color: #263544;
  padding: 8px 12px;
  text-align: left;
  text-decoration: none;
}

.ledger-printer-actions button:hover,
.ledger-printer-actions a:hover {
  background: #eef4f8;
}

.ledger-panel[hidden] {
  display: none !important;
}

.ledger-panel h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.ledger-report-panel,
.ledger-management-panel,
.ledger-analysis-panel {
  padding: 14px;
}

.ledger-invoice-heading td {
  background: #eaf0f5;
}

.ledger-invoice-heading strong,
.ledger-invoice-heading span {
  display: block;
}

.ledger-invoice-heading span {
  margin-top: 3px;
  color: #596879;
}

.ledger-customer-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 0 0 16px;
}

.ledger-customer-details > div {
  border-bottom: 1px solid #d5dde5;
  padding: 8px 0;
}

.ledger-customer-details dt {
  color: #596879;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.ledger-customer-details dd {
  margin: 4px 0 0;
  white-space: pre-line;
}

.ledger-analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.ledger-analysis-grid > div {
  border-left: 3px solid #4c8794;
  padding: 8px 12px;
}

.ledger-analysis-grid span,
.ledger-analysis-grid strong {
  display: block;
}

.ledger-analysis-grid span {
  color: #596879;
  font-size: 12px;
}

.ledger-analysis-grid strong {
  margin-top: 5px;
  font-size: 20px;
}

.ledger-toolbar {
  gap: 6px;
  background: #fbfbfc;
  padding: 4px 10px;
}

.ledger-toolbar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 24px;
  border: 1px solid #d7dee6;
  border-radius: 3px;
  background: #ffffff;
  color: #596879;
}

.ledger-filter-panel {
  display: grid;
  grid-template-columns: minmax(360px, 0.75fr) minmax(440px, 0.95fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: start;
  border-bottom: 1px solid #cbd5df;
  background: #f8fafc;
  padding: 10px;
}

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

  body * {
    visibility: hidden !important;
  }

  .ledger-titlebar,
  .ledger-panel[data-ledger-panel="overview"],
  .ledger-panel[data-ledger-panel="overview"] * {
    visibility: visible !important;
  }

  .ledger-titlebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }

  .ledger-panel[data-ledger-panel="overview"] {
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
  }

  .ledger-menu-strip,
  .ledger-toolbar,
  .ledger-filter-panel,
  .ledger-balance-tabs,
  .ledger-filter-options,
  .ledger-statusbar {
    display: none !important;
  }

  .ledger-window,
  .ledger-table-wrap {
    width: 100%;
    overflow: visible;
    border: 0;
  }

  .ledger-table {
    min-width: 0;
    font-size: 8px;
  }
}

.ledger-filter-left {
  display: grid;
  gap: 6px;
}

.ledger-field-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.ledger-field-row:has(label:nth-child(1):last-child),
.ledger-field-row:nth-child(n+2) {
  grid-template-columns: 118px minmax(0, 1fr) auto;
}

.ledger-field-row label {
  margin: 0;
  color: #4b5c70;
  font-size: 13px;
  font-weight: 650;
}

.ledger-field-row input,
.ledger-field-row select {
  min-height: 30px;
  border: 1px solid #cfd8e3;
  border-radius: 3px;
  background: #ffffff;
  padding: 4px 7px;
  color: #263544;
}

.ledger-help {
  min-width: 28px;
  min-height: 30px;
  border: 1px solid #b8c5d2;
  border-radius: 3px;
  background: #eef3f8;
  color: #1f2d3d;
  font-weight: 800;
}

.ledger-balance-tabs {
  border: 1px solid #cfd8e3;
  background: #ffffff;
}

.ledger-tab-buttons {
  display: flex;
  border-bottom: 1px solid #dce4ec;
}

.ledger-tab-buttons span {
  border-right: 1px solid #dce4ec;
  background: #f4f7fa;
  padding: 7px 10px;
  color: #405062;
  font-size: 13px;
  font-weight: 750;
}

.ledger-tab-buttons span:first-child {
  background: #ffffff;
}

.ledger-balance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 8px 10px;
}

.ledger-balance-grid div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 3px 8px;
  align-items: center;
}

.ledger-balance-grid span {
  grid-column: 1 / -1;
  color: #6b7b8d;
  font-size: 13px;
  font-weight: 750;
}

.ledger-balance-grid label {
  color: #526273;
  font-size: 12px;
  font-weight: 750;
}

.ledger-balance-grid strong {
  text-align: right;
  color: #2b3948;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ledger-filter-options {
  display: grid;
  gap: 12px;
  color: #4b5c70;
  font-size: 13px;
  font-weight: 650;
}

.ledger-filter-options label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ledger-table-wrap {
  min-height: 520px;
  overflow: auto;
}

.ledger-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ledger-table th,
.ledger-table td {
  border: 1px solid #d8e0e8;
  padding: 6px 8px;
  white-space: nowrap;
}

.ledger-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f4f7;
  color: #526273;
  font-size: 12px;
  text-align: center;
}

.ledger-table tbody tr:nth-child(even) {
  background: #fbfcfd;
}

.ledger-table tbody tr:hover {
  background: #eaf4ff;
}

.ledger-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ledger-statusbar {
  display: flex;
  gap: 28px;
  border-top: 1px solid #cbd5df;
  background: #f5f7fa;
  padding: 8px 10px;
  color: #526273;
  font-size: 13px;
  font-weight: 700;
}

.detailed-statement-window .ledger-titlebar {
  font-size: 14px;
}

.detailed-toolbar {
  gap: 8px;
}

.detailed-filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid #cbd5df;
  background: #f8fafc;
  padding: 8px 10px;
}

.detailed-filter-panel > label,
.detailed-filter-panel div {
  display: grid;
  gap: 4px;
  color: #4b5c70;
  font-size: 12px;
  font-weight: 700;
}

.detailed-filter-panel > label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

.detailed-filter-panel input,
.detailed-filter-panel select {
  min-height: 30px;
  border: 1px solid #cfd8e3;
  border-radius: 3px;
  background: #ffffff;
  padding: 4px 7px;
  color: #263544;
}

.customer-autocomplete {
  position: relative;
  min-width: 220px;
}

.ledger-customer-autocomplete {
  min-width: 0;
}

.customer-autocomplete input {
  width: 100%;
}

.customer-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #9fb4c7;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(31, 48, 67, 0.16);
}

.customer-suggestions:empty {
  display: none;
}

.invoice-stock-autocomplete {
  position: relative;
  min-width: 270px;
}

.invoice-stock-suggestions {
  min-width: min(640px, calc(100vw - 48px));
  max-width: 760px;
}

.stock-movement-type-readonly {
  background: #f3f6f9;
  color: var(--app-slate);
  cursor: default;
}

.customer-suggestion {
  display: grid;
  width: 100%;
  gap: 2px;
  border: 0;
  border-bottom: 1px solid #e3ebf2;
  background: #ffffff;
  padding: 7px 9px;
  text-align: left;
  color: #263544;
}

.customer-suggestion:last-child {
  border-bottom: 0;
}

.customer-suggestion:hover,
.customer-suggestion:focus,
.customer-suggestion.is-active {
  background: #eaf4ff;
}

.customer-suggestion strong,
.customer-suggestion span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-stock-suggestions .customer-suggestion strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.check-note-workspace {
  align-items: start;
  grid-template-columns: minmax(780px, 1.55fr) minmax(300px, 0.45fr);
}

.check-note-entry-panel {
  min-width: 0;
}

.check-note-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.check-note-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0;
  color: #344256;
  font-weight: 700;
}

.check-note-endorsement-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.check-note-list-mode {
  display: flex;
  gap: 18px;
  margin-bottom: 12px;
  color: #344256;
  font-weight: 700;
}

.check-note-list-mode label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.check-note-table-wrap {
  overflow-x: auto;
}

.check-note-entry-panel .check-note-table-wrap th,
.check-note-entry-panel .check-note-table-wrap td {
  min-width: 118px;
}

.check-note-entry-panel .check-note-table-wrap th:nth-child(3),
.check-note-entry-panel .check-note-table-wrap td:nth-child(3) {
  min-width: 150px;
}

.check-note-entry-panel .check-note-table-wrap th:last-child,
.check-note-entry-panel .check-note-table-wrap td:last-child {
  min-width: 132px;
}

.check-note-entry-panel .check-note-table-wrap input,
.check-note-entry-panel .check-note-table-wrap select {
  min-width: 0;
}

.check-note-group-shaded > td {
  background: #eef0f3;
}

.check-note-group-plain > td {
  background: #ffffff;
}

.check-note-group-shaded:hover > td {
  background: #e7eaee;
}

.check-note-group-plain:hover > td {
  background: #f7f9fc;
}

.check-note-status-row td {
  border-top: 0;
  padding-top: 0;
}

.check-note-status-row.check-note-group-shaded > td {
  background: #eef0f3;
}

.check-note-status-row.check-note-group-plain > td {
  background: #ffffff;
}

.check-note-status-form {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(150px, 0.9fr) minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: center;
  max-width: 920px;
}

.check-note-status-form .form-control {
  min-height: 32px;
  font-size: 13px;
}

.check-note-status-complete {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: #617083;
  font-size: 13px;
  font-weight: 700;
}

.detailed-table-wrap {
  min-height: 640px;
}

.detailed-table th:nth-child(2),
.detailed-table td:nth-child(2) {
  min-width: 120px;
}

.detailed-table th:nth-child(5),
.detailed-table td:nth-child(5) {
  min-width: 210px;
}

.detailed-table th:nth-child(10),
.detailed-table td:nth-child(10) {
  min-width: 360px;
}

.detailed-table th:nth-child(11),
.detailed-table td:nth-child(11) {
  min-width: 170px;
}

.detailed-table th:nth-child(12),
.detailed-table td:nth-child(12) {
  min-width: 260px;
}

.detailed-table th:nth-child(n+16),
.detailed-table td:nth-child(n+16) {
  min-width: 140px;
}

.detailed-group-row {
  background: #eaf6ff !important;
  color: #1772a7;
  font-weight: 800;
}

.detailed-line-row {
  background: #fbfdff;
}

.detailed-line-row td:first-child {
  color: #2f6bed;
  font-weight: 900;
  text-align: center;
}

.detailed-total-row {
  background: #f6f8fb;
  font-weight: 850;
}

.finance-slip {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.finance-slip-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--app-border);
  background: #f8fafc;
  padding: 12px 16px;
}

.finance-slip-title > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.finance-slip-title h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.finance-slip-status {
  border: 1px solid rgba(11, 116, 189, 0.22);
  border-radius: 999px;
  background: #eef6fc;
  padding: 5px 10px;
  color: var(--app-blue-dark);
  font-size: 12px;
  font-weight: 800;
}

.finance-slip-form {
  padding: 14px 16px 16px;
}

.invoice-excel-upload {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--app-border);
  padding: 12px 16px;
}

.invoice-excel-upload label {
  margin: 0;
  font-weight: 800;
}

.finance-slip-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.finance-slip-fields {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(330px, 0.7fr);
  gap: 42px;
  align-items: start;
  margin: 18px 0 20px;
}

.finance-slip-left,
.finance-slip-right {
  display: grid;
  gap: 7px;
}

.finance-slip-left .finance-field,
.finance-slip-right .finance-field {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.invoice-due-inputs {
  display: grid;
  grid-template-columns: 96px minmax(150px, 220px) auto;
  gap: 8px;
  align-items: center;
  justify-content: start;
}

.finance-field {
  min-width: 0;
}

.finance-field-wide {
  grid-column: span 2;
}

.finance-field label,
.finance-total label {
  display: block;
  margin-bottom: 0;
  color: var(--app-slate);
  font-size: 13px;
  font-weight: 750;
}

.invoice-kind-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.invoice-kind-field legend {
  margin: 0;
  color: var(--app-slate);
  font-size: 13px;
  font-weight: 750;
}

.invoice-kind-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.invoice-kind-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.invoice-kind-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.invoice-kind-option span {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--app-slate);
  font-size: 13px;
  font-weight: 750;
}

.invoice-kind-option input:checked + span {
  border-color: var(--app-blue);
  background: #eef6fc;
  color: var(--app-blue-dark);
  box-shadow: 0 0 0 2px rgba(11, 116, 189, 0.12);
}

.invoice-kind-option input:focus-visible + span {
  outline: 2px solid var(--app-blue);
  outline-offset: 2px;
}

.offer-page-heading {
  align-items: center;
}

.offer-editor {
  margin-bottom: 18px;
}

.offer-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px 18px;
  margin: 16px 0 20px;
}

.offer-fields .finance-field {
  display: grid;
  gap: 5px;
}

.offer-lines-wrap {
  min-height: 190px;
}

.offer-lines {
  min-width: 1060px;
}

.offer-lines td:nth-child(1),
.offer-lines td:nth-child(2) {
  min-width: 260px;
}

.offer-filter-bar {
  margin-bottom: 14px;
}

.offer-list-wrap {
  border: 1px solid var(--app-border);
  background: #ffffff;
  overflow-x: auto;
}

.offer-list-table {
  min-width: 980px;
  margin: 0;
}

.offer-list-table thead th {
  background: #f1f5f9;
  color: var(--app-slate);
  font-size: 12px;
  text-transform: uppercase;
}

.offer-summary-row > td {
  padding: 14px 12px;
  vertical-align: middle;
}

.offer-summary-row {
  cursor: pointer;
}

.offer-summary-row:hover > td,
.offer-summary-row:focus-visible > td {
  background: #f5f9fc;
}

.offer-summary-row:focus-visible {
  outline: 2px solid var(--app-blue);
  outline-offset: -2px;
}

.offer-summary-row.is-expanded > td {
  background: #eef6fc;
}

.offer-summary-row small {
  display: block;
  margin-top: 2px;
  color: #6d7d8c;
}

.offer-expand-column {
  width: 48px;
}

.offer-expand-button {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--app-blue-dark);
  font-size: 20px;
  line-height: 1;
}

.offer-customer-name {
  color: var(--app-blue-dark);
}

.offer-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.offer-status.is-pending { border-color: #d79a55; background: #fff8ef; color: #a05d18; }
.offer-status.is-accepted { border-color: #58a778; background: #eef9f2; color: #237044; }
.offer-status.is-rejected { border-color: #d66c74; background: #fff1f2; color: #a52b36; }
.offer-status.is-invoiced { border-color: #638db0; background: #edf5fb; color: #245f8d; }

.offer-detail-row > td {
  padding: 0;
  background: #fbfcfd;
}

.offer-detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  padding: 22px 28px;
  border-top: 1px solid var(--app-border);
}

.offer-detail-lines .table {
  margin: 0;
}

.offer-validity {
  margin-top: 12px;
  color: #607181;
  font-size: 13px;
}

.offer-actions {
  display: flex;
  max-width: 390px;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.offer-actions form {
  margin: 0;
}

.offer-actions .offer-description-edit {
  display: grid;
  flex-basis: 100%;
  gap: 6px;
  margin-bottom: 4px;
}

.offer-description-edit label {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
}

.offer-description-edit textarea {
  min-height: 74px;
  resize: vertical;
}

.offer-description-edit button {
  justify-self: end;
}

@media (max-width: 900px) {
  .offer-fields {
    grid-template-columns: 1fr;
  }

  .offer-detail-content {
    grid-template-columns: 1fr;
  }

  .offer-actions {
    max-width: none;
    justify-content: flex-start;
  }
}

.lookup-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 6px;
}

.finance-lines-wrap {
  min-height: 360px;
  border: 1px solid var(--app-border);
  background: #ffffff;
  overflow-x: auto;
}

.finance-lines {
  min-width: 980px;
  margin-bottom: 0;
}

.finance-lines th {
  background: #f1f5f9;
  color: var(--app-slate);
  font-size: 13px;
  white-space: nowrap;
}

.finance-lines td {
  min-width: 110px;
  padding: 5px;
}

.finance-lines td:nth-child(6) {
  min-width: 210px;
}

.invoice-master-list {
  max-height: 300px;
  margin-bottom: 18px;
}

.invoice-clickable-row {
  cursor: pointer;
}

.invoice-clickable-row:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: -2px;
}

.invoice-detail-link {
  font-weight: 700;
}

.invoice-sale-kind {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid #b8c8d6;
  border-radius: 4px;
  background: #f5f8fa;
  padding: 3px 8px;
  color: #344b60;
  font-size: 12px;
  font-weight: 800;
}

.invoice-details-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--app-border);
  background: #fff;
  margin-bottom: 18px;
}

.invoice-details-summary > div {
  border-right: 1px solid var(--app-border);
  padding: 14px 16px;
}

.invoice-details-summary > div:last-child {
  border-right: 0;
}

.invoice-price-input {
  margin-left: auto;
  max-width: 150px;
}

.invoice-edit-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.invoice-details-summary span,
.invoice-details-customer span {
  color: var(--app-muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.invoice-details-summary strong,
.invoice-details-customer strong {
  display: block;
}

.invoice-details-customer {
  border: 1px solid var(--app-border);
  background: #fff;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.invoice-details-total td {
  background: #f3f7fa;
  font-size: 15px;
  font-weight: 800;
}

.invoice-entry-slip {
  margin-top: 18px;
}

.invoice-lines td:nth-child(2) {
  min-width: 180px;
}

.invoice-lines td:nth-child(3) {
  min-width: 280px;
}

.invoice-lines td:nth-child(4) {
  min-width: 130px;
  color: var(--app-muted);
  font-weight: 750;
  white-space: nowrap;
}

.invoice-stock-balance {
  font-variant-numeric: tabular-nums;
}

.invoice-line-toolbar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin: 10px 0 6px;
}

.invoice-column-picker {
  order: -1;
  margin-right: auto;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 6px;
  padding: 6px 10px;
}

.invoice-column-picker summary {
  cursor: pointer;
}

.invoice-column-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  max-width: 640px;
  margin-top: 10px;
}

.invoice-column-options legend {
  font-size: 0.875rem;
}

.invoice-column-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.invoice-lines th[hidden],
.invoice-lines td[hidden],
#invoiceDetailsTable th[hidden],
#invoiceDetailsTable td[hidden] {
  display: none !important;
}

.invoice-lines .invoice-line-action {
  min-width: 76px;
  width: 76px;
  text-align: center;
}

.invoice-validation-summary:empty {
  display: none;
}

.finance-lines .form-control,
.finance-lines .form-select {
  min-height: 32px;
}

.finance-line-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.finance-slip-footer {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(160px, 0.35fr) minmax(260px, 0.55fr);
  gap: 42px;
  align-items: end;
  border-top: 1px solid var(--app-border);
  background: #f8fafc;
  padding: 16px 0 0;
  margin-top: 14px;
}

.finance-footer-left {
  display: grid;
  gap: 7px;
}

#invoiceWithholdingTotals {
  grid-column: -2 / -1;
  justify-self: end;
  width: 100%;
  max-width: 420px;
  min-width: 0;
}

.finance-footer-left .finance-field {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.finance-total {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  grid-column: 3;
  grid-row: 1;
}

.finance-total input {
  text-align: right;
  font-weight: 800;
}

.customer-form-check {
  align-self: end;
  padding-top: 30px;
}

@media (max-width: 768px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    min-height: auto;
  }

  .sidebar-brand {
    height: 70px;
    padding: 0 18px;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .app-topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 18px;
  }

  .app-topbar > div,
  .navbar-user {
    justify-content: space-between;
    width: 100%;
  }

  .app-shell {
    padding: 18px;
  }

  .dashboard-home,
  .summary-strip,
  .upload-panel,
  .brand-status-grid,
  .cash-summary-strip,
  .cash-workspace,
  .cash-form-grid,
  .cash-filter-grid,
  .settings-grid,
  .finance-grid,
  .finance-slip-footer,
  .stock-card-head,
  .stock-card-grid,
  .stock-field-grid,
  .stock-detail-grid {
    grid-template-columns: 1fr;
  }

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

  .invoice-details-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--app-border);
  }

  .invoice-details-summary > div:last-child {
    border-bottom: 0;
  }

  .check-note-status-form {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .dashboard-menu-panel,
  .dashboard-brand-panel {
    padding: 18px;
  }

  .module-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .module-row em {
    grid-column: 2;
    justify-self: start;
  }

  .finance-slip-title,
  .finance-slip-title > div,
  .finance-slip-toolbar,
  .invoice-excel-upload {
    align-items: stretch;
    flex-direction: column;
  }

  .invoice-excel-upload {
    display: flex;
  }

  .finance-slip-fields {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .finance-slip-left .finance-field,
  .finance-slip-right .finance-field,
  .finance-footer-left .finance-field,
  .finance-total {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .invoice-due-inputs {
    grid-template-columns: 96px minmax(150px, 1fr) auto;
  }

  .income-category-form-grid {
    grid-template-columns: 1fr;
  }

  .finance-field-wide {
    grid-column: auto;
  }

  .stock-span-2,
  .stock-description-panel {
    grid-column: auto;
  }

  .stock-unit-row,
  .stock-unit-row:first-of-type {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .finance-total {
    grid-column: auto;
    grid-row: auto;
  }

  .queue-heading {
    padding: 20px;
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .invoice-control-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
    max-width: none;
  }

  .upload-form,
  .customer-search-form,
  .customer-import-form {
    grid-template-columns: 1fr;
  }

  .line-items {
    min-width: 420px;
  }

  .line-item {
    grid-template-columns: minmax(180px, 1fr) 70px 90px 100px;
  }
}
.exchange-rate-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--app-border);
  background: #f0f6fc;
  font-size: 12px;
}

.exchange-rate-source { color: #52657a; }
.exchange-rate-currency { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.exchange-rate-currency span { white-space: nowrap; }
.exchange-rate-currency b { font-variant-numeric: tabular-nums; }
.document-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.list-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0; }
.list-pagination label { display: flex; align-items: center; gap: 8px; }
.list-pagination select { width: 90px; }
.list-page-hidden { display: none !important; }
.flatpickr-calendar { font-family: inherit; }
.flatpickr-calendar .flatpickr-monthDropdown-months { font-size: 14px; }

@media print {
  .exchange-rate-strip, .list-pagination, .document-actions { display: none !important; }
}

.income-expense-entry > summary {
  cursor: pointer;
  list-style: none;
  justify-content: flex-start;
  gap: 12px;
}

.income-expense-entry > summary::-webkit-details-marker {
  display: none;
}

.income-expense-entry-arrow {
  display: inline-block;
  transition: transform .15s ease;
}

.income-expense-entry[open] .income-expense-entry-arrow {
  transform: rotate(90deg);
}

.income-expense-entry > summary h2 {
  margin: 0;
  font-size: 1.25rem;
}
