/* Header / sidebar / theme-toggle styles live in assets/css/header.css */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/Kosovo/Prishtina/assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Same size as Inter, so the first paint does not move when the file arrives. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.64%;
}

/* ═══════════════════════════════════════════════════════════
   Site-wide design tokens (from dashboard)
   ═══════════════════════════════════════════════════════════ */

:root {
  --page-bg: #f6f1eb;
  --card-bg: #ffffff;
  --accent-color: #fd7e14;
  --accent-soft: #fff1e6;
  --focus-border: color-mix(in srgb, var(--accent-color) 38%, var(--btn-secondary-border));
  --focus-ring: color-mix(in srgb, var(--accent-color) 16%, transparent);
  --accent-peach: #f8c9a8;
  --ink-color: #3d2e22;
  --muted-ink: #8a6a52;
  --chart-title-color: #3d2e22;
  --stat-hover-bg: #fffaf6;
  --table-head-color: #8a6a52;
  --table-header-bg: #f3efe9;
  --table-border: #f0e4d8;
  --table-stripe: rgba(61, 46, 34, 0.035);
  --table-row-hover: #fffaf6;
  --table-link: #3d2e22;
  --btn-secondary-color: #3d3d42;
  --btn-secondary-border: #9c968f;
  --btn-secondary-bg: #ffffff;
  --btn-secondary-hover-bg: #f3f1ef;
  --btn-secondary-hover-color: #1f1f22;
  --page-btn-bg: #ffffff;
  --page-btn-border: #e6e6ea;
  --page-btn-color: #6b6b73;
  --page-btn-hover-bg: #f3f3f5;
  --page-btn-hover-color: #3d3d42;
  --page-btn-active-bg: #fd7e14;
  --page-btn-active-color: #ffffff;
  --page-btn-disabled-bg: #f7f7f8;
  --page-btn-disabled-color: #c4c4c8;
  --card-border: transparent;
  --card-shadow: 0 8px 24px rgba(61, 46, 34, 0.05);
  --card-radius: 22px;
  /* Aliases used by dashboard layout */
  --dash-page-bg: var(--page-bg);
}

[data-bs-theme="dark"] {
  --page-bg: #0c0c0f;
  --card-bg: #16161a;
  --accent-color: #fd7e14;
  --accent-soft: rgba(253, 126, 20, 0.16);
  --focus-border: color-mix(in srgb, var(--accent-color) 38%, var(--btn-secondary-border));
  --focus-ring: color-mix(in srgb, var(--accent-color) 16%, transparent);
  --accent-peach: rgba(253, 126, 20, 0.38);
  --ink-color: #f4f4f5;
  --muted-ink: #9a9aa3;
  --chart-title-color: #f4f4f5;
  --stat-hover-bg: #1c1c22;
  --table-head-color: #c4a792;
  --table-header-bg: rgba(255, 255, 255, 0.06);
  --table-border: rgba(255, 255, 255, 0.08);
  --table-stripe: rgba(255, 255, 255, 0.04);
  --table-row-hover: #1c1c22;
  --table-link: #f4f4f5;
  --btn-secondary-color: #e8e8ed;
  --btn-secondary-border: rgba(255, 255, 255, 0.48);
  --btn-secondary-bg: rgba(255, 255, 255, 0.06);
  --btn-secondary-hover-bg: rgba(255, 255, 255, 0.14);
  --btn-secondary-hover-color: #ffffff;
  --page-btn-bg: #16161a;
  --page-btn-border: rgba(255, 255, 255, 0.14);
  --page-btn-color: #c4c4cc;
  --page-btn-hover-bg: rgba(255, 255, 255, 0.08);
  --page-btn-hover-color: #f4f4f5;
  --page-btn-active-bg: #fd7e14;
  --page-btn-active-color: #ffffff;
  --page-btn-disabled-bg: rgba(255, 255, 255, 0.04);
  --page-btn-disabled-color: #6b6b73;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  --dash-page-bg: var(--page-bg);
}

/* Page scrollbar — same thin orange bar as the sidebar, track blends into the page */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-scrollbar-thumb) var(--page-bg);
  scrollbar-gutter: stable;
}

html::-webkit-scrollbar {
  width: var(--sidebar-scrollbar-size, 8px);
  height: var(--sidebar-scrollbar-size, 8px);
}

html::-webkit-scrollbar-track {
  background: var(--page-bg);
}

html::-webkit-scrollbar-thumb {
  background: var(--sidebar-scrollbar-thumb, rgba(253, 126, 20, 0.55));
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb:hover {
  background: var(--sidebar-scrollbar-thumb-hover, rgba(253, 126, 20, 0.75));
}

/* Page surface + typography */
body,
.app-content,
.app-content > main {
  font-family: "Inter", "Inter Fallback", "Segoe UI", Arial, sans-serif;
  background-color: var(--page-bg) !important;
  color: var(--ink-color);
}

a,
button,
label,
summary,
select,
[role="button"],
.btn,
.page-link,
.nav-link,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
input[type="file"],
input[type="range"] {
  cursor: pointer;
}

input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]),
textarea,
[contenteditable="true"] {
  cursor: text;
}

:disabled,
[disabled],
[aria-disabled="true"] {
  cursor: not-allowed;
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .app-content,
[data-bs-theme="dark"] .app-content > main {
  background-color: var(--page-bg) !important;
  color: var(--ink-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--ink-color);
}

.text-muted,
.text-secondary,
.text-info {
  color: var(--muted-ink) !important;
}

.text-primary {
  color: var(--accent-color) !important;
}

.text-success,
.text-warning {
  color: var(--ink-color) !important;
}

.text-danger {
  color: #b02a37 !important;
}

/* ═══════════════════════════════════════════════════════════
   Shared button system (dashboard pill style)
   Does not restyle sidebar controls (.sidebar-link, etc.)
   ═══════════════════════════════════════════════════════════ */

.btn {
  border-radius: 999px;
  font-weight: 600;
  font-family: "Inter", "Inter Fallback", "Segoe UI", Arial, sans-serif;
  padding: 0.5rem 1.15rem;
}

.btn-sm {
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-weight: 600;
  font-size: 0.75rem;
}

/* Primary / CTA — solid accent, no hover change */
.btn-primary,
.btn-outline-primary,
.dash-qa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--accent-color);
  border-radius: 999px;
  color: #fff !important;
  font-weight: 600;
  background: var(--accent-color);
  background-color: var(--accent-color);
  box-shadow: none;
  filter: none;
  --bs-btn-bg: var(--accent-color);
  --bs-btn-border-color: var(--accent-color);
  --bs-btn-hover-bg: var(--accent-color);
  --bs-btn-hover-border-color: var(--accent-color);
  --bs-btn-active-bg: var(--accent-color);
  --bs-btn-active-border-color: var(--accent-color);
  --bs-btn-disabled-bg: var(--accent-color);
  --bs-btn-disabled-border-color: var(--accent-color);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-opacity: 0.65;
}

.dash-qa-btn {
  padding: 0.62rem 1.35rem;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-check:checked + .btn-primary,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.dash-qa-btn:hover,
.dash-qa-btn:focus,
.dash-qa-btn.show,
.dash-qa-btn[aria-expanded="true"] {
  color: #fff !important;
  border-color: var(--accent-color);
  background: var(--accent-color);
  background-color: var(--accent-color);
  box-shadow: none;
  filter: none;
}

.btn-primary:disabled,
.btn-primary.disabled,
.btn-primary:disabled:hover,
.btn-primary:disabled:focus,
.btn-primary:disabled:active {
  color: #fff !important;
  border-color: var(--accent-color) !important;
  background: var(--accent-color) !important;
  background-color: var(--accent-color) !important;
  opacity: 0.65;
  box-shadow: none;
  filter: none;
}

/* Secondary — visible neutral edge, lifted fill. Orange stays on primary. */
.btn-secondary,
.btn-light,
.btn-outline-dark,
.btn-outline-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  color: var(--btn-secondary-color) !important;
  font-weight: 600;
  background: var(--btn-secondary-bg);
  background-color: var(--btn-secondary-bg);
  box-shadow: none;
  filter: none;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active,
.btn-secondary.active,
.btn-check:checked + .btn-secondary,
.btn-light:hover,
.btn-light:focus,
.btn-light:active,
.btn-outline-dark:hover,
.btn-outline-dark:focus,
.btn-outline-dark:active,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
  color: var(--btn-secondary-hover-color) !important;
  border-color: var(--btn-secondary-border);
  background: var(--btn-secondary-hover-bg);
  background-color: var(--btn-secondary-hover-bg);
  box-shadow: none;
  filter: none;
}

.btn-secondary:disabled,
.btn-secondary.disabled,
.btn-outline-secondary:disabled,
.btn-outline-secondary.disabled {
  opacity: 0.55;
  background: transparent;
  background-color: transparent;
}

.btn-expense-delete,
.btn-import-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid #d31212 !important;
  border-radius: 999px;
  background: #d31212 !important;
  background-color: #d31212 !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: none;
  filter: none;
}

.btn-expense-delete:hover,
.btn-expense-delete:focus,
.btn-expense-delete:active,
.btn-import-delete:hover,
.btn-import-delete:focus,
.btn-import-delete:active {
  border-color: #b00000 !important;
  background: #b00000 !important;
  background-color: #b00000 !important;
  color: #fff !important;
  box-shadow: none;
  filter: none;
}

/* Quiet actions. Primary stays the only solid accent. */
.btn-success,
.btn-warning,
.btn-info,
.btn-outline-success,
.btn-outline-warning,
.btn-outline-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  color: var(--btn-secondary-color) !important;
  font-weight: 600;
  background: var(--btn-secondary-bg);
  background-color: var(--btn-secondary-bg);
  box-shadow: none;
}

.btn-success:hover,
.btn-success:focus,
.btn-warning:hover,
.btn-warning:focus,
.btn-info:hover,
.btn-info:focus,
.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-info:hover,
.btn-outline-info:focus {
  color: var(--btn-secondary-hover-color) !important;
  border-color: var(--btn-secondary-border);
  background: var(--btn-secondary-hover-bg);
  background-color: var(--btn-secondary-hover-bg);
  box-shadow: none;
}

.btn-danger,
.btn-outline-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid #d31212;
  border-radius: 999px;
  color: #fff !important;
  font-weight: 600;
  background: #d31212;
  background-color: #d31212;
  box-shadow: none;
  --bs-btn-bg: #d31212;
  --bs-btn-border-color: #d31212;
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: #b00000;
  --bs-btn-hover-border-color: #b00000;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #b00000;
  --bs-btn-active-border-color: #b00000;
  --bs-btn-active-color: #fff;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-outline-danger:hover,
.btn-outline-danger:focus {
  color: #fff !important;
  border-color: #b00000;
  background: #b00000;
  background-color: #b00000;
  box-shadow: none;
}

.btn[style*="font-size"] {
  font-size: 0.92rem !important;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1055;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  margin: 5% auto;
  padding: 30px;
  width: 90%;
  max-width: 600px;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease;
}

/* Bootstrap dialogs use their own layout; do not inherit the legacy modal box. */
.modal-dialog > .modal-content {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  border-radius: var(--card-radius, 1rem);
  box-shadow: var(--card-shadow, 0 5px 15px rgba(0, 0, 0, 0.3));
  animation: none;
}

.modal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  cursor: pointer;
}

#terminal-confirm.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.62);
}

#terminal-confirm .modal-content {
  margin: 0;
  width: min(28rem, 100%);
  padding: 1.35rem 1.35rem 1.2rem;
  background: var(--card-bg);
  color: var(--ink-color);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

#terminal-confirm .page-title {
  margin: 0 2rem 0.45rem 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-color);
}

#terminal-confirm .page-lead {
  margin: 0 0 1.15rem;
  color: var(--muted-ink);
}

#terminal-confirm .page-actions {
  margin: 0;
}

#terminal-confirm .close {
  top: 0.85rem;
  right: 0.85rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  color: var(--muted-ink);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
}

#terminal-confirm .close:hover,
#terminal-confirm .close:focus {
  background: var(--accent-soft);
  color: var(--ink-color);
  transform: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 4rem;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  z-index: 9999;
  padding: 10px;
}
.close:hover {
  color: #dc3545;
  transform: scale(1.1);
  transition: all 0.2s ease-in-out;
}

/* ═══════════════════════════════════════════════════════════
   Tables — warm card UI matching clinic palette
   ═══════════════════════════════════════════════════════════ */

table.tabela,
table.table {
  --bs-table-bg: var(--card-bg);
  --bs-table-color: var(--ink-color);
  --bs-table-border-color: var(--table-border);
  --bs-table-striped-bg: var(--table-stripe);
  --bs-table-striped-color: var(--ink-color);
  --bs-table-hover-bg: var(--table-row-hover);
  --bs-table-hover-color: var(--ink-color);
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: "Inter", "Inter Fallback", "Segoe UI", Arial, sans-serif;
  color: var(--ink-color);
  background-color: var(--card-bg);
}

table.tabela {
  overflow: hidden;
  border: 1px solid var(--table-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  margin-top: 0.35rem;
  margin-bottom: 1.25rem;
}

table.tabela thead th:first-child {
  border-top-left-radius: calc(var(--card-radius) - 1px);
}

table.tabela thead th:last-child {
  border-top-right-radius: calc(var(--card-radius) - 1px);
}

table.tabela tbody tr:last-child td:first-child {
  border-bottom-left-radius: calc(var(--card-radius) - 1px);
}

table.tabela tbody tr:last-child td:last-child {
  border-bottom-right-radius: calc(var(--card-radius) - 1px);
}

.table-wrapper table.tabela,
.table-responsive table.tabela,
.card table.tabela,
.dataTables_wrapper table.tabela {
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.table-wrapper table.tabela thead th:first-child,
.table-wrapper table.tabela thead th:last-child,
.table-wrapper table.tabela tbody tr:last-child td:first-child,
.table-wrapper table.tabela tbody tr:last-child td:last-child,
.dataTables_wrapper table.tabela thead th:first-child,
.dataTables_wrapper table.tabela thead th:last-child,
.dataTables_wrapper table.tabela tbody tr:last-child td:first-child,
.dataTables_wrapper table.tabela tbody tr:last-child td:last-child {
  border-radius: 0;
}

table.tabela thead th,
table.table > thead > tr > th,
table.table thead.table-dark th,
table.table thead.table-light th,
.table-dark {
  background-color: var(--table-header-bg) !important;
  color: var(--table-head-color) !important;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.9rem 1rem;
  text-align: left;
  vertical-align: middle;
  border: none;
  border-bottom: 1px solid var(--table-border);
  white-space: nowrap;
}

table.tabela td,
table.table:not(.table-borderless) > :not(caption) > * > td {
  padding: 0.95rem 1rem;
  border-top: none;
  border-bottom: 1px solid var(--table-border);
  font-size: 0.9rem;
  color: var(--ink-color);
  vertical-align: middle;
  background-color: transparent;
}

table.tabela tbody tr:last-child td,
table.table tbody tr:last-child td {
  border-bottom: none;
}

table.tabela tfoot td,
table.table tfoot td,
table.tabela tfoot th,
table.table tfoot th,
table.tabela.dataTable tfoot td,
table.tabela.dataTable tfoot th,
table.table.dataTable tfoot td,
table.table.dataTable tfoot th {
  font-weight: 700;
  background: var(--table-header-bg);
  border-top: 1px solid var(--table-border);
  color: var(--ink-color);
}

table.tabela tfoot td.num,
table.tabela tfoot th.num,
table.table tfoot td.num,
table.table tfoot th.num,
table.tabela tfoot td.text-end,
table.tabela tfoot th.text-end,
table.table tfoot td.text-end,
table.table tfoot th.text-end,
table.tabela.dataTable tfoot td.num,
table.tabela.dataTable tfoot th.num,
table.table.dataTable tfoot td.num,
table.table.dataTable tfoot th.num,
table.tabela.dataTable tfoot td.text-end,
table.tabela.dataTable tfoot th.text-end,
table.table.dataTable tfoot td.text-end,
table.table.dataTable tfoot th.text-end {
  text-align: right !important;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

table.tabela tfoot td.movement-total,
table.tabela.dataTable tfoot td.movement-total,
table.tabela tfoot td.text-start,
table.tabela tfoot th.text-start,
table.table tfoot td.text-start,
table.table tfoot th.text-start {
  text-align: left !important;
  white-space: nowrap;
}

table.tabela:has(tfoot) tbody tr:last-child td {
  border-bottom: 1px solid var(--table-border);
}

table.tabela:has(tfoot) tbody tr:last-child td:first-child,
table.tabela:has(tfoot) tbody tr:last-child td:last-child {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

table.tabela tfoot tr:last-child td:first-child {
  border-bottom-left-radius: calc(var(--card-radius) - 1px);
}

table.tabela tfoot tr:last-child td:last-child {
  border-bottom-right-radius: calc(var(--card-radius) - 1px);
}

table.tabela tbody tr.is-subtotal td {
  font-weight: 700;
  background: var(--table-header-bg);
  color: var(--muted-ink);
}

table.tabela tbody tr.is-subtotal td.num {
  color: var(--ink-color);
  text-align: right;
  white-space: nowrap;
}

table.tabela tbody tr:nth-child(even),
table.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: var(--table-stripe);
}

table.tabela tbody tr:hover,
table.table tbody tr:hover > * {
  background-color: var(--table-row-hover);
}

/* Skeleton while a list is still the plain HTML table. Real rows fade in
   once DataTables has finished, instead of snapping into place. */
@keyframes clinic-skeleton-shimmer {
  0% { background-position: 140% 0; }
  100% { background-position: -40% 0; }
}

@keyframes clinic-table-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* The entries/search row is inserted above the grid once DataTables starts.
   Hold that same gap while the skeleton is showing, or the bars sit higher
   than the rows they stand in for. */
table.tabela:not(.is-ready):not(.is-static) {
  margin-top: 1rem;
}

.page table.tabela:not(.is-ready):not(.is-static),
.page-table > table.tabela:not(.is-ready):not(.is-static),
.page-head:has(h3) + table.tabela:not(.is-ready):not(.is-static) {
  margin-top: 0;
}

table.tabela:not(.is-ready):not(.is-static)::before {
  content: "";
  display: table-caption;
  caption-side: top;
  height: calc(1.15rem + 2.45rem + 0.85rem);
  padding: 0 1.2rem;
  background-image:
    linear-gradient(90deg, rgba(61, 46, 34, 0.07), rgba(61, 46, 34, 0.16), rgba(61, 46, 34, 0.07)),
    linear-gradient(90deg, rgba(61, 46, 34, 0.07), rgba(61, 46, 34, 0.16), rgba(61, 46, 34, 0.07));
  background-repeat: no-repeat;
  background-size: 9.5rem 0.62rem, 13.5rem 0.62rem;
  background-position:
    left 1.2rem top calc(1.15rem + (2.45rem - 0.62rem) / 2),
    right 1.2rem top calc(1.15rem + (2.45rem - 0.62rem) / 2);
}

[data-bs-theme="dark"] table.tabela:not(.is-ready):not(.is-static)::before {
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
}

table.tabela:not(.is-ready):not(.is-static) thead th:first-child,
table.tabela:not(.is-ready):not(.is-static) thead th:last-child {
  border-radius: 0;
}

table.tabela:not(.is-ready):not(.is-static) :is(th, td) {
  color: transparent !important;
  position: relative;
}

table.tabela:not(.is-ready):not(.is-static) :is(th, td) > * {
  opacity: 0;
}

table.tabela:not(.is-ready):not(.is-static) :is(th, td)::after {
  content: "";
  position: absolute;
  left: 1rem;
  top: 50%;
  height: 0.62rem;
  width: 68%;
  margin-top: -0.31rem;
  border-radius: 999px;
  background-image: linear-gradient(90deg, rgba(61, 46, 34, 0.07) 0%, rgba(61, 46, 34, 0.16) 45%, rgba(61, 46, 34, 0.07) 100%);
  background-size: 220% 100%;
  animation: clinic-skeleton-shimmer 1.15s ease-in-out infinite;
  pointer-events: none;
}

table.tabela:not(.is-ready):not(.is-static) :is(th, td):nth-child(3n)::after {
  width: 46%;
}

table.tabela:not(.is-ready):not(.is-static) :is(th, td):nth-child(3n + 2)::after {
  width: 78%;
}

table.tabela:not(.is-ready):not(.is-static) thead th::after {
  width: 42%;
  height: 0.5rem;
  margin-top: -0.25rem;
}

[data-bs-theme="dark"] table.tabela:not(.is-ready):not(.is-static) :is(th, td)::after {
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.16) 45%, rgba(255, 255, 255, 0.06) 100%);
}

table.tabela.is-ready,
.dataTables_wrapper.is-ready {
  animation: clinic-table-in 0.32s ease;
}

@media (prefers-reduced-motion: reduce) {
  table.tabela:not(.is-ready):not(.is-static) :is(th, td)::after,
  table.tabela.is-ready,
  .dataTables_wrapper.is-ready {
    animation: none;
  }
}

table.tabela a,
table.table a {
  color: var(--table-link);
  font-weight: 600;
  text-decoration: none;
}

table.tabela a:hover,
table.table a:hover {
  color: var(--ink-color);
  text-decoration: underline;
}

.table-bordered > :not(caption) > * > * {
  border-color: var(--table-border);
}

.table-wrapper {
  background-color: var(--card-bg);
  border: 1px solid var(--table-border);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-top: 1.25rem;
}

.dataTables_wrapper table.dataTable {
  width: 100% !important;
}

.dataTables_wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--table-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 1.15rem 1.2rem 0.9rem;
  margin-top: 1rem;
  color: var(--ink-color);
}

.dataTables_wrapper::after {
  display: none;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dt-buttons,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  color: var(--muted-ink);
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
}

div.dataTables_wrapper div.dt-buttons,
div.dataTables_wrapper div.dataTables_filter,
div.dataTables_wrapper div.dataTables_length {
  float: none;
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 2.45rem;
  margin: 0 0 0.85rem;
}

div.dataTables_wrapper div.dataTables_length label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: auto;
  margin: 0;
}

div.dataTables_wrapper > div.dt-buttons.is-table-export {
  margin-left: auto;
  margin-right: 0.5rem;
}

div.dataTables_wrapper div.dataTables_filter:has(.dt-buttons) {
  margin-left: auto;
  gap: 0.5rem;
}

div.dataTables_wrapper div.dataTables_filter .dt-buttons {
  margin: 0;
  min-height: 0;
}

div.dataTables_wrapper div.dataTables_info,
div.dataTables_wrapper div.dataTables_paginate {
  float: none;
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 2.2rem;
  margin: 0;
}

div.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_info {
  margin-right: auto;
}

div.dataTables_wrapper div.dataTables_filter,
div.dataTables_wrapper div.dataTables_paginate {
  margin-left: auto;
  text-align: right;
}

.dataTables_wrapper > .row > [class*="col-"]:has(.dataTables_filter),
.dataTables_wrapper > .row > [class*="col-"]:has(.dataTables_paginate) {
  display: flex;
  justify-content: flex-end;
}

.dataTables_wrapper > table.dataTable,
.dataTables_wrapper .dataTables_scroll,
.dataTables_wrapper > .row {
  flex: 1 0 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 0.85rem;
}

.dataTables_wrapper > .row {
  margin-left: 0;
  margin-right: 0;
}

div.dataTables_wrapper div.dataTables_filter label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--ink-color);
  white-space: nowrap;
}

.dataTables_wrapper .dataTables_scroll,
.dataTables_wrapper table.dataTable {
  clear: both;
}

div.dataTables_wrapper div.dt-buttons .btn,
div.dataTables_wrapper .buttons-excel,
div.dataTables_wrapper .buttons-html5 {
  border: 1px solid var(--btn-secondary-border) !important;
  background: var(--btn-secondary-bg) !important;
  color: var(--btn-secondary-color) !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  font-weight: 600;
  min-height: 2.45rem;
  padding: 0.5rem 1.15rem;
}

div.dataTables_wrapper div.dt-buttons .btn:hover,
div.dataTables_wrapper div.dt-buttons .btn:focus {
  background: var(--btn-secondary-hover-bg) !important;
  border-color: var(--btn-secondary-border) !important;
  color: var(--btn-secondary-hover-color) !important;
  box-shadow: none !important;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background-color: var(--btn-secondary-bg);
  color: var(--ink-color);
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.dataTables_wrapper > .dt-date-range {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.45rem;
  margin: 0 0.75rem 0.85rem auto;
  min-height: 2.45rem;
  max-width: 100%;
}

.dataTables_wrapper:has(> .dt-date-range) > .dataTables_filter {
  margin-left: 0;
}

.dt-date-range .dt-date-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.dt-date-range .dt-date-sep {
  color: var(--muted-ink);
  font-weight: 600;
}

.dt-date-range input,
.dt-date-range .form-control,
.dt-date-range .flatpickr-input,
.dt-date-range .clinic-date {
  width: 9.4rem;
  min-width: 9.4rem;
  max-width: 9.4rem;
  flex: 0 0 9.4rem;
  min-height: 2.45rem;
  background: var(--btn-secondary-bg);
  color: var(--ink-color);
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  box-shadow: none;
}

.dt-date-range input:focus,
.dt-date-range .form-control:focus,
.dt-date-range .flatpickr-input:focus,
.dt-date-range .clinic-date:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.summary > .row > div {
  min-width: 0;
}

@media (max-width: 720px) {
  .dataTables_wrapper > .dt-date-range {
    flex: 1 0 100%;
    margin-left: 0;
  }
}

div.dataTables_wrapper div.dataTables_info {
  margin-right: auto;
}

.pagination,
.dataTables_wrapper .dataTables_paginate .pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}

.pagination .page-item,
.dataTables_wrapper .dataTables_paginate .paginate_button {
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.pagination .page-item .page-link {
  box-sizing: border-box;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.45rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px !important;
  border: 1px solid var(--page-btn-border) !important;
  background: var(--page-btn-bg) !important;
  color: var(--page-btn-color) !important;
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1;
  box-shadow: none !important;
  margin: 0 !important;
}

.pagination .page-item:not(:first-child) .page-link {
  margin-left: 0 !important;
}

.pagination .page-item .page-link:hover,
.pagination .page-item .page-link:focus {
  background: var(--page-btn-hover-bg) !important;
  border-color: var(--page-btn-border) !important;
  color: var(--page-btn-hover-color) !important;
  z-index: 1;
}

.pagination .page-item.active .page-link {
  background: var(--page-btn-active-bg) !important;
  border-color: var(--page-btn-active-bg) !important;
  color: var(--page-btn-active-color) !important;
}

.pagination .page-item.disabled .page-link {
  background: var(--page-btn-disabled-bg) !important;
  border-color: var(--page-btn-border) !important;
  color: var(--page-btn-disabled-color) !important;
  opacity: 1;
  cursor: default;
}

.pagination .page-item.disabled:not(.previous):not(.next):not(.first):not(.last) .page-link {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--page-btn-color) !important;
  min-width: 1.2rem;
  height: auto;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.pagination .page-item.first .page-link,
.pagination .page-item.previous .page-link,
.pagination .page-item.next .page-link,
.pagination .page-item.last .page-link {
  font-size: 0 !important;
  color: transparent !important;
}

.pagination .page-item.first .page-link::before,
.pagination .page-item.previous .page-link::before,
.pagination .page-item.next .page-link::before,
.pagination .page-item.last .page-link::before {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  color: var(--page-btn-color);
}

.pagination .page-item.first .page-link::before {
  content: "«";
}

.pagination .page-item.previous .page-link::before {
  content: "‹";
}

.pagination .page-item.next .page-link::before {
  content: "›";
}

.pagination .page-item.last .page-link::before {
  content: "»";
}

.pagination .page-item.disabled.first .page-link::before,
.pagination .page-item.disabled.previous .page-link::before,
.pagination .page-item.disabled.next .page-link::before,
.pagination .page-item.disabled.last .page-link::before {
  color: var(--page-btn-disabled-color);
}

.pagination .page-item.first .page-link:hover::before,
.pagination .page-item.previous .page-link:hover::before,
.pagination .page-item.next .page-link:hover::before,
.pagination .page-item.last .page-link:hover::before {
  color: var(--page-btn-hover-color);
}

table.dataTable thead > tr > th.sorting:before,
table.dataTable thead > tr > th.sorting:after,
table.dataTable thead > tr > th.sorting_asc:before,
table.dataTable thead > tr > th.sorting_asc:after,
table.dataTable thead > tr > th.sorting_desc:before,
table.dataTable thead > tr > th.sorting_desc:after,
table.dataTable thead > tr > th.sorting_asc_disabled:before,
table.dataTable thead > tr > th.sorting_asc_disabled:after,
table.dataTable thead > tr > th.sorting_desc_disabled:before,
table.dataTable thead > tr > th.sorting_desc_disabled:after {
  color: var(--muted-ink) !important;
}

.form-control.is-country-open {
  border-color: var(--accent-color);
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: none;
}

.country-suggest {
  position: fixed;
  z-index: 1080;
  max-height: 16rem;
  margin: 0;
  padding: 0.2rem 0;
  overflow: auto;
  background: #fff;
  color: var(--ink-color);
  border: 1px solid var(--accent-color);
  border-top: 0;
  border-radius: 0 0 0.375rem 0.375rem;
  box-shadow: 0 12px 28px rgba(61, 46, 34, 0.16);
}

.country-suggest button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.country-suggest button.is-active,
.country-suggest button:hover {
  background: rgba(61, 46, 34, 0.06);
}

.country-suggest img,
.country-field-flag,
.entries-menu-label img,
.entries-menu > .entries-menu-flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex: 0 0 auto;
}

.country-field {
  position: relative;
  display: block;
  width: 100%;
}

.country-field-flag {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  pointer-events: none;
}

.form-control.has-country-flag {
  padding-left: 2.55rem;
}

[data-bs-theme="dark"] .country-suggest {
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .country-suggest button.is-active,
[data-bs-theme="dark"] .country-suggest button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.clinic-toasts {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: max-content;
  max-width: min(32rem, calc(100% - 2rem));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.clinic-toast {
  width: max-content;
  max-width: 100%;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--accent-color);
  background-color: var(--card-bg);
  background-image: linear-gradient(180deg, #3d2414 0%, var(--card-bg) 70%);
  color: var(--ink-color);
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(8px);
  animation: clinic-toast-in 0.22s ease forwards;
}

.clinic-toast.is-error {
  border-color: #e23d34;
  background-color: var(--card-bg);
  background-image: linear-gradient(180deg, #4a1c1c 0%, var(--card-bg) 70%);
}

.clinic-toast.is-warning {
  border-color: #f59a2a;
  background-color: var(--card-bg);
  background-image: linear-gradient(180deg, #3d2a12 0%, var(--card-bg) 70%);
}

[data-bs-theme="light"] .clinic-toast {
  border-color: #fd7e14;
  background-color: #fff7f0;
  background-image: linear-gradient(180deg, #ffe4cc 0%, #fff7f0 72%);
  color: #6b3410;
  box-shadow: 0 10px 24px rgba(120, 72, 16, 0.14);
}

[data-bs-theme="light"] .clinic-toast.is-error {
  border-color: #e07a74;
  background-color: #fff6f5;
  background-image: linear-gradient(180deg, #ffd8d4 0%, #fff6f5 72%);
  color: #8f2230;
  box-shadow: 0 10px 24px rgba(143, 34, 48, 0.12);
}

[data-bs-theme="light"] .clinic-toast.is-warning {
  border-color: #e3a23a;
  background-color: #fffaf3;
  background-image: linear-gradient(180deg, #ffe8c2 0%, #fffaf3 72%);
  color: #6b4210;
  box-shadow: 0 10px 24px rgba(120, 72, 16, 0.14);
}

.clinic-toast.is-out {
  animation: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

@keyframes clinic-toast-in {
  to {
    opacity: 1;
    transform: none;
  }
}

.taxonomy-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.taxonomy-tabs a {
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  color: var(--ink-color);
  background: var(--btn-secondary-bg);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.taxonomy-tabs a.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.taxonomy-page .card,
[data-bs-theme="dark"] .taxonomy-page .card,
[data-bs-theme="dark"] .taxonomy-page .card-body,
[data-bs-theme="dark"] .taxonomy-page .card-header {
  background: var(--card-bg);
  background-color: var(--card-bg);
  color: var(--ink-color);
  border-color: var(--table-border);
}

.taxonomy-page .card {
  border: 1px solid var(--table-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.taxonomy-page .card-header {
  background: transparent;
  color: var(--ink-color);
  border-bottom: 1px solid var(--table-border);
}

.taxonomy-page .taxonomy-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.taxonomy-page .taxonomy-form .card {
  margin-bottom: 0;
}

.taxonomy-page .taxonomy-table {
  min-width: 0;
}

.taxonomy-page table.tabela {
  width: 100%;
  margin-top: 0;
}

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

.taxonomy-page table.tabela th:first-child,
.taxonomy-page table.tabela td:first-child {
  width: 1%;
  white-space: nowrap;
}

.taxonomy-page table.tabela th.row-actions,
.taxonomy-page table.tabela td.row-actions {
  width: 1%;
  min-width: 0;
  white-space: nowrap;
  text-align: right;
}

.taxonomy-page .form-control,
.taxonomy-page .form-select,
[data-bs-theme="dark"] .taxonomy-page .form-control,
[data-bs-theme="dark"] .taxonomy-page .form-select {
  background-color: var(--btn-secondary-bg);
  color: var(--ink-color);
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  box-shadow: none;
}

.taxonomy-page .form-control:focus,
.taxonomy-page .form-select:focus,
[data-bs-theme="dark"] .taxonomy-page .form-control:focus,
[data-bs-theme="dark"] .taxonomy-page .form-select:focus {
  background-color: var(--btn-secondary-bg);
  color: var(--ink-color);
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.taxonomy-page .row-edit button,
.taxonomy-page table.tabela td.row-actions > button,
.taxonomy-page table.tabela td.row-actions > button:first-child,
.taxonomy-page table.tabela td.row-actions > button:last-child,
.taxonomy-page table.tabela td.row-actions > button:only-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  margin: 0 0.35rem 0 0;
  padding: 0 0.95rem;
  border: 1px solid var(--accent-color);
  border-radius: 0.55rem;
  background: transparent;
  color: var(--accent-color) !important;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

.taxonomy-page table.tabela td.row-actions {
  display: table-cell;
}

.taxonomy-page table.tabela td.row-actions > button,
.taxonomy-page table.tabela td.row-actions form {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
}

.taxonomy-page table.tabela td.row-actions > button + button,
.taxonomy-page table.tabela td.row-actions > a + button,
.taxonomy-page table.tabela td.row-actions > button + a,
.taxonomy-page table.tabela td.row-actions > a + a {
  margin-left: 0;
}

.taxonomy-page table.tabela td.row-actions form {
  margin-left: 0.5rem;
}

.taxonomy-page .entries-menu {
  display: flex;
  width: 100%;
}

.taxonomy-page .entries-menu-btn {
  width: 100%;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.taxonomy-page .row-edit button:hover,
.taxonomy-page .row-edit button:focus,
.taxonomy-page table.tabela td.row-actions > button:hover,
.taxonomy-page table.tabela td.row-actions > button:focus {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff !important;
}

.taxonomy-page table.tabela td.row-actions > button.is-danger {
  border-color: #ef4444;
  background: transparent;
  color: #ef4444 !important;
}

.taxonomy-page table.tabela td.row-actions > button.is-danger:hover,
.taxonomy-page table.tabela td.row-actions > button.is-danger:focus,
[data-bs-theme="dark"] .taxonomy-page table.tabela td.row-actions > button.is-danger:hover,
[data-bs-theme="dark"] .taxonomy-page table.tabela td.row-actions > button.is-danger:focus {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff !important;
}

[data-bs-theme="dark"] .taxonomy-page table.tabela td.row-actions > button.is-danger {
  border-color: #ef4444;
  background: transparent;
  color: #ef4444 !important;
}

.taxonomy-page tr.taxonomy-edit td {
  background: var(--card-bg);
}

@media (max-width: 900px) {
  .taxonomy-page .taxonomy-layout {
    grid-template-columns: 1fr;
  }
}

.movement-page {
  max-width: 100%;
  min-width: 0;
}

.movement-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 1.25rem;
  align-items: start;
  margin-bottom: 0.85rem;
}

.movement-top h2 {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  margin: 0;
}

.movement-back-slot {
  grid-column: 2;
  grid-row: 1;
  height: 2.85rem;
}

.movement-range {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.45rem 0.65rem;
  justify-self: end;
  width: max-content;
  max-width: 100%;
  margin-top: 1rem;
}

.movement-range label {
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.85rem;
  font-weight: 600;
}

.movement-date,
.movement-range .clinic-date,
.movement-range .form-control {
  width: 9.6rem;
  min-width: 9.6rem;
  flex: 0 0 auto;
  min-height: 2.45rem;
  background: var(--btn-secondary-bg);
  color: var(--ink-color);
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  color-scheme: light;
}

.movement-date:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

[data-bs-theme="dark"] .movement-date {
  color-scheme: dark;
}

.movement-page .dataTables_wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.movement-page table.dataTable {
  width: 100% !important;
}

.movement-page table.tabela th,
.movement-page table.tabela td {
  white-space: normal;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.movement-page #transactionsTable th:first-child,
.movement-page #transactionsTable td:first-child {
  width: 3.6rem !important;
  max-width: 3.6rem;
  white-space: nowrap;
  padding-left: 0.7rem;
  padding-right: 0.45rem;
}

.movement-page #transactionsTable th:first-child {
  padding-right: 1.15rem;
}

.movement-page #transactionsTable tfoot td.movement-total {
  position: relative;
  overflow: visible;
}

.movement-page #transactionsTable tfoot .movement-vat {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.movement-page table.tabela td.text-end {
  white-space: nowrap;
}

.movement-page table.tabela tbody tr.movement-outside {
  display: none;
}

@media (max-width: 767.98px) {
  .movement-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .movement-back-slot {
    display: none;
  }

  .movement-range {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: auto;
  }
}

.movement-page .dataTables_scrollBody tfoot {
  display: none;
}

.movement-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.movement-vat {
  position: static;
  display: flex;
  align-items: center;
  margin: 0;
  padding-left: 2.6em;
  transform: none;
  white-space: nowrap;
}

.movement-vat .form-check-label {
  color: var(--ink-color);
}

table.tabela td {
  position: relative;
  overflow: visible !important;
}

table.tabela tbody tr {
  transition: background-color 0.18s ease;
}

table.tabela tbody tr[onclick],
table.tabela tbody tr[data-expense-id],
table.tabela tbody tr[data-credit-id],
table.tabela tbody tr[data-debit-id],
table.tabela tbody tr[data-payment-id],
table.tabela tbody tr[data-return-id],
table.tabela tbody tr[style*="cursor:pointer"],
table.tabela tbody tr[style*="cursor: pointer"] {
  cursor: pointer;
}

#itemsTable.tabela,
#itemsTable.tabela td {
  overflow: visible !important;
}

#itemsTable.tabela .itemList {
  z-index: 999999 !important;
}

.itemList {
  display: block;
  background: var(--card-bg);
  color: var(--ink-color);
  box-shadow: var(--card-shadow);
  z-index: 9999 !important;
}

#filterTable,
#filterTable1,
#filterTable2,
#filterTable3,
#filterTable4,
#LastNextPatients,
#conversationTable,
#CurrentlyAtHospital,
#WaitingProformas {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-bg);
  color: var(--ink-color);
  border: 1px solid var(--table-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

#filterTable th,
#filterTable1 th,
#filterTable2 th,
#filterTable3 th,
#filterTable4 th,
#LastNextPatients th,
#conversationTable th,
#CurrentlyAtHospital th,
#WaitingProformas th {
  background-color: var(--table-header-bg);
  color: var(--table-head-color);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--table-border);
}

#filterTable td,
#filterTable1 td,
#filterTable2 td,
#filterTable3 td,
#filterTable4 td,
#LastNextPatients td,
#conversationTable td,
#CurrentlyAtHospital td,
#WaitingProformas td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--table-border);
  color: var(--ink-color);
}

#filterTable tr:nth-child(even),
#filterTable1 tr:nth-child(even),
#filterTable2 tr:nth-child(even),
#filterTable3 tr:nth-child(even),
#filterTable4 tr:nth-child(even),
#LastNextPatients tr:nth-child(even),
#conversationTable tr:nth-child(even),
#CurrentlyAtHospital tr:nth-child(even),
#WaitingProformas tr:nth-child(even) {
  background-color: var(--table-stripe);
}

#filterTable tr:hover,
#filterTable1 tr:hover,
#filterTable2 tr:hover,
#filterTable3 tr:hover,
#filterTable4 tr:hover,
#LastNextPatients tr:hover,
#conversationTable tr:hover,
#CurrentlyAtHospital tr:hover,
#WaitingProformas tr:hover {
  background-color: var(--table-row-hover);
}

#filterTable a,
#filterTable1 a,
#filterTable2 a,
#filterTable3 a,
#filterTable4 a,
#LastNextPatients a,
#conversationTable a,
#CurrentlyAtHospital a,
#WaitingProformas a {
  color: var(--table-link);
  font-weight: 600;
  text-decoration: none;
}

/* Global dropdown submenu styles - used in multiple headers */
.nav-tabs .dropdown-menu {
  position: absolute !important;
}

.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
  display: none;
  position: absolute;
  z-index: 1050;
}

.dropdown-submenu:hover > .dropdown-menu {
  display: block;
}

/* Global utility classes - used across multiple modules */
.status-badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
}

.attachment-list {
  max-height: 200px;
  overflow-y: auto;
}

.file-row {
  padding: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.audit-filter {
  background: var(--bs-tertiary-bg);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Cross-cutting project styles used by multiple modules */

/* Project specific cards - used across modules */
.card-blue,
.card-green,
.card-orange,
.card-lightblue {
  border-left: 4px solid var(--accent-peach);
}
.card-dark {
  border-left: 4px solid #212529;
}

/* Generic utility classes used across modules */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.badge.badge-status {
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.42rem 0.95rem;
  line-height: 1.2;
}

.badge.bg-primary,
.badge.bg-success,
.badge.text-bg-primary,
.badge.text-bg-success {
  background-color: var(--accent-soft) !important;
  color: var(--ink-color) !important;
}

.badge.bg-secondary,
.badge.bg-info,
.badge.bg-warning,
.badge.bg-light,
.badge.text-bg-secondary,
.badge.text-bg-info,
.badge.text-bg-warning,
.badge.text-bg-light {
  background-color: rgba(138, 106, 82, 0.12) !important;
  color: var(--muted-ink) !important;
}

.badge.bg-danger,
.badge.text-bg-danger {
  background-color: rgba(220, 53, 69, 0.1) !important;
  color: #b02a37 !important;
}

.alert-success,
.alert-info,
.alert-warning,
.alert-primary {
  background: var(--accent-soft);
  color: var(--ink-color);
  border-color: transparent;
}

.alert-danger {
  background: rgba(220, 53, 69, 0.08);
  color: #8f2230;
  border-color: transparent;
}

.modal-header.bg-primary,
.modal-header.bg-success,
.modal-header.bg-info,
.modal-header.bg-warning {
  background-color: var(--accent-soft) !important;
  color: var(--ink-color) !important;
}

.modal-header.bg-danger {
  background-color: rgba(220, 53, 69, 0.08) !important;
  color: #8f2230 !important;
}
.badge-priority {
  text-transform: uppercase;
  font-weight: 600;
}
.avatar-lg {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

/* Generic button styles used across modules */
.deleteEmployeeBtn,
.editEmployeeBtn,
.editContractBtn,
.edit-task,
.delete-task {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  text-decoration: none;
  margin: 0 0.25rem;
}

.deleteEmployeeBtn,
.delete-task {
  background: #dc3545;
  color: white;
}
.editEmployeeBtn,
.editContractBtn,
.edit-task {
  background: #0d6efd;
  color: white;
}

/* File handling used across modules */
.file-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Close button used across modules */
.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Responsive utilities for shared components */
@media (max-width: 768px) {
  .avatar-lg {
    width: 48px;
    height: 48px;
  }
  .card-blue,
  .card-green,
  .card-orange,
  .card-lightblue,
  .card-dark {
    border-left-width: 2px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Site-wide dark mode — light text on dark surfaces
   Covers pages that hardcode light backgrounds / dark text
   ═══════════════════════════════════════════════════════════ */

[data-bs-theme="dark"] {
  color-scheme: dark;
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] main,
[data-bs-theme="dark"] .flex-grow-1 {
  background-color: var(--page-bg) !important;
  color: var(--ink-color) !important;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] label,
[data-bs-theme="dark"] p,
[data-bs-theme="dark"] .form-label {
  color: var(--ink-color);
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .text-info,
[data-bs-theme="dark"] .text-success,
[data-bs-theme="dark"] .text-warning {
  color: var(--muted-ink) !important;
}

[data-bs-theme="dark"] .text-primary {
  color: #ffb36b !important;
}

[data-bs-theme="dark"] .text-danger {
  color: #f87171 !important;
}

[data-bs-theme="dark"] .badge.bg-primary,
[data-bs-theme="dark"] .badge.bg-success,
[data-bs-theme="dark"] .badge.text-bg-primary,
[data-bs-theme="dark"] .badge.text-bg-success {
  background-color: rgba(253, 126, 20, 0.16) !important;
  color: #ffb36b !important;
}

[data-bs-theme="dark"] .badge.bg-secondary,
[data-bs-theme="dark"] .badge.bg-info,
[data-bs-theme="dark"] .badge.bg-warning,
[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge.text-bg-secondary,
[data-bs-theme="dark"] .badge.text-bg-info,
[data-bs-theme="dark"] .badge.text-bg-warning,
[data-bs-theme="dark"] .badge.text-bg-light {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--muted-ink) !important;
}

[data-bs-theme="dark"] .badge.bg-danger,
[data-bs-theme="dark"] .badge.text-bg-danger {
  background-color: rgba(248, 113, 113, 0.14) !important;
  color: #f87171 !important;
}

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

[data-bs-theme="dark"] .bg-white {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .bg-light {
  background-color: var(--bs-tertiary-bg) !important;
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card-body,
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .card-header.bg-white,
[data-bs-theme="dark"] .card-header.bg-light,
[data-bs-theme="dark"] .card-body.bg-light {
  background-color: var(--bs-tertiary-bg) !important;
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .list-group-item {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .list-group-item-action:hover,
[data-bs-theme="dark"] .list-group-item-action:focus {
  background-color: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .offcanvas,
[data-bs-theme="dark"] .offcanvas-header,
[data-bs-theme="dark"] .offcanvas-body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] #sidebarMenu,
[data-bs-theme="dark"] #sidebarMenu .offcanvas-header,
[data-bs-theme="dark"] #sidebarMenu .offcanvas-body {
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
}

[data-bs-theme="dark"] #sidebarMenu .text-dark,
[data-bs-theme="dark"] #sidebarMenu .text-body {
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text,
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] input[type="text"],
[data-bs-theme="dark"] input[type="number"],
[data-bs-theme="dark"] input[type="email"],
[data-bs-theme="dark"] input[type="password"],
[data-bs-theme="dark"] input[type="date"],
[data-bs-theme="dark"] input[type="search"],
[data-bs-theme="dark"] select {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

.form-control:focus,
.form-select:focus,
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-color: var(--focus-border) !important;
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
}

.form-check-input:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

.form-check-input:checked,
.form-switch .form-check-input:checked {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: var(--bs-secondary-color);
  opacity: 0.8;
}

[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .table > :not(caption) > * > * {
  color: var(--ink-color);
  border-color: var(--table-border);
  background-color: transparent;
}

[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light > th,
[data-bs-theme="dark"] .table-light > td {
  background-color: var(--table-header-bg) !important;
  color: var(--ink-color) !important;
}

[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] table th {
  color: var(--table-head-color);
  border-color: var(--table-border);
}

/* Beat page-local <style> th { background:#f0f0f0 } rules */
[data-bs-theme="dark"] table:not(.tabela) > thead > tr > th,
[data-bs-theme="dark"] table:not(.tabela) > tbody > tr > th,
[data-bs-theme="dark"] .table > thead > tr > th {
  background-color: var(--table-header-bg) !important;
  color: var(--table-head-color) !important;
}

[data-bs-theme="dark"] .dropdown-menu {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

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

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .dropdown-divider {
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .modal-content {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

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

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

[data-bs-theme="dark"] .close {
  color: var(--bs-body-color);
  filter: none;
}

[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge.bg-light.text-dark {
  background-color: var(--bs-secondary-bg) !important;
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .alert {
  border-color: var(--bs-border-color);
}

/* Autocomplete / typeahead lists (override inline white backgrounds) */
[data-bs-theme="dark"] .itemList,
[data-bs-theme="dark"] .pay-search-dropdown,
[data-bs-theme="dark"] #supplierList,
[data-bs-theme="dark"] #transportSupplierList,
[data-bs-theme="dark"] .item-filter-dropdown,
[data-bs-theme="dark"] .item-filter-list,
[data-bs-theme="dark"] .item-filter-toggle,
[data-bs-theme="dark"] ul[style*="background:#fff"],
[data-bs-theme="dark"] ul[style*="background: #fff"],
[data-bs-theme="dark"] ul[style*="background:#ffffff"],
[data-bs-theme="dark"] ul[style*="background: #ffffff"] {
  background: var(--bs-body-bg) !important;
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .itemList li,
[data-bs-theme="dark"] .pay-search-dropdown li,
[data-bs-theme="dark"] #supplierList li,
[data-bs-theme="dark"] #transportSupplierList li,
[data-bs-theme="dark"] .item-filter-option {
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .itemList li:hover,
[data-bs-theme="dark"] .itemList li.active,
[data-bs-theme="dark"] #supplierList li:hover,
[data-bs-theme="dark"] .item-filter-option:hover {
  background-color: var(--bs-tertiary-bg) !important;
  color: var(--bs-body-color) !important;
}

/* Override common inline light row/header/footer backgrounds */
[data-bs-theme="dark"] tr[style*="background:#f"],
[data-bs-theme="dark"] tr[style*="background: #f"],
[data-bs-theme="dark"] tr[style*="background-color:#f"],
[data-bs-theme="dark"] tr[style*="background-color: #f"],
[data-bs-theme="dark"] tr[style*="background:#e9ecef"],
[data-bs-theme="dark"] tr[style*="background: #e9ecef"],
[data-bs-theme="dark"] tr[style*="background-color:#e9ecef"],
[data-bs-theme="dark"] tfoot[style*="background"],
[data-bs-theme="dark"] td[style*="background:#f"],
[data-bs-theme="dark"] td[style*="background: #f"],
[data-bs-theme="dark"] th[style*="background:#f"],
[data-bs-theme="dark"] th[style*="background: #f"],
[data-bs-theme="dark"] th[style*="background-color:#f"],
[data-bs-theme="dark"] th[style*="background-color: #f"] {
  background-color: var(--bs-tertiary-bg) !important;
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] tr[style*="background-color:#fff8e1"],
[data-bs-theme="dark"] tr[style*="background-color: #fff8e1"] {
  background-color: rgba(255, 193, 7, 0.15) !important;
  color: var(--bs-body-color) !important;
}

/* Soft KPI / report cards with hardcoded #f4f7f6 */
[data-bs-theme="dark"] .card[style*="background:#f4f7f6"],
[data-bs-theme="dark"] .card[style*="background: #f4f7f6"],
[data-bs-theme="dark"] .card[style*="background:#e9eceb"],
[data-bs-theme="dark"] .card[style*="background: #e9eceb"],
[data-bs-theme="dark"] div[style*="background:#f4f7f6"],
[data-bs-theme="dark"] div[style*="background: #f4f7f6"],
[data-bs-theme="dark"] div[style*="background-color: #f8f9fa"],
[data-bs-theme="dark"] div[style*="background-color:#f8f9fa"] {
  background: var(--bs-secondary-bg) !important;
  background-color: var(--bs-secondary-bg) !important;
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] thead[style*="background-color: #f8f9fa"],
[data-bs-theme="dark"] thead[style*="background-color:#f8f9fa"] {
  background-color: var(--table-header-bg) !important;
  color: var(--table-head-color) !important;
}

/* Dashboard cards */
[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .chart-card,
[data-bs-theme="dark"] .custom-table-card {
  background-color: var(--card-bg, var(--bs-secondary-bg)) !important;
  color: var(--ink-color, var(--bs-body-color)) !important;
}

[data-bs-theme="dark"] .chart-card:hover {
  background-color: var(--stat-hover-bg, var(--bs-tertiary-bg)) !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45) !important;
}

[data-bs-theme="dark"] .chart-title {
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .tabela td {
  color: var(--ink-color);
}

[data-bs-theme="dark"] .tabela tbody tr:nth-child(even) {
  background-color: var(--table-stripe);
}

[data-bs-theme="dark"] .tabela tbody tr:nth-child(odd) {
  background-color: transparent;
}

[data-bs-theme="dark"] .tabela tbody tr:hover {
  background-color: var(--table-row-hover);
}

[data-bs-theme="dark"] .file-row {
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate {
  color: var(--muted-ink) !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select,
[data-bs-theme="dark"] .items-card-toolbar .dataTables_filter input {
  background-color: var(--btn-secondary-bg) !important;
  color: var(--ink-color) !important;
  border-color: var(--btn-secondary-border) !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input:focus,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select:focus,
[data-bs-theme="dark"] .items-card-toolbar .dataTables_filter input:focus {
  border-color: var(--focus-border) !important;
}

[data-bs-theme="dark"] table.dataTable thead th,
[data-bs-theme="dark"] table.dataTable tbody td {
  border-color: var(--table-border) !important;
  color: var(--ink-color);
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] footer,
[data-bs-theme="dark"] footer a {
  color: var(--bs-secondary-color);
}

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

[data-bs-theme="dark"] hr {
  border-color: var(--bs-border-color);
  opacity: 0.4;
}

[data-bs-theme="dark"] .page-link {
  background-color: var(--page-btn-bg);
  color: var(--page-btn-color);
  border-color: var(--page-btn-border);
}

[data-bs-theme="dark"] .page-item.active .page-link {
  background-color: var(--page-btn-active-bg);
  border-color: var(--page-btn-active-bg);
  color: var(--page-btn-active-color);
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
  background-color: var(--page-btn-disabled-bg);
  color: var(--page-btn-disabled-color);
}

[data-bs-theme="dark"] .accordion-item,
[data-bs-theme="dark"] .accordion-button {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
  background-color: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .accordion-button::after {
  filter: invert(1);
}

/* ═══════════════════════════════════════════════════════════
   Page frame — shared by list, document, and form screens
   ═══════════════════════════════════════════════════════════ */

/* Same side inset as the dashboard on every screen. */
.app-content > main {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

@media (min-width: 992px) {
  .app-content > main {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

.page {
  width: 100%;
  padding: 1.5rem 0 2.5rem;
}

.app-content > main > .container,
.app-content > main > .container-fluid,
.app-content > main > .container-sm,
.app-content > main > .container-md,
.app-content > main > .container-lg,
.app-content > main > .container-xl,
.app-content > main > .container-xxl {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.app-content > main:has(> .page-back) {
  display: grid;
}

.app-content > main:has(> .page-back) > script {
  display: none;
}

.page-back {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  justify-self: end;
  align-self: start;
  z-index: 2;
  padding-top: 1.5rem;
  pointer-events: none;
}

.page-back .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  pointer-events: auto;
  border-color: var(--accent-color);
}

.page-back .btn:hover,
.page-back .btn:focus,
.page-back .btn:active {
  border-color: var(--accent-color);
}

@media (min-width: 768px) {
  .app-content > main:has(> .page-back) > .page-back,
  .app-content > main:has(> .page-back) > .container,
  .app-content > main:has(> .page-back) > .page {
    grid-area: 1 / 1;
  }

  .app-content > main:has(> .page-back) > .container > h2:first-child,
  .app-content > main:has(> .page-back) > .page > .page-head {
    padding-right: 15rem;
  }
}

.page-head,
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-head {
  margin-bottom: 1.25rem;
}

.page-title,
.dash-header h2 {
  margin: 0;
  color: var(--ink-color);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-title {
  font-size: 1.75rem;
}

.page-head:has(h3) {
  align-items: center;
  margin-bottom: 0.65rem;
}

.page-head h3 {
  margin: 0;
  color: var(--ink-color);
  font-weight: 700;
}

.page-head:has(h3) + .dataTables_wrapper {
  margin-top: 0;
}

.summary > .row {
  align-items: stretch;
}

.summary > .row > div {
  flex: 1 1 0 !important;
  width: 0 !important;
  max-width: none !important;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.summary > .row > div > .dataTables_wrapper {
  flex: 1 1 auto;
  width: 100%;
  align-content: flex-start;
}

@media (max-width: 767.98px) {
  .summary > .row {
    flex-direction: column;
  }

  .summary > .row > div {
    width: 100% !important;
    flex-basis: auto !important;
  }
}

.page-lead,
.dash-header .text-muted {
  margin: 0.35rem 0 0;
  color: var(--muted-ink) !important;
}

/* Older lists used <br> as a spacer under the title. That stacked with
   the heading margin and pushed the table down. */
.app-content > main .container > br,
.app-content > main .container-fluid > br {
  display: none;
}

.app-content > main .container > form.row,
.app-content > main .container-fluid > form.row {
  margin-top: 0.75rem;
}

/* Bootstrap 4 form-inline no longer sits on one line, so report filters
   stacked and left a tall gap before the table. */
form.form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.85rem;
  margin-top: 0.75rem;
  margin-bottom: 0.85rem;
}

form.form-inline .form-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: auto;
  margin: 0;
}

form.form-inline .form-control,
form.form-inline .clinic-date {
  width: 10.5rem;
  min-width: 10.5rem;
  flex: 0 0 auto;
}

form.form-inline #ClientName,
form.form-inline #SupplierName {
  width: 13rem;
  min-width: 13rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

.pos-shift-history {
  margin-top: 2.25rem;
}

.pos-shift-history > .page-head {
  align-items: flex-end;
}

.pos-shift-history > .page-head h2 {
  margin: 0;
}

.pos-shift-history > h3 {
  margin: 1.75rem 0 0.75rem;
}

.pos-shift-history > .page-head + h3 {
  margin-top: 0;
}

.pos-shift-filters {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.75rem 1rem;
  margin: 0 0 0 auto;
}

.pos-shift-field {
  display: grid;
  gap: 0.3rem;
  margin: 0;
}

.pos-shift-field .form-label {
  margin: 0;
  width: auto;
  color: var(--muted-ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.pos-shift-filters .form-control {
  width: 11.5rem;
  min-height: 2.45rem;
  background: var(--btn-secondary-bg) !important;
  color: var(--ink-color) !important;
  border: 1px solid var(--btn-secondary-border) !important;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  box-shadow: none;
}

.pos-shift-filters .form-control:focus {
  border-color: var(--focus-border) !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
}

.pos-shift-filters .btn {
  min-height: 2.45rem;
  margin: 0;
}

.pos-shift-history .dataTables_wrapper {
  margin-bottom: 0.35rem;
}

.return-type-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.return-type-filters .btn {
  margin: 0;
}

.page-actions-print {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.page-table td.row-actions {
  display: table-cell;
  vertical-align: middle;
  text-align: right;
  white-space: nowrap;
  min-width: 11rem;
}

.page-actions .btn:not(.clinic-icon-btn) {
  margin: 0 !important;
  min-height: 2.45rem;
}

.page-actions .dt-buttons,
.page-back .dt-buttons,
.text-end > .dt-buttons {
  display: inline-flex;
  align-items: center;
  float: none !important;
  width: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  pointer-events: auto;
}

.text-end > .dt-buttons {
  margin-right: 0.5rem !important;
  vertical-align: middle;
}

.page-actions .dt-buttons :is(.dt-button, .btn),
.page-back .dt-buttons :is(.dt-button, .btn),
.text-end > .dt-buttons :is(.dt-button, .btn) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  border: 1px solid var(--btn-secondary-border) !important;
  border-radius: 999px !important;
  background: var(--btn-secondary-bg) !important;
  color: var(--btn-secondary-color) !important;
  box-shadow: none !important;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  min-height: 2.45rem;
  padding: 0.5rem 1.15rem !important;
  pointer-events: auto;
}

.page-actions .dt-buttons :is(.dt-button, .btn):hover,
.page-actions .dt-buttons :is(.dt-button, .btn):focus,
.page-actions .dt-buttons :is(.dt-button, .btn):active,
.page-back .dt-buttons :is(.dt-button, .btn):hover,
.page-back .dt-buttons :is(.dt-button, .btn):focus,
.page-back .dt-buttons :is(.dt-button, .btn):active,
.text-end > .dt-buttons :is(.dt-button, .btn):hover,
.text-end > .dt-buttons :is(.dt-button, .btn):focus,
.text-end > .dt-buttons :is(.dt-button, .btn):active {
  background: var(--btn-secondary-hover-bg) !important;
  border-color: var(--btn-secondary-border) !important;
  color: var(--btn-secondary-hover-color) !important;
  box-shadow: none !important;
}

.entries-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.entries-menu-btn {
  appearance: none;
  border-radius: 999px;
  border: 1px solid var(--btn-secondary-border);
  background-color: var(--btn-secondary-bg);
  color: var(--ink-color);
  padding: 0.4rem 1.75rem 0.4rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.5;
  cursor: text;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%238a6a52' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 0.75rem;
}

.entries-menu.is-compact,
.dataTables_wrapper .dataTables_length .entries-menu,
.items-card-toolbar .entries-menu {
  display: inline-flex;
  width: auto;
  flex: 0 0 auto;
  vertical-align: middle;
}

.entries-menu.is-compact .entries-menu-btn,
.dataTables_wrapper .dataTables_length .entries-menu-btn,
.items-card-toolbar .dataTables_length .entries-menu-btn {
  width: auto;
  min-width: 3.15rem;
  padding: 0.4rem 1.6rem 0.4rem 0.75rem;
  text-align: center;
  cursor: pointer;
}

[data-bs-theme="dark"] .entries-menu-btn {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23f0c4a0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}

.entries-menu-btn:focus,
.entries-menu.is-open .entries-menu-btn {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.entries-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.entries-menu-list {
  position: fixed;
  z-index: 1080;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  max-height: 22rem;
  max-width: calc(100vw - 16px);
  overflow: auto;
  background: var(--card-bg);
  color: var(--ink-color);
  border: 1px solid var(--table-border);
  border-radius: 0.75rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.entries-menu-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border-radius: 0.65rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.3;
}

.entries-menu-list li.is-picked {
  font-weight: 650;
}

.entries-menu-list li.is-picked::after {
  content: "✓";
  flex-shrink: 0;
  color: var(--accent-color);
  font-weight: 700;
}

.entries-menu-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.entries-menu:not(.is-compact) > .entries-menu-btn.has-flag {
  padding-left: 2.55rem;
}

.entries-menu > .entries-menu-flag {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.entries-menu-list li:hover,
.entries-menu-list li.is-active {
  background: color-mix(in srgb, var(--accent-color) 48%, var(--card-bg));
  color: #fff;
}

.entries-menu-list li.is-muted,
.entries-menu-list li.is-muted:hover,
.entries-menu-list li.is-muted.is-active {
  background: transparent;
  color: var(--muted-ink);
  cursor: default;
  pointer-events: none;
}

.drawer .entries-menu {
  display: flex;
  width: 100%;
}

.drawer input.entries-menu-btn,
.drawer button.entries-menu-btn {
  display: block;
}

.drawer button.entries-menu-btn {
  cursor: pointer;
}

.drawer .entries-menu-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.45rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-color: var(--bs-body-bg);
  color: var(--ink-color);
  border: 1px solid var(--bs-border-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%233d2e22' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.75rem;
  padding: 0.45rem 2.1rem 0.45rem 0.75rem;
}

.drawer .entries-menu-btn.has-flag {
  padding-left: 2.55rem;
}

.drawer .entries-menu > .entries-menu-flag {
  left: 0.75rem;
}

[data-bs-theme="dark"] .drawer .entries-menu-btn {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23f0c4a0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}

.drawer .entries-menu-btn.is-empty {
  color: var(--muted-ink);
}

.drawer.is-view .entries-menu-btn,
.drawer .entries-menu-btn:disabled {
  background-image: none;
  padding-right: 0.75rem;
  pointer-events: none;
  opacity: 1;
  color: var(--ink-color);
}

.drawer .entries-menu-btn:focus,
.drawer .entries-menu.is-open .entries-menu-btn {
  border-color: var(--focus-border) !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
  outline: none;
}

.page .dataTables_wrapper {
  margin-top: 0;
}

.page-filters {
  accent-color: color-mix(in srgb, var(--accent-color) 42%, #8a6238);
  display: grid;
  grid-template-columns: repeat(2, minmax(8.5rem, 1fr)) repeat(2, minmax(8rem, 1fr)) minmax(12rem, 1.4fr) auto;
  gap: 0.75rem 0.85rem;
  align-items: end;
  margin: 0 0 1rem;
  padding: 1rem 1.15rem 1.1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.page-filters.is-filtering,
.page-stats.is-filtering,
.page-table.is-filtering,
table.tabela.is-filtering {
  opacity: 0.62;
  transition: opacity 0.15s ease;
}

.page-filters .form-label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted-ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.page-filters .form-control,
.page-filters .form-select,
.page-filters .entries-menu-btn {
  width: 100%;
  min-height: 2.45rem;
  background: var(--btn-secondary-bg) !important;
  color: var(--ink-color) !important;
  border: 1px solid var(--btn-secondary-border) !important;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  box-shadow: none;
}

.page-filters .entries-menu {
  display: flex;
  width: 100%;
  min-width: 0;
}

.page-filters .entries-menu-btn {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-filters .form-control::placeholder {
  color: var(--muted-ink);
}

.page-filters .form-control:focus,
.page-filters .form-select:focus,
.page-filters select:focus,
.page-filters .entries-menu-btn:focus,
.page-filters .entries-menu.is-open .entries-menu-btn {
  border-color: var(--focus-border) !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
  outline: none;
}

.page-filters select option:checked,
.page-filters select option:hover {
  background-color: color-mix(in srgb, var(--accent-color) 48%, var(--card-bg));
  color: #fff;
}

.page-filters input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: light;
}

[data-bs-theme="dark"] .page-filters input[type="date"] {
  color-scheme: dark;
}

.page-filters input[type="date"]::-webkit-datetime-edit,
.page-filters input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.page-filters input[type="date"]::-webkit-datetime-edit-text,
.page-filters input[type="date"]::-webkit-datetime-edit-month-field,
.page-filters input[type="date"]::-webkit-datetime-edit-day-field,
.page-filters input[type="date"]::-webkit-datetime-edit-year-field {
  background: transparent;
  color: inherit;
}

.page-filters input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}

[data-bs-theme="dark"] .page-filters input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.page-filters-action {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

.page-filters-action > .dropdown {
  flex: 0 0 auto;
}

.page-filters-action .btn {
  min-height: 2.45rem;
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

.page-filters.is-range {
  grid-template-columns: minmax(10rem, 14rem) minmax(10rem, 14rem) auto auto;
  justify-content: start;
}

.page-filters.is-asof {
  grid-template-columns: minmax(10rem, 14rem) auto auto;
  justify-content: start;
}

.page-filters.is-report {
  grid-template-columns: minmax(10rem, 13rem) minmax(10rem, 13rem) minmax(12rem, 1fr) minmax(12rem, 1fr) auto;
}

.page-filters.is-items {
  grid-template-columns: minmax(10rem, 13rem) minmax(10rem, 13rem) minmax(14rem, 1.5fr) auto;
}

.page-filters.is-finance {
  grid-template-columns: minmax(10rem, 14rem) minmax(10rem, 14rem) minmax(14rem, 1.4fr) auto;
  justify-content: start;
}

.page-filters.is-bank {
  grid-template-columns: minmax(14rem, 1.5fr) minmax(10rem, 14rem) minmax(10rem, 14rem) auto;
  justify-content: start;
}

.page-filters.is-ops {
  grid-template-columns: minmax(10rem, 13rem) minmax(10rem, 13rem) minmax(11rem, 14rem) minmax(14rem, 1.4fr) minmax(12rem, 1fr) auto;
  justify-content: start;
}

.page-filters.is-cash {
  grid-template-columns: minmax(10rem, 14rem) minmax(14rem, 1.5fr) auto;
  justify-content: start;
}

.page-filters.is-ledger {
  grid-template-columns: minmax(14rem, 1.4fr) minmax(10rem, 13rem) minmax(10rem, 13rem) minmax(11rem, 13rem) minmax(12rem, 1fr) auto;
  justify-content: start;
}

#patients-page .page-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 0.65rem 0.6rem;
  overflow-x: auto;
}

#patients-page .page-filters > .patient-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1 1 7.5rem;
  min-width: 7rem;
}

#patients-page .page-filters > .patient-field.is-date {
  flex: 1 1 13.5rem;
  min-width: 13rem;
  max-width: 16rem;
}

#patients-page .page-filters > .patient-field.is-chips {
  flex: 0 0 auto;
  min-width: 0;
}

#patients-page .patient-chips {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.35rem;
}

#patients-page .patient-chip {
  flex: 0 0 auto;
  min-height: 2.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: var(--ink-color);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}

#patients-page .patient-chip:hover,
#patients-page .patient-chip:focus-visible {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

#patients-page .patient-chip[aria-pressed="true"] {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

#patients-page .patient-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

#patients-page .page-filters-action {
  flex: 0 0 auto;
  margin-left: auto;
}

#birth-modal.modal {
  padding: 1.25rem;
}

#birth-modal.modal[style*="display: block"],
#birth-modal.modal[style*="display:block"] {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

#birth-modal .modal-content {
  margin: 0;
  width: min(36rem, 100%);
  max-width: 36rem;
}

#birth-modal .page-title {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

#birth-modal .birth-months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 1rem 0 1.15rem;
}

#birth-modal .birth-month {
  min-height: 2.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.55rem;
  border: 1px solid var(--accent-color);
  background: transparent;
  color: var(--accent-color);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
}

#birth-modal .birth-month:hover,
#birth-modal .birth-month:focus-visible {
  background: color-mix(in srgb, var(--accent-color) 14%, transparent);
  outline: none;
}

#birth-modal .birth-month[aria-pressed="true"],
#birth-modal .birth-month[aria-pressed="true"]:hover {
  background: var(--accent-color);
  color: #fff;
}

#birth-modal .page-actions {
  justify-content: flex-end;
  margin-left: 0;
}

#export-drawer .export-hint,
#birth-modal .export-hint {
  margin: 0 0 0.55rem;
  color: var(--muted-ink);
  font-size: 0.82rem;
}

#export-drawer .export-tall {
  min-height: 6.5rem;
  resize: vertical;
}

#export-drawer .age-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

#export-drawer .age-field-head .form-label {
  margin-bottom: 0.35rem;
}

#export-drawer .age-range-readout {
  color: var(--ink-color);
  font-size: 0.82rem;
  font-weight: 700;
}

#export-drawer .age-range {
  --age-a: 0%;
  --age-b: 100%;
  --age-from: 0;
  --age-to: 100;
  --age-nudge: 0;
  position: relative;
  height: 3.9rem;
  margin-top: 0.15rem;
  touch-action: none;
  cursor: pointer;
  user-select: none;
}

#export-drawer .age-range-val {
  position: absolute;
  z-index: 3;
  top: calc(1.15rem + (2.75rem - 1.25rem) / 2 - 0.55rem);
  left: calc(0.65rem + (100% - 1.3rem) * var(--age-from) / 100);
  transform: translate(-50%, -100%);
  min-width: 1.1rem;
  color: var(--ink-color);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  white-space: nowrap;
}

#export-drawer .age-range-val.is-from {
  left: clamp(0.7rem, calc(0.65rem + (100% - 1.3rem) * (var(--age-from) - var(--age-nudge)) / 100), calc(100% - 0.7rem));
}

#export-drawer .age-range-val.is-to {
  left: clamp(0.7rem, calc(0.65rem + (100% - 1.3rem) * (var(--age-to) + var(--age-nudge)) / 100), calc(100% - 0.7rem));
}

#export-drawer .age-range-track {
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  top: calc(1.15rem + 1.375rem);
  height: 0.28rem;
  margin-top: -0.14rem;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--btn-secondary-border) var(--age-a),
    var(--accent-color) var(--age-a),
    var(--accent-color) var(--age-b),
    var(--btn-secondary-border) var(--age-b)
  );
}

#export-drawer .age-range-track::before {
  content: "";
  position: absolute;
  left: -0.65rem;
  right: -0.65rem;
  top: -1.15rem;
  bottom: -1.15rem;
}

#export-drawer .age-range input[type="range"] {
  position: absolute;
  left: 0;
  top: 1.15rem;
  width: 100%;
  height: 2.75rem;
  margin: 0;
  background: transparent;
  pointer-events: none;
  appearance: none;
}

#export-drawer .age-range input[type="range"]::-webkit-slider-runnable-track {
  height: 0.28rem;
  background: transparent;
}

#export-drawer .age-range input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: -0.48rem;
  border: 0;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 22%, transparent);
  cursor: pointer;
}

#export-drawer .age-range input[type="range"]::-moz-range-track {
  height: 0.28rem;
  background: transparent;
  border: 0;
}

#export-drawer .age-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 1.25rem;
  height: 1.25rem;
  border: 0;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
}

#export-drawer .age-range input[type="range"]:hover,
#export-drawer .age-range input[type="range"]:focus-visible {
  z-index: 2;
}

#export-drawer .export-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

#export-drawer .doctor-filter-chip:has(.ex-doc-filter:checked),
#export-drawer .doctor-filter-chip.is-all:has(#ex-doc-all:checked) {
  border-color: var(--accent-color);
  background: var(--accent-soft);
}

#export-drawer .ex-doc-filter,
#export-drawer #ex-doc-all {
  accent-color: var(--accent-color);
  margin: 0;
  flex: 0 0 auto;
}

.page-filters .is-suggest {
  position: relative;
}

.page-filters .export-dropdown {
  justify-self: start;
}

.page-filters .export-dropdown .btn {
  min-height: 2.45rem;
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

.export-menu {
  min-width: 10.5rem;
  padding: 0.35rem;
  margin-top: 0.4rem !important;
  border-radius: 0.75rem;
  border: 1px solid var(--table-border) !important;
  background: var(--card-bg) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28) !important;
}

.export-menu .dropdown-item {
  border-radius: 0.45rem;
  padding: 0.45rem 0.85rem;
  color: var(--ink-color) !important;
  font-weight: 600;
  font-size: 0.9rem;
}

.export-menu .dropdown-item:hover,
.export-menu .dropdown-item:focus {
  background: color-mix(in srgb, var(--accent-color) 48%, var(--card-bg)) !important;
  color: #fff !important;
}

.statement-page table.tabela td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.statement-page table.tabela tbody tr.is-opening td {
  font-weight: 700;
}

.statement-page table.tabela tfoot td {
  font-weight: 700;
  background: var(--table-header-bg);
  border-top: 1px solid var(--table-border);
}

.statement-page table.tabela tfoot td.num {
  text-align: right;
}

.statement-page table.tabela tbody tr:last-child td:first-child,
.statement-page table.tabela tbody tr:last-child td:last-child {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.statement-page table.tabela tfoot tr:last-child td:first-child {
  border-bottom-left-radius: calc(var(--card-radius) - 1px);
}

.statement-page table.tabela tfoot tr:last-child td:last-child {
  border-bottom-right-radius: calc(var(--card-radius) - 1px);
}

.page-stats {
  --stat-cols: 4;
  container-name: page-stats;
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(var(--stat-cols), minmax(0, 1fr));
  gap: clamp(0.4rem, 1cqi, 0.85rem);
  margin: 0 0 1.15rem;
}

.page-stats.is-3 {
  --stat-cols: 3;
}

.page-stats.is-5 {
  --stat-cols: 5;
}

.page-stats.is-6 {
  --stat-cols: 6;
}

.page-stats > .stat-card {
  min-width: 0;
  font-size: clamp(0.9rem, calc(6.2cqi / var(--stat-cols)), 1.05rem);
}

.stat-card.is-static {
  cursor: default;
}

.stat-card.is-static:hover,
.stat-card.is-static:active {
  transform: none;
}

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

  .page-filters.is-range,
  .page-filters.is-asof,
  .page-filters.is-report,
  .page-filters.is-items,
  .page-filters.is-finance,
  .page-filters.is-bank,
  .page-filters.is-ops,
  .page-filters.is-cash,
  .page-filters.is-ledger {
    grid-template-columns: 1fr 1fr;
  }

  .page-filters .is-search,
  .page-filters-action,
  .page-filters .export-dropdown {
    grid-column: 1 / -1;
  }
}

@media (max-width: 759.98px) {
  .page-stats.is-5,
  .page-stats.is-6 {
    --stat-cols: 3;
  }
}

@media (max-width: 575.98px) {
  .page-filters,
  .page-filters.is-range,
  .page-filters.is-asof,
  .page-filters.is-report,
  .page-filters.is-items,
  .page-filters.is-finance,
  .page-filters.is-bank,
  .page-filters.is-ops,
  .page-filters.is-cash,
  .page-filters.is-ledger {
    grid-template-columns: 1fr;
  }

  .page-stats,
  .page-stats.is-3 {
    --stat-cols: 1;
  }

  .page-stats.is-5,
  .page-stats.is-6 {
    --stat-cols: 2;
  }
}

.pay-search-dropdown {
  position: absolute;
  z-index: 1050;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.pay-search-dropdown li {
  padding: 0.5rem 0.75rem;
  border-radius: 0.45rem;
  cursor: pointer;
  color: var(--ink-color);
  font-weight: 600;
  font-size: 0.9rem;
}

.pay-search-dropdown li.active,
.pay-search-dropdown li:hover {
  background: color-mix(in srgb, var(--accent-color) 48%, var(--card-bg));
  color: #fff;
}

.item-picker-wrap {
  position: relative;
}

.page-filters .item-filter-toggle {
  width: 100%;
  min-height: 2.45rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  background: var(--btn-secondary-bg);
  color: var(--ink-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}

.page-filters .item-filter-toggle:focus {
  outline: none;
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.item-filter-summary {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-filter-caret {
  color: var(--muted-ink);
  font-size: 12px;
  flex: 0 0 auto;
}

.item-filter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1050;
  display: none;
  padding: 0.65rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.item-filter-dropdown.is-open {
  display: block;
}

.item-filter-search {
  margin-bottom: 8px;
}

.item-filter-list {
  max-height: 230px;
  overflow-y: auto;
  border: 1px solid var(--table-border);
  border-radius: 0.55rem;
  background: var(--card-bg);
  padding: 4px 0;
}

.item-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  margin: 0;
  width: 100%;
  color: var(--ink-color);
}

.item-filter-option:hover {
  background: color-mix(in srgb, var(--accent-color) 16%, var(--card-bg));
}

.item-filter-empty {
  padding: 12px;
  color: var(--muted-ink);
  font-size: 0.95rem;
}

.hidden-item-inputs {
  display: none;
}

.report-banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--card-radius);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  color: var(--ink-color);
  font-weight: 600;
}

.report-banner.is-ok {
  border-color: rgba(20, 108, 67, 0.28);
  background: rgba(25, 135, 84, 0.08);
  color: #146c43;
}

.report-banner.is-bad {
  border-color: rgba(176, 42, 55, 0.28);
  background: rgba(220, 53, 69, 0.08);
  color: #b02a37;
}

[data-bs-theme="dark"] .report-banner.is-ok {
  color: #4ade80;
}

[data-bs-theme="dark"] .report-banner.is-bad {
  color: #f87171;
}

.report-block {
  margin: 0 0 1.15rem;
}

.report-block > h3 {
  margin: 0 0 0.65rem;
  color: var(--ink-color);
  font-size: 1.05rem;
  font-weight: 700;
}

.report-block table.tabela {
  margin-top: 0;
}

/* Long translations stay inside the card. Headers and badges wrap, and
   anything that still does not fit scrolls inside the table instead of
   painting past its edge. */
#CashBanksTable_wrapper {
  max-width: 100%;
  overflow-x: auto;
}

#CashBanksTable thead th {
  white-space: normal;
  line-height: 1.25;
  vertical-align: bottom;
}

#CashBanksTable td {
  white-space: normal;
}

#CashBanksTable .status-pill {
  white-space: normal;
  max-width: 12rem;
  text-align: center;
  justify-content: center;
}

.page-split {
  display: grid;
  grid-template-columns: minmax(260px, 24rem) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
  margin: 0 0 1.15rem;
}

.page-split.is-2 {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 991.98px) {
  .page-split,
  .page-split.is-2 {
    grid-template-columns: 1fr;
  }
}

.page-form {
  margin: 0 0 1.15rem;
  padding: 1.15rem 1.25rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.page-form > h3 {
  margin: 0 0 1rem;
  color: var(--ink-color);
  font-size: 1.05rem;
  font-weight: 700;
}

.page-form .form-label {
  margin-bottom: 0.3rem;
  color: var(--muted-ink);
  font-weight: 600;
  font-size: 0.8rem;
}

.page-form .form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.page-form > h2 {
  margin: 0 0 1rem;
  color: var(--ink-color);
  font-size: 1.05rem;
  font-weight: 700;
}

.page-form .prod-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem 1rem;
  align-items: start;
}

.page-form .prod-form.is-recipe {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 16.5rem;
}

.page-form .prod-form.is-run {
  grid-template-columns: minmax(0, 1.35fr) 12.5rem minmax(0, 1fr);
}

.page-form .prod-form > div:not(.is-wide) .form-label {
  white-space: nowrap;
}

.page-form .prod-form .is-wide,
.page-form .prod-form .form-actions {
  grid-column: 1 / -1;
}

.page-form .form-label {
  display: block;
}

.page-form .entries-menu,
.page-form .recipe-line .entries-menu {
  display: flex;
  width: 100%;
  min-width: 0;
}

.page-form .entries-menu-btn {
  width: 100%;
  min-width: 0;
  min-height: 2.55rem;
  text-align: left;
}

.page-form .form-control,
.page-form .flatpickr-alt-input.form-control,
.page-form input.clinic-date.form-control {
  background: var(--bs-body-bg) !important;
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  -webkit-text-fill-color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color) !important;
  box-shadow: none;
}

.page-form .form-control:focus,
.page-form .flatpickr-alt-input.form-control:focus,
.page-form input.clinic-date.form-control:focus {
  background: var(--bs-body-bg) !important;
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  border-color: var(--focus-border) !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
}

.page-form #production-preview[hidden] {
  display: none;
}

.page-form .recipe-lines {
  display: grid;
  gap: 0.55rem;
}

.page-form .recipe-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10.5rem auto;
  gap: 0.55rem;
  align-items: center;
}

.page-form .recipe-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.page-form .recipe-tools .form-label {
  margin: 0;
}

.page-form #recipe-add-line {
  margin: 0;
}

.page-block {
  margin: 1.5rem 0 0.75rem;
  color: var(--ink-color);
  font-size: 1.15rem;
  font-weight: 700;
}

table.tabela td.row-actions .clinic-row-actions > form {
  display: inline-flex;
  margin: 0;
}

table.tabela td.row-actions .clinic-row-actions > a,
table.table td.row-actions .clinic-row-actions > a,
table.tabela td.row-actions .clinic-row-actions > button,
table.table td.row-actions .clinic-row-actions > button,
table.tabela td.row-actions .clinic-row-actions form > button,
table.table td.row-actions .clinic-row-actions form > button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  margin: 0;
  padding: 0 0.95rem;
  border: 1px solid var(--accent-color);
  border-radius: 0.55rem;
  background: transparent;
  color: var(--accent-color) !important;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
}

table.tabela td.row-actions .clinic-row-actions > a:hover,
table.tabela td.row-actions .clinic-row-actions > a:focus,
table.tabela td.row-actions .clinic-row-actions > button:hover,
table.tabela td.row-actions .clinic-row-actions > button:focus,
table.tabela td.row-actions .clinic-row-actions form > button:hover,
table.tabela td.row-actions .clinic-row-actions form > button:focus {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff !important;
}

table.tabela td.row-actions .clinic-row-actions form > button.is-danger {
  border-color: #ef4444;
  background: transparent;
  color: #ef4444 !important;
}

table.tabela td.row-actions .clinic-row-actions form > button.is-danger:hover,
table.tabela td.row-actions .clinic-row-actions form > button.is-danger:focus {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff !important;
}

@media (max-width: 900px) {
  .page-form .prod-form,
  .page-form .prod-form.is-recipe,
  .page-form .prod-form.is-run {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-form .recipe-line {
    grid-template-columns: 1fr;
  }
}




.profile-page {
  --profile-accent: #fd7e14;
  padding-top: 0.75rem;
  padding-bottom: 1.25rem;
}

.profile-dash {
  display: grid;
  grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.profile-left {
  display: grid;
  gap: 0.7rem;
}

.profile-card {
  overflow: hidden;
  margin: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1.6rem;
  box-shadow: var(--card-shadow);
}

.profile-card-media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #141418;
}

.profile-card-photo,
.profile-card-photo img,
.profile-card-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.profile-card-photo img {
  display: block;
  object-fit: cover;
  object-position: center center;
}

.profile-card-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background:
    radial-gradient(circle at 30% 20%, rgba(253, 126, 20, 0.32), transparent 45%),
    linear-gradient(160deg, #2a2118 0%, #16161a 55%, #101014 100%);
}

[data-bs-theme="light"] .profile-card-media:has(.profile-card-photo.is-empty) {
  background: #f7efe8;
}

[data-bs-theme="light"] .profile-card-photo.is-empty .profile-card-fallback {
  color: color-mix(in srgb, #6a4a32 70%, #fd7e14);
  background:
    radial-gradient(circle at 32% 16%, rgba(253, 126, 20, 0.28), transparent 44%),
    linear-gradient(165deg, #fff8f3 0%, #f6e6d8 50%, #efe0d2 100%);
}

[data-bs-theme="light"] .profile-card:has(.profile-card-photo.is-empty) .profile-card-glass {
  background: linear-gradient(180deg, rgba(255, 248, 242, 0) 0%, rgba(255, 247, 241, 0.45) 34%, #fff7f1 72%);
  color: var(--ink-color);
}

[data-bs-theme="light"] .profile-card:has(.profile-card-photo.is-empty) .profile-card-name {
  color: var(--ink-color);
}

[data-bs-theme="light"] .profile-card:has(.profile-card-photo.is-empty) .profile-card-tagline,
[data-bs-theme="light"] .profile-card:has(.profile-card-photo.is-empty) .profile-card-meta {
  color: color-mix(in srgb, var(--ink-color) 72%, transparent);
}

.profile-photo-hover {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  background: rgba(8, 8, 10, 0.5);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.profile-photo-hover .bi {
  font-size: 1.4rem;
  color: #fd7e14;
}

.profile-card.is-editing .profile-photo-hover {
  display: flex;
}

.profile-card.is-editing .profile-card-media:hover .profile-photo-hover,
.profile-card.is-editing .profile-card-media:focus-within .profile-photo-hover {
  opacity: 1;
}

.profile-card.is-uploading .profile-card-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 10, 0.28);
  pointer-events: none;
}

.profile-photo-clear {
  position: absolute;
  top: 0.65rem;
  right: 0.7rem;
  z-index: 4;
  display: none;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 0.2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
  transition: color 0.15s ease;
}

.profile-card.is-editing .profile-photo-clear:not([hidden]) {
  display: inline-flex;
}

.profile-photo-clear:hover,
.profile-photo-clear:focus-visible {
  background: transparent;
  color: #ff6b6b;
  outline: none;
  transform: none;
}

.profile-card-glass {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 4.5rem 1rem 1rem;
  background: linear-gradient(180deg, transparent 0%, rgba(12, 12, 15, 0.55) 38%, rgba(12, 12, 15, 0.92) 100%);
  color: #fff;
  pointer-events: none;
}

.profile-card-glass-copy,
.profile-card-actions {
  pointer-events: auto;
}

.profile-card-glass-copy {
  min-width: 0;
}

.profile-card-name-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.profile-card-name {
  margin: 0;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.profile-card-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.profile-card-tagline {
  margin: 0 0 0.65rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
}

.profile-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
  font-weight: 600;
}

.profile-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.profile-card-meta .bi {
  color: #fd7e14;
}

.profile-card-color {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.doctor-color {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.terminal-roles-card{
  display:flex;
  flex-direction:column;
  height:22.5rem;
  border:1px solid var(--table-border, rgba(255,255,255,.12));
  border-radius:12px;
  background:color-mix(in srgb, var(--card-bg, #1a1a1a) 88%, transparent);
  overflow:hidden;
}
.terminal-roles-search{
  display:flex;
  align-items:center;
  gap:0.55rem;
  flex:0 0 auto;
  margin:0.45rem 0.45rem 0;
  padding:0.55rem 0.75rem;
  border:1px solid var(--table-border, rgba(255,255,255,.12));
  border-radius:10px;
  background:color-mix(in srgb, var(--card-bg, #111) 70%, transparent);
}
.terminal-roles-search > i{
  color:var(--muted-ink, #9aa0a6);
  font-size:0.95rem;
}
.terminal-roles-filter,
.terminal-roles-filter:focus,
.terminal-roles-filter:focus-visible{
  flex:1 1 auto;
  min-width:0;
  width:100%;
  height:auto;
  margin:0;
  border:0 !important;
  outline:none !important;
  box-shadow:none !important;
  background:transparent !important;
  background-color:transparent !important;
  background-image:none !important;
  color:var(--ink-color, inherit) !important;
  font-size:0.92rem;
  font-weight:500;
  line-height:1.3;
  padding:0 !important;
  border-radius:0 !important;
  appearance:none;
  -webkit-appearance:none;
}
.terminal-roles-filter::placeholder{
  color:var(--muted-ink, #9aa0a6);
  opacity:0.85;
}
.terminal-roles-search:focus-within{
  border-color:var(--accent-color, #fd7e14);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--accent-color, #fd7e14) 22%, transparent);
}
.terminal-roles-list{
  display:grid;
  gap:0.35rem;
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:0.45rem;
  align-content:start;
}
.terminal-roles-empty{
  margin:0.75rem 0.35rem;
  text-align:center;
  color:var(--muted-ink, #9aa0a6);
  font-size:0.88rem;
}
.terminal-role-check{
  display:flex;
  align-items:center;
  gap:0.7rem;
  margin:0;
  padding:0.55rem 0.7rem;
  border-radius:10px;
  border:1px solid transparent;
  cursor:pointer;
  user-select:none;
  transition:background .15s ease, border-color .15s ease;
}
.terminal-role-check.is-filtered-out{display:none;}
.terminal-role-check:hover{
  background:color-mix(in srgb, var(--accent-color, #fd7e14) 10%, transparent);
  border-color:color-mix(in srgb, var(--accent-color, #fd7e14) 28%, transparent);
}
.terminal-role-check:has(.terminal-role-input:checked){
  background:color-mix(in srgb, var(--accent-color, #fd7e14) 16%, transparent);
  border-color:color-mix(in srgb, var(--accent-color, #fd7e14) 45%, transparent);
}
.terminal-role-input{
  position:absolute;
  opacity:0;
  width:1px;
  height:1px;
  pointer-events:none;
}
.terminal-role-box{
  flex:0 0 auto;
  width:1.15rem;
  height:1.15rem;
  border-radius:0.35rem;
  border:1.5px solid color-mix(in srgb, var(--ink-color, #fff) 35%, transparent);
  background:transparent;
  display:inline-grid;
  place-items:center;
  transition:background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.terminal-role-box::after{
  content:"";
  width:0.38rem;
  height:0.65rem;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg) scale(0);
  opacity:0;
  margin-top:-0.1rem;
  transition:transform .12s ease, opacity .12s ease;
}
.terminal-role-input:checked + .terminal-role-box{
  background:var(--accent-color, #fd7e14);
  border-color:var(--accent-color, #fd7e14);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--accent-color, #fd7e14) 22%, transparent);
}
.terminal-role-input:checked + .terminal-role-box::after{
  transform:rotate(45deg) scale(1);
  opacity:1;
}
.terminal-role-input:focus-visible + .terminal-role-box{
  box-shadow:0 0 0 3px var(--focus-ring, color-mix(in srgb, var(--accent-color, #fd7e14) 35%, transparent));
}
.terminal-role-label{
  font-size:0.92rem;
  font-weight:600;
  color:var(--ink-color, inherit);
}

#user-terminals-card.terminal-roles-card{
  height:auto;
  max-height:14rem;
}
#user-terminals-card .terminal-roles-list{
  flex:0 1 auto;
  max-height:9.5rem;
}

.doctor-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.doctor-color-swatch {
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 2px solid var(--card-border);
  border-radius: 50%;
  cursor: pointer;
}

.doctor-color-swatch.is-on {
  border-color: var(--ink-color);
  box-shadow: 0 0 0 2px var(--accent-color);
}

.doctor-color-swatch:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.doctor-color-picker {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.profile-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.profile-card.is-editing .profile-card-actions {
  display: none;
}

.profile-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.4rem;
  min-height: 2rem;
  padding: 0.35rem 0.95rem;
  border: 1px solid #fd7e14;
  border-radius: 999px;
  background: transparent;
  color: #fd7e14;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.profile-edit-btn:hover,
.profile-edit-btn:focus-visible {
  background: rgba(253, 126, 20, 0.16);
  outline: none;
}

.profile-card-edit {
  padding: 0.95rem 1rem 1.05rem;
  border-top: 1px solid var(--card-border);
  background: var(--card-bg);
}

.profile-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 0.75rem;
}

.profile-fields .is-wide {
  grid-column: 1 / -1;
}

.form-actions.is-end,
.profile-card-edit .form-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.profile-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(211, 18, 18, 0.35);
  border-radius: 999px;
  background: transparent;
  color: #ff7b7b;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.profile-logout:hover,
.profile-logout:focus-visible {
  background: rgba(211, 18, 18, 0.12);
  border-color: #d31212;
  color: #ff9a9a;
  outline: none;
}

.profile-detail {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.45rem 0.75rem;
  margin: 0;
}

.profile-detail dt {
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.profile-detail dd {
  margin: 0;
  color: var(--ink-color);
  font-size: 0.88rem;
  font-weight: 700;
}

#mirror-page[data-doctor-ui="1"] .doctor-sheet {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
}

#mirror-page[data-doctor-ui="1"] .doctor-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

#mirror-page[data-doctor-ui="1"] .doctor-row.is-full {
  grid-template-columns: 1fr;
}

#mirror-page[data-doctor-ui="1"] .doctor-row + .doctor-row {
  border-top: 1px solid var(--card-border);
}

#mirror-page[data-doctor-ui="1"] .doctor-row.is-id {
  background: color-mix(in srgb, var(--ink-color) 4%, transparent);
}

#mirror-page[data-doctor-ui="1"] .doctor-row > div {
  min-width: 0;
  padding: 0.72rem 0.95rem 0.78rem;
}

#mirror-page[data-doctor-ui="1"] .doctor-row > div + div {
  border-left: 1px solid var(--card-border);
}

#mirror-page[data-doctor-ui="1"] .doctor-row span {
  display: block;
  margin-bottom: 0.22rem;
  color: var(--muted-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#mirror-page[data-doctor-ui="1"] .doctor-row strong {
  display: block;
  color: var(--ink-color);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.profile-actions {
  display: grid;
  gap: 0.45rem;
}

.profile-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid color-mix(in srgb, var(--profile-accent) 45%, var(--card-border));
  border-radius: 999px;
  background: transparent;
  color: var(--ink-color);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.profile-action:hover,
.profile-action:focus-visible {
  background: rgba(253, 126, 20, 0.12);
  border-color: var(--profile-accent);
  color: var(--ink-color);
  outline: none;
}

.profile-action .bi {
  color: var(--profile-accent);
}

.profile-side {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.profile-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: stretch;
}

/* Shared stat-card design inside profile KPI grids (patient + auth profile). */
.profile-kpis > .stat-card {
  min-width: 0;
  margin: 0;
  min-height: 5.75rem;
  padding: 0.75rem 0.8rem 0.7rem;
  font-size: clamp(0.7rem, 0.9vw, 0.84rem);
}

.profile-kpis > .stat-card .stat-value {
  font-size: 1.28em;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#mirror-page .profile-kpis > .stat-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 0.65rem;
  row-gap: 1.05rem;
  align-items: center;
  min-height: 7.6rem;
  padding: 1rem 1.05rem 0.95rem 1rem;
  border-color: var(--card-border);
  border-top-width: 1px;
  border-left: 3px solid var(--accent-color);
  box-shadow: none;
  font-size: 1rem;
}

#mirror-page .profile-kpis > .stat-card .icon-tile {
  grid-column: 1;
  grid-row: 1;
  width: 2.15rem;
  height: 2.15rem;
  font-size: 1.05rem;
}

#mirror-page .profile-kpis > .stat-card .icon-tile > i::after {
  content: none;
}

#mirror-page .profile-kpis > .stat-card .stat-label {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  white-space: normal;
  font-size: 0.98rem;
  line-height: 1.25;
}

#mirror-page .profile-kpis > .stat-card .stat-value {
  position: static;
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  font-size: 1.7rem;
  font-weight: 750;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

#mirror-page .fin-last-date {
  position: static;
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
}

#mirror-page .profile-kpis > .stat-card.is-static:hover,
#mirror-page .profile-kpis > .stat-card.is-static:active,
[data-bs-theme="dark"] #mirror-page .profile-kpis > .stat-card.is-static:hover,
[data-bs-theme="dark"] #mirror-page .profile-kpis > .stat-card.is-static:active {
  background: var(--card-bg) !important;
  border-color: var(--card-border) !important;
  border-left-color: var(--accent-color) !important;
  box-shadow: none !important;
  transform: none;
}

#mirror-page .profile-kpis > .stat-card.is-debt.is-static:hover,
#mirror-page .profile-kpis > .stat-card.is-debt.is-static:active {
  border-left-color: #ef6b63 !important;
}

#mirror-page .profile-kpis > .stat-card.is-static:hover .stat-label,
#mirror-page .profile-kpis > .stat-card.is-static:active .stat-label {
  color: color-mix(in srgb, var(--chart-title-color) 78%, transparent);
}

#mirror-page .profile-kpis > .stat-card.is-static:hover .stat-value,
#mirror-page .profile-kpis > .stat-card.is-static:active .stat-value {
  color: var(--ink-color);
}

#mirror-page .profile-kpis > .stat-card.is-static:hover .icon-tile,
#mirror-page .profile-kpis > .stat-card.is-static:active .icon-tile {
  background: var(--accent-soft);
  color: var(--accent-color);
}

#mirror-page .profile-kpis > .stat-card.is-debt {
  border-left-color: #ef6b63;
}

#mirror-page .profile-kpis > .stat-card.is-debt .stat-value {
  color: #d92d20;
}

[data-bs-theme="dark"] #mirror-page .profile-kpis > .stat-card.is-debt .stat-value,
[data-bs-theme="dark"] #mirror-page .profile-kpis > .stat-card.is-debt.is-static:hover .stat-value,
[data-bs-theme="dark"] #mirror-page .profile-kpis > .stat-card.is-debt.is-static:active .stat-value {
  color: #ff8b7a;
}

#mirror-page .profile-kpis > .stat-card.is-debt.is-static:hover .stat-value,
#mirror-page .profile-kpis > .stat-card.is-debt.is-static:active .stat-value {
  color: #d92d20;
}

#mirror-page .fin-last-date:empty {
  display: none;
}

#mirror-page .profile-left .profile-detail {
  grid-template-columns: 1fr;
  gap: 0;
}

#mirror-page .profile-left .profile-detail dt {
  margin-top: 0.7rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#mirror-page .profile-left .profile-detail dt:first-child {
  margin-top: 0;
}

#mirror-page .profile-left .profile-detail dd {
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--card-border);
  font-weight: 650;
}

#mirror-page .profile-left .profile-detail dd:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

#mirror-page .next-visits-table td.is-wrap {
  white-space: normal;
}

#mirror-page .profile-appt {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

#mirror-page .profile-appt.is-booked { color: #1d4ed8; background: color-mix(in srgb, #3b82f6 16%, var(--card-bg)); border-color: color-mix(in srgb, #3b82f6 40%, transparent); }
#mirror-page .profile-appt.is-waiting,
#mirror-page .profile-appt.is-reschedule { color: #c45c12; background: color-mix(in srgb, #fd7e14 18%, var(--card-bg)); border-color: color-mix(in srgb, #fd7e14 42%, transparent); }
#mirror-page .profile-appt.is-late { color: #a16207; background: color-mix(in srgb, #eab308 20%, var(--card-bg)); border-color: color-mix(in srgb, #eab308 45%, transparent); }
#mirror-page .profile-appt.is-in_exam { color: #0f766e; background: color-mix(in srgb, #14b8a6 18%, var(--card-bg)); border-color: color-mix(in srgb, #14b8a6 40%, transparent); }

[data-bs-theme="dark"] #mirror-page .profile-appt.is-booked { color: #93c5fd; }
[data-bs-theme="dark"] #mirror-page .profile-appt.is-waiting,
[data-bs-theme="dark"] #mirror-page .profile-appt.is-reschedule { color: #fdba74; }
[data-bs-theme="dark"] #mirror-page .profile-appt.is-late { color: #fde047; }
[data-bs-theme="dark"] #mirror-page .profile-appt.is-in_exam { color: #5eead4; }

.profile-kpis > .stat-card .stat-label {
  font-size: 0.9em;
}

.profile-kpi {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
  min-height: 4.35rem;
  height: 100%;
  padding: 0.65rem 0.8rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  box-sizing: border-box;
}

.profile-kpi-label {
  display: block;
  color: var(--muted-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-kpi-value {
  display: block;
  margin-top: 0;
  color: var(--ink-color);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-kpi-meta {
  display: block;
  color: var(--muted-ink);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Patient profile: touch-friendly controls (min ~44px). */
#mirror-page .profile-edit-btn,
.profile-page#mirror-page .profile-edit-btn {
  min-height: 2.75rem;
  min-width: 5.5rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
}

#mirror-page .profile-subtabs .btn,
#mirror-page .page-filters-action .btn,
.profile-page .profile-subtabs .btn,
.profile-page .page-filters-action .btn {
  min-height: 2.75rem;
  height: auto;
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
  line-height: 1.2;
  box-sizing: border-box;
}

#mirror-page .profile-mini-table .clinic-icon-btn,
.profile-page .profile-mini-table .clinic-icon-btn {
  width: 2.55rem;
  height: 2.55rem;
  min-width: 2.55rem;
  font-size: 1.15rem;
  border-radius: 0.55rem;
}

#mirror-page .profile-mini-table .clinic-icon-btn > i,
.profile-page .profile-mini-table .clinic-icon-btn > i {
  font-size: 1.15rem;
}

#mirror-page .profile-mini-table td.row-actions,
.profile-page .profile-mini-table td.row-actions {
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

#mirror-page .profile-mini-table td.row-actions .clinic-icon-btn + .clinic-icon-btn,
.profile-page .profile-mini-table td.row-actions .clinic-icon-btn + .clinic-icon-btn {
  margin-left: 0.4rem;
}

.profile-chart-switch {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--btn-secondary-bg);
}

.profile-chart-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-color);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.profile-chart-switch button:hover,
.profile-chart-switch button:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.profile-chart-switch button.is-on {
  background: var(--accent-color);
  color: #fff;
}

.profile-subtabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.75rem 0;
}

.profile-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

#mirror-page .profile-board {
  grid-template-columns: 1fr;
}

#mirror-page .profile-left .profile-panel {
  margin-top: 0.85rem;
}

#mirror-page .profile-chart-wrap {
  display: block;
  min-height: 0;
  height: 10.5rem;
}

.profile-board-panel,
.profile-panel {
  margin: 0;
  padding: 0.95rem 1rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.profile-board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.profile-board-head h2 {
  margin: 0;
  color: var(--ink-color);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile-board-head span,
.profile-board-head a {
  color: var(--muted-ink);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.profile-board-head a:hover {
  color: var(--profile-accent);
}

.profile-chart-host.chart-card {
  padding: 0;
  height: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.profile-chart-host.chart-card:hover {
  transform: none;
  background: transparent;
  box-shadow: none;
}

.profile-chart-host .chart-card canvas,
.profile-chart-host canvas {
  max-height: none;
}

.profile-chart-wrap {
  display: flex;
  flex-direction: column;
  min-height: 23.5rem;
}

.profile-chart-wrap .graph-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.28rem;
  margin: 0 0 0.35rem;
}

.profile-chart-wrap .graph-detail .btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  font-size: 0.92rem;
}

.profile-chart-wrap .graph-plot {
  position: relative;
  flex: 1 1 auto;
  min-height: 20.5rem;
}

.profile-chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.graph-menu {
  position: relative;
  display: inline-flex;
}

.graph-menu-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 8;
  display: grid;
  min-width: 6.5rem;
  padding: 0.3rem;
  background: var(--card-bg);
  border: 1px solid var(--table-border);
  border-radius: 0.75rem;
  box-shadow: var(--card-shadow);
}

.graph-menu-list button {
  border: 0;
  background: transparent;
  color: var(--ink-color);
  text-align: left;
  border-radius: 0.45rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 650;
}

.graph-menu-list button:hover {
  background: var(--accent-soft);
}

.sched-editor {
  display: grid;
  gap: 0.7rem;
}

.sched-toolbar {
  display: flex;
  justify-content: flex-end;
}

.sched-toolbar .btn {
  border-radius: 999px;
  font-weight: 700;
}

.sched-week {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 0.42rem;
}

.sched-week thead th:first-child,
.sched-week tbody th {
  width: 42%;
}

.sched-week thead th {
  padding: 0 0.75rem 0.2rem;
  color: var(--muted-ink);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sched-week tbody th,
.sched-week tbody td {
  padding: 0.5rem 0.5rem;
  vertical-align: middle;
  background: color-mix(in srgb, var(--accent-color) 7%, var(--card-bg));
  border-top: 1px solid color-mix(in srgb, var(--accent-color) 18%, var(--card-border));
  border-bottom: 1px solid color-mix(in srgb, var(--accent-color) 18%, var(--card-border));
}

.sched-week tbody th {
  border-left: 1px solid color-mix(in srgb, var(--accent-color) 18%, var(--card-border));
  border-radius: 0.9rem 0 0 0.9rem;
  color: var(--ink-color);
  font-weight: 700;
  white-space: nowrap;
}

.sched-week tbody td {
  overflow: hidden;
}

.sched-week tbody td:last-child {
  border-right: 1px solid color-mix(in srgb, var(--accent-color) 18%, var(--card-border));
  border-radius: 0 0.9rem 0.9rem 0;
}

.sched-week tbody tr.is-off th,
.sched-week tbody tr.is-off td,
.sched-week tbody tr.is-closed th,
.sched-week tbody tr.is-closed td {
  background: color-mix(in srgb, var(--ink-color) 3%, var(--card-bg));
  border-color: var(--card-border);
  color: var(--muted-ink);
}

.sched-week tbody tr.is-outside th,
.sched-week tbody tr.is-outside td {
  background: color-mix(in srgb, #c92a2a 12%, var(--card-bg));
  border-color: color-mix(in srgb, #c92a2a 28%, var(--card-border));
}

.sched-week .clinic-time {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 2.2rem;
  padding: 0.28rem 0.45rem;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.sched-week .clinic-time:disabled {
  opacity: 0.55;
}

.sched-day {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.sched-day input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--accent-color);
}

.sched-notes {
  margin: 0;
  padding: 0.6rem 0.8rem;
  list-style: none;
  border-radius: 0.85rem;
  background: color-mix(in srgb, #c92a2a 10%, var(--card-bg));
  color: #c92a2a;
  font-size: 0.82rem;
  font-weight: 600;
}

.sched-notes li + li {
  margin-top: 0.25rem;
}

.sched-notes .is-gap {
  color: var(--muted-ink);
}

.sched-read {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
}

.sched-read-day {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  min-height: 7.25rem;
  padding: 0.85rem 0.8rem 0.9rem;
  background: color-mix(in srgb, var(--ink-color) 3%, var(--card-bg));
  border: 1px solid var(--card-border);
  border-radius: 1.1rem;
}

.sched-read-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
}

.sched-read-name,
.sched-read-name abbr {
  color: var(--muted-ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.sched-read-dur {
  color: var(--muted-ink);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sched-read-hours {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  flex: 1 1 auto;
  align-items: flex-start;
}

.sched-read-span {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-color) 16%, var(--card-bg));
  color: var(--ink-color);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.sched-read-track {
  position: relative;
  height: 0.42rem;
  margin-top: auto;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-color) 8%, var(--card-bg));
}

.sched-read-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-color) 70%, #fff), var(--accent-color));
}

.sched-read-day.is-on {
  border-color: color-mix(in srgb, var(--accent-color) 42%, var(--card-border));
  background: color-mix(in srgb, var(--accent-color) 11%, var(--card-bg));
  box-shadow: inset 0 2px 0 var(--accent-color);
}

.sched-read-day.is-on .sched-read-name,
.sched-read-day.is-on .sched-read-name abbr,
.sched-read-day.is-on .sched-read-dur {
  color: var(--accent-color);
}

.sched-read-day.is-off .sched-read-span,
.sched-read-day.is-closed .sched-read-span {
  background: var(--stat-hover-bg);
  color: var(--muted-ink);
  font-weight: 650;
}

.sched-read-day.is-off .sched-read-track,
.sched-read-day.is-closed .sched-read-track {
  opacity: 0.45;
}

.sched-read-day.is-closed {
  opacity: 0.78;
}

.profile-mini-table-wrap {
  overflow: auto;
  max-height: 16rem;
}

.profile-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.profile-mini-table th,
.profile-mini-table td {
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid var(--table-border);
  color: var(--ink-color);
  text-align: left;
  white-space: nowrap;
}

.profile-mini-table th {
  color: var(--muted-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-mini-table .is-num {
  text-align: right;
  font-weight: 700;
}

.profile-panel-security {
  border-color: color-mix(in srgb, var(--profile-accent) 20%, var(--card-border));
}

.profile-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.profile-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: rgba(253, 126, 20, 0.18);
  color: var(--profile-accent);
  font-size: 1rem;
  flex-shrink: 0;
}

.profile-panel-head h2 {
  margin: 0 0 0.12rem;
  color: var(--ink-color);
  font-size: 1rem;
  font-weight: 700;
}

.profile-panel-head p {
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.8rem;
  font-weight: 600;
}

.profile-panel .page-filters,
.profile-board-panel .page-filters {
  margin: 0 0 0.75rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.profile-panel .profile-mini-table-wrap {
  max-height: none;
}

.profile-password-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
}

.profile-password-submit {
  display: flex;
  align-items: end;
}

.profile-password-submit .btn {
  white-space: nowrap;
}

.profile-page #password:target {
  box-shadow: 0 0 0 3px var(--focus-ring), var(--card-shadow);
}

@media (max-width: 1199.98px) {
  .profile-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #mirror-page .profile-board {
    grid-template-columns: 1fr;
  }

  .sched-read {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-password-row {
    grid-template-columns: 1fr 1fr;
  }

  .profile-password-submit {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

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

  .profile-left {
    max-width: 24rem;
  }

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

@media (max-width: 575.98px) {
  #mirror-page[data-doctor-ui="1"] .doctor-row,
  #mirror-page[data-doctor-ui="1"] .doctor-row.is-full {
    grid-template-columns: 1fr;
  }

  #mirror-page[data-doctor-ui="1"] .doctor-row > div + div {
    border-left: 0;
    border-top: 1px solid var(--card-border);
  }

  .profile-fields,
  .profile-kpis,
  .profile-detail,
  .profile-password-row,
  .sched-read {
    grid-template-columns: 1fr;
  }

  .profile-card-media {
    aspect-ratio: 4 / 5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-photo-hover,
  .profile-photo-clear,
  .profile-edit-btn,
  .profile-action,
  .profile-logout {
    transition: none;
  }
}

.page-meta {
  display: grid;
  gap: 0.7rem;
  margin: 0;
}

.page-meta div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.page-meta dt {
  margin: 0;
  color: var(--muted-ink);
  font-weight: 600;
}

.page-meta dd {
  margin: 0;
  font-weight: 700;
  color: var(--ink-color);
  text-align: right;
}

.report-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.15rem;
  padding: 0.95rem 1.15rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  color: var(--ink-color);
  font-weight: 700;
}

.report-total.is-ok {
  color: #146c43;
}

.report-total.is-bad {
  color: #b02a37;
}

[data-bs-theme="dark"] .report-total.is-ok {
  color: #4ade80;
}

[data-bs-theme="dark"] .report-total.is-bad {
  color: #f87171;
}

.settings-page {
  width: min(64rem, 100%);
  margin: 1.5rem auto 2.5rem;
  padding: 0 1.25rem;
}

.settings-page h2 {
  margin: 0 0 0.35rem;
}

.settings-lead {
  margin: 0 0 1.15rem;
  max-width: 40rem;
  color: var(--muted-ink);
}

.settings-card {
  padding: 1.25rem 1.35rem 1.2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 1.5rem;
  row-gap: 0.85rem;
  align-items: start;
}

.settings-block {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  min-width: 0;
}

.settings-block + .settings-block {
  padding-left: 1.5rem;
  border-left: 1px solid var(--table-border);
}

.settings-block-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.settings-block-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
}

.settings-help {
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.84rem;
  line-height: 1.45;
}

.settings-page .form-label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted-ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.settings-page .form-control {
  width: 100%;
  min-height: 2.45rem;
  background: var(--btn-secondary-bg) !important;
  color: var(--ink-color) !important;
  border: 1px solid var(--btn-secondary-border) !important;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  box-shadow: none;
}

.settings-page .form-control::placeholder {
  color: var(--muted-ink);
}

.settings-page .form-control:focus {
  border-color: var(--focus-border) !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
  outline: none;
}

/* Document editor — word-style field used by report layout, approval, and glasses */
.doc-shell {
  border: 1px solid var(--table-border);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--ink-color);
  overflow: visible;
  margin: 0.35rem 0 0.85rem;
}

.doc-menubar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  padding: 0.2rem 0.4rem 0;
  background: var(--stat-hover-bg);
  border-bottom: 1px solid var(--table-border);
  border-radius: 12px 12px 0 0;
}

.doc-menu,
.doc-submenu {
  position: relative;
}

.doc-menu-btn {
  border: 0;
  background: transparent;
  color: var(--ink-color);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.28rem 0.55rem;
  border-radius: 8px;
}

.doc-menu-btn:hover,
.doc-menu.is-open > .doc-menu-btn {
  background: var(--accent-soft);
  color: var(--accent-color);
}

.doc-menu-panel {
  display: none;
  position: absolute;
  z-index: 40;
  top: calc(100% + 2px);
  left: 0;
  min-width: 14rem;
  padding: 0.3rem;
  background: var(--card-bg);
  color: var(--ink-color);
  border: 1px solid var(--table-border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.doc-menu.is-open > .doc-menu-panel,
.doc-submenu.is-open > .doc-menu-panel {
  display: block;
  max-height: min(70vh, 28rem);
  overflow: auto;
}

.doc-submenu > .doc-menu-panel {
  top: 0;
  left: calc(100% + 2px);
}

.doc-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  background: transparent;
  color: var(--ink-color);
  font: inherit;
  font-size: 0.84rem;
  text-align: left;
  padding: 0.38rem 0.55rem;
  border-radius: 8px;
}

.doc-menu-item:hover:not(:disabled) {
  background: var(--accent-soft);
}

.doc-menu-item:disabled {
  color: var(--muted-ink);
  cursor: not-allowed;
}

.doc-menu-item.is-on {
  color: var(--accent-color);
}

.doc-mi-main {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.doc-mi-ico {
  width: 1rem;
  text-align: center;
  color: var(--muted-ink);
  flex: 0 0 auto;
}

.doc-menu-item.is-on .doc-mi-ico {
  color: var(--accent-color);
}

.doc-mi-key,
.doc-menu-item .bi-chevron-right {
  color: var(--muted-ink);
  font-size: 0.75rem;
  flex: 0 0 auto;
}

.doc-swatches {
  display: grid;
  grid-template-columns: repeat(8, 1.15rem);
  gap: 3px;
  padding: 0.4rem;
}

.doc-swatch {
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 1px solid var(--table-border);
  border-radius: 3px;
}

.doc-swatch:disabled {
  opacity: 0.35;
}

.doc-color-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.doc-dialog[hidden] {
  display: none !important;
}

.doc-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.35);
}

.doc-dialog-card {
  width: min(26rem, 100%);
  max-height: min(80vh, 36rem);
  overflow: auto;
  margin: 0;
  padding: 1rem;
  background: var(--card-bg);
  color: var(--ink-color);
  border: 1px solid var(--table-border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.doc-dialog-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.doc-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
  font-size: 0.84rem;
}

.doc-field-color {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.doc-field-color .form-control {
  flex: 1;
}

.doc-field-color input[type="color"] {
  width: 2.2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.doc-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.doc-menu-field {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.35rem;
}

.doc-menu-panel .form-control {
  width: 100% !important;
  min-height: 2rem !important;
  padding: 0.2rem 0.65rem !important;
}

.doc-menu-item input[type="color"] {
  width: 1.6rem;
  height: 1.4rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.doc-table-pick {
  display: grid;
  grid-template-columns: repeat(8, 0.85rem);
  gap: 2px;
  padding: 0.45rem;
}

.doc-table-pick span {
  width: 0.85rem;
  height: 0.85rem;
  border: 1px solid var(--table-border);
  border-radius: 2px;
  display: block;
}

.doc-table-pick span.is-on {
  background: var(--accent-soft);
  border-color: var(--accent-color);
}

.doc-grid-label {
  margin: 0;
  padding: 0 0.45rem 0.35rem;
  color: var(--muted-ink);
  font-size: 0.75rem;
}

.doc-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  align-items: center;
  padding: 0.45rem;
  background: var(--stat-hover-bg);
  border-bottom: 1px solid var(--table-border);
  overflow-x: auto;
}

.doc-toolbar .btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.doc-toolbar .doc-color {
  position: relative;
  overflow: hidden;
}

.doc-toolbar .doc-color input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.settings-page .doc-toolbar .form-control,
.doc-toolbar .form-control {
  width: auto;
  max-width: 9.5rem;
  flex: 0 0 auto;
  min-height: 2rem !important;
  padding: 0.15rem 0.7rem !important;
}

.mid-toolbar {
  flex-wrap: wrap;
}

.mid-toolbar .btn.active,
.small-toolbar .btn.active,
.mid-panel button.is-on {
  background: var(--accent-soft);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.mid-toolbar .btn svg {
  display: block;
}

.mid-toolbar [data-cmd="dir"].active .mid-dir-icon {
  transform: scaleX(-1);
}

.mid-drop {
  position: relative;
  flex: 0 0 auto;
}

.mid-drop-btn,
.mid-toolbar .mid-drop > .btn {
  width: auto;
  min-width: 2rem;
  padding: 0 0.45rem;
  gap: 0.25rem;
}

.mid-label {
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
}

.mid-panel {
  display: none;
  position: fixed;
  z-index: 1080;
  top: 0;
  left: 0;
  min-width: 9.5rem;
  max-height: min(20rem, calc(100vh - 16px));
  overflow: auto;
  padding: 0.3rem;
  background: var(--card-bg);
  color: var(--ink-color);
  border: 1px solid var(--table-border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.mid-drop.is-open > .mid-panel,
.mid-panel.is-open {
  display: block;
}

.mid-panel button {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-color);
  text-align: left;
  border-radius: 8px;
  padding: 0.15rem 0.55rem;
  line-height: 1.15;
}

.mid-panel button:hover {
  background: var(--accent-soft);
}

.mid-opt-small { font-size: 0.75em; }
.mid-opt-large { font-size: 1.5em; }
.mid-opt-huge { font-size: 2.5em; }
.mid-opt-h1 { font-size: 2rem; font-weight: 700; }
.mid-opt-h2 { font-size: 1.6rem; font-weight: 700; }
.mid-opt-h3 { font-size: 1.3rem; font-weight: 700; }
.mid-opt-h4 { font-size: 1.1rem; font-weight: 700; }
.mid-opt-h5 { font-size: 1rem; font-weight: 700; }
.mid-opt-h6 { font-size: 0.9rem; font-weight: 700; }
.mid-opt-normal { font-size: 1.1rem; font-weight: 400; }

.mid-panel-align {
  min-width: 0;
}

.mid-align {
  display: flex;
  gap: 0.2rem;
}

.mid-align button {
  width: 2rem;
  height: 2rem;
  justify-content: center;
  padding: 0;
}

.mid-picker {
  font-size: 0.84rem;
  padding: 0.4rem 0.55rem;
}

.doc-link {
  display: none;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--table-border);
}

.doc-link.is-open {
  display: flex;
}

.doc-link .form-control {
  flex: 1;
}

.doc-surface {
  min-height: 11rem;
  padding: 0.85rem 1rem;
  background: var(--card-bg);
  color: var(--ink-color);
}

.doc-surface .ProseMirror {
  min-height: 9.5rem;
  outline: none;
  color: var(--ink-color);
}

.doc-surface .ProseMirror p {
  margin: 0 0 0.45rem;
}

.doc-surface .ProseMirror h1,
.doc-surface .ProseMirror h2,
.doc-surface .ProseMirror h3,
.doc-surface .ProseMirror h4,
.doc-surface .ProseMirror h5,
.doc-surface .ProseMirror h6 {
  margin: 0.6rem 0 0.35rem;
  line-height: 1.25;
}

.doc-surface .ProseMirror h1 { font-size: 2rem; }
.doc-surface .ProseMirror h2 { font-size: 1.6rem; }
.doc-surface .ProseMirror h3 { font-size: 1.3rem; }
.doc-surface .ProseMirror h4 { font-size: 1.1rem; }
.doc-surface .ProseMirror h5 { font-size: 1rem; }
.doc-surface .ProseMirror h6 { font-size: 0.9rem; }

.doc-surface .ProseMirror blockquote {
  margin: 0.4rem 0;
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent-color);
}

.doc-surface .ProseMirror pre {
  margin: 0.4rem 0;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: var(--stat-hover-bg);
  font-family: "Courier New", Courier, monospace;
  white-space: pre-wrap;
}

.doc-surface .ProseMirror code {
  padding: 0.05rem 0.25rem;
  border-radius: 4px;
  background: var(--stat-hover-bg);
  font-family: "Courier New", Courier, monospace;
}

.doc-surface .ProseMirror ul,
.doc-surface .ProseMirror ol {
  margin: 0.35rem 0 0.45rem;
  padding-left: 1.4rem;
}

.doc-surface .ProseMirror ul { list-style: disc; }
.doc-surface .ProseMirror ol { list-style: decimal; }

.doc-surface .ProseMirror table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.4rem 0;
}

.doc-surface .ProseMirror td,
.doc-surface .ProseMirror th {
  position: relative;
  min-width: 2rem;
  border: 1px solid var(--table-border);
  padding: 0.3rem 0.4rem;
  vertical-align: top;
}

.doc-surface .selectedCell:after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-soft);
  pointer-events: none;
}

.doc-surface .column-resize-handle {
  position: absolute;
  right: -2px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-color);
  pointer-events: none;
}

.doc-surface.is-aids .ProseMirror p,
.doc-surface.is-aids .ProseMirror h1,
.doc-surface.is-aids .ProseMirror h2,
.doc-surface.is-aids .ProseMirror h3,
.doc-surface.is-aids .ProseMirror h4,
.doc-surface.is-aids .ProseMirror h5,
.doc-surface.is-aids .ProseMirror h6,
.doc-surface.is-aids .ProseMirror li,
.doc-surface.is-aids .ProseMirror pre,
.doc-surface.is-aids .ProseMirror blockquote,
.doc-surface.is-aids .ProseMirror div,
.doc-surface.is-aids .ProseMirror td,
.doc-surface.is-aids .ProseMirror th {
  outline: 1px dashed var(--table-border);
}

.doc-surface .ProseMirror {
  position: relative;
}

.doc-surface .ProseMirror img,
.doc-surface .doc-image {
  max-width: 100%;
  height: auto;
}

.doc-surface .doc-image-frame {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0.55rem auto 0.55rem 0;
  line-height: 0;
}

.doc-surface .doc-image-frame[data-align="center"] {
  margin-left: auto;
  margin-right: auto;
}

.doc-surface .doc-image-frame[data-align="right"] {
  margin-left: auto;
  margin-right: 0;
}

.doc-surface .doc-image-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0;
  cursor: grab;
  border-radius: 4px;
}

.doc-surface .doc-image-frame[style*="width"] img {
  width: 100%;
}

.doc-surface .doc-image-frame.is-selected {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
  margin-bottom: 3.2rem;
}

.doc-surface .doc-image-frame.is-dragging {
  opacity: 0.45;
}

.doc-surface .doc-image-tools,
.doc-surface .doc-image-handle {
  display: none;
}

.doc-surface .doc-image-frame.is-selected .doc-image-tools {
  display: flex;
}

.doc-surface .doc-image-frame.is-selected .doc-image-handle {
  display: block;
}

.doc-surface .doc-image-tools {
  position: absolute;
  z-index: 3;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  width: max-content;
  padding: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-color) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-bg) 20%, transparent);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.doc-surface .doc-image-tool {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--card-bg);
  cursor: pointer;
}

.doc-surface .doc-image-tool:hover,
.doc-surface .doc-image-tool.is-on {
  background: color-mix(in srgb, var(--accent-color) 28%, transparent);
  color: var(--accent-color);
}

.doc-surface .doc-image-tool[data-image-act="remove"]:hover {
  background: color-mix(in srgb, #dc3545 28%, transparent);
  color: #f8a0a0;
}

.doc-surface .doc-image-handle {
  position: absolute;
  z-index: 4;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 3px;
  background: var(--accent-color);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.doc-surface .doc-image-handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.doc-surface .doc-image-handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.doc-surface .doc-image-handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.doc-surface .doc-image-handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }

.doc-surface .doc-image-drop-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--accent-color);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-color) 35%, transparent);
  pointer-events: none;
  z-index: 5;
}

.doc-crop {
  position: fixed;
  inset: 0;
  z-index: 4300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.62);
}

.doc-crop-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  padding: 1rem 1rem 0.9rem;
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--ink-color);
  border: 1px solid var(--table-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.doc-crop-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.doc-crop-hint {
  margin: 0 0 0.75rem;
  color: color-mix(in srgb, var(--ink-color) 65%, transparent);
  font-size: 0.86rem;
}

.doc-crop-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.doc-crop-stage img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
}

.doc-crop-box {
  position: absolute;
  border: 2px solid var(--accent-color);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
  touch-action: none;
}

.doc-crop-box span {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent-color);
  border: 2px solid #fff;
  border-radius: 2px;
}

.doc-crop-box span[data-crop="nw"] { top: 0; left: 0; cursor: nwse-resize; }
.doc-crop-box span[data-crop="ne"] { top: 0; right: 0; cursor: nesw-resize; }
.doc-crop-box span[data-crop="sw"] { bottom: 0; left: 0; cursor: nesw-resize; }
.doc-crop-box span[data-crop="se"] { bottom: 0; right: 0; cursor: nwse-resize; }

.doc-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.doc-crop-apply,
.doc-crop-cancel {
  min-height: 2.25rem;
  padding: 0.375rem 0.9rem;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.doc-crop-apply {
  border: 0;
  color: #fff;
  background: var(--accent-color);
}

.doc-crop-cancel {
  border: 1px solid var(--table-border);
  color: var(--ink-color);
  background: transparent;
}

.doc-codes {
  margin: 0.75rem 0 0.25rem;
  color: var(--ink-color);
}

.doc-code-title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.doc-code-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.doc-code-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ink-color);
  font: inherit;
  font-weight: 700;
  padding: 0 0 0.3rem;
}

.doc-code-tab.is-on {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.doc-code-hint {
  margin: 0;
  color: var(--muted-ink);
  font-weight: 500;
}

.doc-codes hr {
  margin: 0.45rem 0 0.65rem;
  border: 0;
  border-top: 1px solid var(--table-border);
  opacity: 1;
}

.doc-code-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.2rem 0.85rem;
}

.doc-code {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-color);
}

.doc-code b {
  cursor: pointer;
  padding: 0 0.15rem;
  border-radius: 4px;
  font-weight: 700;
}

.doc-code b:hover,
.doc-code b.is-used {
  background: var(--accent-soft);
}

.doc-code .bi {
  color: var(--accent-color);
  font-size: 0.75rem;
}

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

#user-drawer .doc-surface,
#user-drawer .doc-surface .ProseMirror {
  min-height: 16rem;
}

/* visit-switch lives in visit.css too, but that sheet only loads on clinical pages.
   Keep a copy here so finance/user drawers get the same control. */
.visit-switch {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.visit-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.visit-switch-face {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.6rem;
  padding: 0.32rem 0.5rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.55rem;
  background: var(--card-bg);
  box-sizing: border-box;
}

.visit-switch input:checked + .visit-switch-face {
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 12%, var(--card-bg));
}

.visit-switch input:focus-visible + .visit-switch-face {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.visit-switch-icon {
  flex: 0 0 1.65rem;
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--ink-color) 8%, transparent);
  color: var(--muted-ink);
  font-size: 0.9rem;
}

.visit-switch input:checked + .visit-switch-face .visit-switch-icon {
  background: var(--accent-color);
  color: #fff;
}

.visit-switch-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.visit-switch-title {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink-color);
}

.visit-switch-hint {
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--muted-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visit-switch-track {
  position: relative;
  flex: 0 0 1.85rem;
  width: 1.85rem;
  height: 1.05rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted-ink) 32%, var(--card-bg));
}

.visit-switch-knob {
  position: absolute;
  top: 0.12rem;
  left: 0.12rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.visit-switch input:checked + .visit-switch-face .visit-switch-track {
  background: var(--accent-color);
}

.visit-switch input:checked + .visit-switch-face .visit-switch-knob {
  transform: translateX(0.8rem);
}

#user-drawer.is-view .gender-choice,
#user-drawer.is-view .visit-switch,
#bank-drawer.is-view .visit-switch {
  pointer-events: none;
}

#user-drawer #user-status-view > div {
  display: flex;
  align-items: center;
  min-height: 2.45rem;
}

#user-drawer #user-status-badge.status-pill {
  min-height: 2.15rem;
  padding: 0.35rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
}

#user-drawer .visit-switch-face {
  min-height: 3.25rem;
  padding: 0.55rem 0.9rem;
  gap: 0.75rem;
}

#user-drawer .visit-switch-icon {
  flex-basis: 2.15rem;
  width: 2.15rem;
  height: 2.15rem;
  font-size: 1.05rem;
}

#user-drawer .visit-switch-title {
  font-size: 0.95rem;
  line-height: 1.3;
}

#user-drawer .visit-switch-track {
  flex-basis: 2.7rem;
  width: 2.7rem;
  height: 1.5rem;
}

#user-drawer .visit-switch-knob {
  top: 0.18rem;
  left: 0.18rem;
  width: 1.14rem;
  height: 1.14rem;
}

#user-drawer .visit-switch input:checked + .visit-switch-face .visit-switch-knob {
  transform: translateX(1.2rem);
}

#bank-drawer .bank-money-pos-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem 1rem;
  align-items: stretch;
}

#bank-drawer .bank-money-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem 0.75rem;
  align-content: start;
  min-width: 0;
}

#bank-drawer .bank-pos-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
}

#bank-drawer .bank-pos-field > .form-label {
  margin-bottom: 0.25rem;
}

#bank-drawer .bank-pos-field .visit-switch {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

#bank-drawer .bank-pos-field .visit-switch-face {
  width: 100%;
  flex: 1 1 auto;
  min-height: 2.45rem;
  height: 100%;
  padding: 0.45rem 0.75rem;
  gap: 0.65rem;
}

#bank-drawer .bank-pos-field .visit-switch-icon {
  flex-basis: 2rem;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
}

#bank-drawer .bank-pos-field .visit-switch-title {
  font-size: 0.88rem;
  line-height: 1.25;
}

#bank-drawer .bank-pos-field .visit-switch-track {
  flex-basis: 2.4rem;
  width: 2.4rem;
  height: 1.35rem;
}

#bank-drawer .bank-pos-field .visit-switch-knob {
  top: 0.16rem;
  left: 0.16rem;
  width: 1.02rem;
  height: 1.02rem;
}

#bank-drawer .bank-pos-field .visit-switch input:checked + .visit-switch-face .visit-switch-knob {
  transform: translateX(1.05rem);
}

@media (max-width: 640px) {
  #bank-drawer .bank-money-pos-row,
  #bank-drawer .bank-money-fields {
    grid-template-columns: 1fr;
  }
}

.doc-shell.is-locked .doc-toolbar,
.drawer.is-view .doc-toolbar {
  display: none;
}

.drawer.is-view .doc-surface {
  pointer-events: none;
}

.settings-page textarea.form-control,
.settings-page input[type="color"].form-control {
  border-radius: 12px;
  height: auto;
}

.settings-page input[type="color"].form-control {
  width: 3rem;
  min-height: 2.45rem;
  padding: 0.2rem;
}


.settings-lookup {
  position: relative;
}

.settings-suggest {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% - 0.15rem);
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--card-bg);
  border: 1px solid var(--table-border);
  border-radius: 0.85rem;
  box-shadow: var(--card-shadow);
  max-height: 14rem;
  overflow: auto;
}

.settings-suggest li {
  padding: 0.45rem 0.7rem;
  border-radius: 0.55rem;
  cursor: pointer;
}

.settings-suggest li.is-active,
.settings-suggest li:hover {
  background: color-mix(in srgb, var(--accent-color) 48%, var(--card-bg));
  color: #fff;
}

/* Walk-in POS block sits outside .settings-grid, so it needs its own gap. */
.settings-card > .settings-block .settings-current {
  margin-top: 0.75rem;
}

.settings-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  min-height: 1.25rem;
  color: var(--muted-ink);
  font-size: 0.82rem;
}

.settings-current a {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
}

.settings-current a:hover {
  text-decoration: underline;
}

.settings-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.2rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--table-border);
}

@media (max-width: 767.98px) {
  .settings-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    row-gap: 0;
  }

  .settings-block {
    display: block;
    grid-row: auto;
  }

  .settings-block-head {
    margin-bottom: 0.85rem;
  }

  .settings-current {
    margin-top: 0.7rem;
  }

  .settings-block + .settings-block {
    padding-left: 0;
    padding-top: 1.1rem;
    border-left: 0;
    border-top: 1px solid var(--table-border);
  }
}

.settings-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--table-border);
  border-radius: var(--card-radius);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}

.settings-notice .icon-tile {
  margin-top: 0.1rem;
}

.settings-notice-copy {
  min-width: 0;
}

.settings-notice-copy strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}

.settings-notice-copy p,
.settings-notice-copy ul {
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.88rem;
  line-height: 1.45;
}

.settings-notice-copy ul {
  padding-left: 1.1rem;
  margin-top: 0.35rem;
}

.settings-notice-copy a {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
}

.settings-notice-copy a:hover {
  text-decoration: underline;
}

.settings-notice.is-warning {
  border-color: color-mix(in srgb, #f59a2a 55%, var(--table-border));
  background: color-mix(in srgb, #f59a2a 12%, var(--card-bg));
}

.settings-notice.is-warning .icon-tile {
  background: color-mix(in srgb, #f59a2a 18%, transparent);
  color: #f59a2a;
}

.settings-notice.is-danger {
  border-color: color-mix(in srgb, #e23d34 50%, var(--table-border));
  background: color-mix(in srgb, #e23d34 12%, var(--card-bg));
}

.settings-notice.is-danger .icon-tile {
  background: color-mix(in srgb, #e23d34 18%, transparent);
  color: #e23d34;
}

.settings-notice.is-success {
  border-color: color-mix(in srgb, #2f9e5d 50%, var(--table-border));
  background: color-mix(in srgb, #2f9e5d 12%, var(--card-bg));
}

.settings-notice.is-success .icon-tile {
  background: color-mix(in srgb, #2f9e5d 18%, transparent);
  color: #2f9e5d;
}

.settings-preview {
  display: grid;
}

.settings-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--table-border);
  color: var(--ink-color);
}

.settings-preview-row:first-child {
  padding-top: 0;
}

.settings-preview-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.settings-count {
  flex: 0 0 auto;
  min-width: 2rem;
  color: var(--accent-color);
  font-weight: 700;
  text-align: right;
}

.settings-card-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 700;
}

.settings-actions.is-flush {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.settings-actions-end {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-table {
  overflow-x: auto;
  background: var(--card-bg);
  border: 1px solid var(--table-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

#itemsViewList .page-table {
  overflow-x: auto;
}

#itemsViewList table.tabela {
  width: 100% !important;
}

#itemsViewList table.tabela th,
#itemsViewList table.tabela td {
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

#itemsViewList table.dataTable thead > tr > th.sorting,
#itemsViewList table.dataTable thead > tr > th.sorting_asc,
#itemsViewList table.dataTable thead > tr > th.sorting_desc {
  padding-right: 1.05rem !important;
}

#itemsViewList table.tabela td {
  white-space: normal;
}

#itemsViewList th:first-child,
#itemsViewList td:first-child {
  width: auto;
}

#itemsViewList th:nth-child(11),
#itemsViewList td:nth-child(11),
#itemsViewList td.num {
  width: 1px;
  white-space: nowrap;
}

#itemsViewList th.row-actions,
#itemsViewList td.row-actions {
  width: 1%;
  padding-left: 0.35rem;
  padding-right: 0.55rem;
  white-space: nowrap;
  text-align: right;
}

#itemsViewList .item-name-cell {
  min-width: 0;
  max-width: 100%;
}

#itemsViewList .item-name-cell > span:last-child {
  flex: 1 1 auto;
  min-width: 0;
}

.page-table > table.tabela,
.page-table .dataTables_wrapper {
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  background: transparent;
}

.page-table table.tabela {
  width: 100%;
  overflow: visible;
}

.page-table table.tabela th,
.page-table table.tabela td {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.page-empty {
  background: var(--card-bg);
  border: 1px solid var(--table-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  text-align: center;
  padding: 3rem 1.5rem;
}

.page-empty p {
  margin: 0 0 1rem;
  color: var(--muted-ink);
}

table.tabela tbody tr.is-archived td,
tr.is-archived td,
.item-card.is-archived {
  opacity: 0.62;
}

#clinic-lifecycle {
  z-index: 1080;
}

#clinic-lifecycle-title {
  color: var(--accent-color);
  font-size: 1.35rem;
  font-weight: 700;
}

#clinic-lifecycle-body {
  margin: 0 0 1.1rem;
  color: var(--ink-color);
}

#clinic-lifecycle-body p {
  margin: 0 0 0.55rem;
  color: var(--ink-color);
  font-size: 0.98rem;
  font-weight: 600;
}

#clinic-lifecycle-body .clinic-lifecycle-note {
  color: var(--muted-ink);
  font-size: 0.92rem;
  font-weight: 500;
}

.clinic-lifecycle-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
}

.clinic-lifecycle-actions .btn {
  margin: 0;
  white-space: nowrap;
}

tr.is-clickable,
.item-card.is-clickable {
  cursor: pointer;
}

td.num,
th.num,
table.dataTable td.num,
table.dataTable th.num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

th.row-actions,
td.row-actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

td.row-actions {
  vertical-align: middle;
  cursor: default;
}

table.tabela td.row-actions,
table.table td.row-actions {
  font-size: 0;
}

table.tabela td.row-actions > a,
table.table td.row-actions > a,
table.tabela td.row-actions > button,
table.table td.row-actions > button,
table.tabela td.row-actions > a:first-child,
table.table td.row-actions > a:first-child,
table.tabela td.row-actions > button:first-child,
table.table td.row-actions > button:first-child,
table.tabela td.row-actions > a:last-child,
table.table td.row-actions > a:last-child,
table.tabela td.row-actions > button:last-child,
table.table td.row-actions > button:last-child,
table.tabela td.row-actions > a:only-child,
table.table td.row-actions > a:only-child,
table.tabela td.row-actions > button:only-child,
table.table td.row-actions > button:only-child {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 2.75rem;
  margin: 0 0.35rem 0 0;
  padding: 0 0.95rem;
  border: 1px solid var(--accent-color);
  border-radius: 0.55rem;
  background: transparent;
  color: var(--accent-color) !important;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
  vertical-align: middle;
  box-shadow: none;
  cursor: pointer;
}

.taxonomy-page table.tabela td.row-actions > a,
.taxonomy-page table.tabela td.row-actions > button,
.taxonomy-page table.tabela td.row-actions > a:first-child,
.taxonomy-page table.tabela td.row-actions > button:first-child,
.taxonomy-page table.tabela td.row-actions > a:last-child,
.taxonomy-page table.tabela td.row-actions > button:last-child,
.taxonomy-page table.tabela td.row-actions > a:only-child,
.taxonomy-page table.tabela td.row-actions > button:only-child {
  margin-left: 0;
  border-radius: 0.55rem;
}

.taxonomy-page table.tabela td.row-actions > a + a,
.taxonomy-page table.tabela td.row-actions > a + button,
.taxonomy-page table.tabela td.row-actions > button + a,
.taxonomy-page table.tabela td.row-actions > button + button,
.taxonomy-page table.tabela td.row-actions > button + button:last-child,
.taxonomy-page table.tabela td.row-actions > a + button:last-child {
  margin-left: 0 !important;
}

.clinic-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  vertical-align: middle;
}

.taxonomy-page table.tabela td.row-actions .clinic-row-actions > button,
.taxonomy-page table.tabela td.row-actions .clinic-row-actions > a,
.taxonomy-page table.tabela td.row-actions .clinic-row-actions > button:first-child,
.taxonomy-page table.tabela td.row-actions .clinic-row-actions > button:last-child,
.taxonomy-page table.tabela td.row-actions .clinic-row-actions > button:only-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  margin: 0 !important;
  padding: 0 0.95rem;
  border: 1px solid var(--accent-color);
  border-radius: 0.55rem !important;
  background: transparent;
  color: var(--accent-color) !important;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  box-shadow: none;
  cursor: pointer;
}

.taxonomy-page table.tabela td.row-actions .clinic-row-actions > button:hover,
.taxonomy-page table.tabela td.row-actions .clinic-row-actions > button:focus {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff !important;
}

.taxonomy-page table.tabela td.row-actions .clinic-row-actions > button.is-danger {
  border-color: #ef4444;
  background: transparent;
  color: #ef4444 !important;
}

.taxonomy-page table.tabela td.row-actions .clinic-row-actions > button.is-danger:hover,
.taxonomy-page table.tabela td.row-actions .clinic-row-actions > button.is-danger:focus {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff !important;
}

table.tabela td.row-actions > a:hover,
table.tabela td.row-actions > a:focus,
table.table td.row-actions > a:hover,
table.table td.row-actions > a:focus,
table.tabela td.row-actions > button:hover,
table.tabela td.row-actions > button:focus,
table.table td.row-actions > button:hover,
table.table td.row-actions > button:focus {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff !important;
  text-decoration: none !important;
}

table.tabela td.row-actions > a.is-danger,
table.table td.row-actions > a.is-danger,
table.tabela td.row-actions > button.is-danger,
table.table td.row-actions > button.is-danger {
  border-color: #ef4444;
  background: transparent;
  color: #ef4444 !important;
}

table.tabela td.row-actions > a.is-danger:hover,
table.tabela td.row-actions > a.is-danger:focus,
table.table td.row-actions > a.is-danger:hover,
table.table td.row-actions > a.is-danger:focus,
table.tabela td.row-actions > button.is-danger:hover,
table.tabela td.row-actions > button.is-danger:focus,
table.table td.row-actions > button.is-danger:hover,
table.table td.row-actions > button.is-danger:focus {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff !important;
  text-decoration: none !important;
}

.page-table,
.page-table .dataTables_wrapper,
#itemsViewList .dataTables_wrapper {
  overflow: visible;
}

.clinic-actions {
  position: static;
  display: inline-flex;
  justify-content: flex-end;
  vertical-align: middle;
}

.clinic-actions-menu {
  width: 2.15rem;
  height: 2.15rem;
  min-width: 2.15rem;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid var(--accent-color);
  background: transparent;
  color: var(--accent-color);
  font-size: 1.15rem;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}

.clinic-actions-menu > i {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1;
}

.clinic-actions-menu:hover,
.clinic-actions-menu:focus,
.clinic-actions-menu.show,
.clinic-actions-menu[aria-expanded="true"] {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.clinic-icon-btn {
  width: 2.15rem;
  height: 2.15rem;
  min-width: 2.15rem;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid var(--accent-color);
  background: transparent;
  color: var(--accent-color) !important;
  font-size: 1.05rem;
  line-height: 1;
  text-decoration: none !important;
  box-shadow: none;
  cursor: pointer;
}

.clinic-icon-btn > i {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1;
}

.clinic-icon-btn:hover,
.clinic-icon-btn:focus {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff !important;
}

table.tabela td.row-actions > a.clinic-icon-btn,
table.table td.row-actions > a.clinic-icon-btn,
table.tabela td.row-actions > button.clinic-icon-btn,
table.table td.row-actions > button.clinic-icon-btn,
table.tabela td.row-actions > a.clinic-icon-btn:first-child,
table.table td.row-actions > a.clinic-icon-btn:first-child,
table.tabela td.row-actions > button.clinic-icon-btn:first-child,
table.table td.row-actions > button.clinic-icon-btn:first-child,
table.tabela td.row-actions > a.clinic-icon-btn:last-child,
table.table td.row-actions > a.clinic-icon-btn:last-child,
table.tabela td.row-actions > button.clinic-icon-btn:last-child,
table.table td.row-actions > button.clinic-icon-btn:last-child,
table.tabela td.row-actions > a.clinic-icon-btn:only-child,
table.table td.row-actions > a.clinic-icon-btn:only-child,
table.tabela td.row-actions > button.clinic-icon-btn:only-child,
table.table td.row-actions > button.clinic-icon-btn:only-child {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  padding: 0;
  margin: 0 0.35rem 0 0;
  gap: 0;
  border-radius: 0.55rem;
  justify-content: center;
  font-size: 1.05rem;
  background: transparent;
  color: var(--accent-color) !important;
}

table.tabela td.row-actions > a.clinic-icon-btn:last-child,
table.table td.row-actions > a.clinic-icon-btn:last-child,
table.tabela td.row-actions > button.clinic-icon-btn:last-child,
table.table td.row-actions > button.clinic-icon-btn:last-child {
  margin-right: 0;
}

table.tabela td.row-actions > a.clinic-icon-btn:hover,
table.tabela td.row-actions > a.clinic-icon-btn:focus,
table.table td.row-actions > a.clinic-icon-btn:hover,
table.table td.row-actions > a.clinic-icon-btn:focus,
table.tabela td.row-actions > button.clinic-icon-btn:hover,
table.tabela td.row-actions > button.clinic-icon-btn:focus,
table.table td.row-actions > button.clinic-icon-btn:hover,
table.table td.row-actions > button.clinic-icon-btn:focus {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff !important;
}

#PosSalesTable td.row-actions,
#InvoicesTable td.row-actions,
#PaymentsTable td.row-actions {
  font-size: 1rem;
  white-space: nowrap;
  min-width: 11rem;
}

#PosSalesTable .dash-action-bar,
#InvoicesTable .dash-action-bar,
#PaymentsTable .dash-action-bar,
.payment-linked-doc .dash-action-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  vertical-align: middle;
}

#PosSalesTable .dash-action-bar > a.clinic-icon-btn,
#PosSalesTable .dash-action-bar > button.clinic-icon-btn,
#InvoicesTable .dash-action-bar > a.clinic-icon-btn,
#InvoicesTable .dash-action-bar > button.clinic-icon-btn,
#PaymentsTable .dash-action-bar > a.clinic-icon-btn,
#PaymentsTable .dash-action-bar > button.clinic-icon-btn,
.payment-linked-doc .dash-action-bar > a.clinic-icon-btn,
.payment-linked-doc .dash-action-bar > button.clinic-icon-btn {
  width: auto;
  height: 2.75rem;
  min-width: 0;
  margin: 0;
  padding: 0 0.95rem;
  gap: 0.4rem;
  border: 1px solid var(--accent-color);
  border-radius: 0.7rem;
  background: transparent;
  color: var(--accent-color) !important;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1;
  box-shadow: none;
  justify-content: center;
}

#PosSalesTable .dash-action-bar > a.clinic-icon-btn > i,
#PosSalesTable .dash-action-bar > a.clinic-icon-btn .dash-label,
#PosSalesTable .dash-action-bar > button.clinic-icon-btn > i,
#PosSalesTable .dash-action-bar > button.clinic-icon-btn .dash-label,
#InvoicesTable .dash-action-bar > a.clinic-icon-btn > i,
#InvoicesTable .dash-action-bar > a.clinic-icon-btn .dash-label,
#InvoicesTable .dash-action-bar > button.clinic-icon-btn > i,
#InvoicesTable .dash-action-bar > button.clinic-icon-btn .dash-label,
#PaymentsTable .dash-action-bar > a.clinic-icon-btn > i,
#PaymentsTable .dash-action-bar > a.clinic-icon-btn .dash-label,
#PaymentsTable .dash-action-bar > button.clinic-icon-btn > i,
#PaymentsTable .dash-action-bar > button.clinic-icon-btn .dash-label,
.payment-linked-doc .dash-action-bar > a.clinic-icon-btn > i,
.payment-linked-doc .dash-action-bar > a.clinic-icon-btn .dash-label,
.payment-linked-doc .dash-action-bar > button.clinic-icon-btn > i,
.payment-linked-doc .dash-action-bar > button.clinic-icon-btn .dash-label {
  color: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1;
}

#PosSalesTable .dash-action-bar > a.clinic-icon-btn > i,
#PosSalesTable .dash-action-bar > button.clinic-icon-btn > i,
#InvoicesTable .dash-action-bar > a.clinic-icon-btn > i,
#InvoicesTable .dash-action-bar > button.clinic-icon-btn > i,
#PaymentsTable .dash-action-bar > a.clinic-icon-btn > i,
#PaymentsTable .dash-action-bar > button.clinic-icon-btn > i,
.payment-linked-doc .dash-action-bar > a.clinic-icon-btn > i,
.payment-linked-doc .dash-action-bar > button.clinic-icon-btn > i {
  font-size: 1.15rem;
}

#PosSalesTable .dash-action-bar > a.clinic-icon-btn:hover,
#PosSalesTable .dash-action-bar > a.clinic-icon-btn:focus,
#PosSalesTable .dash-action-bar > button.clinic-icon-btn:hover,
#PosSalesTable .dash-action-bar > button.clinic-icon-btn:focus,
#InvoicesTable .dash-action-bar > a.clinic-icon-btn:hover,
#InvoicesTable .dash-action-bar > a.clinic-icon-btn:focus,
#InvoicesTable .dash-action-bar > button.clinic-icon-btn:hover,
#InvoicesTable .dash-action-bar > button.clinic-icon-btn:focus,
#PaymentsTable .dash-action-bar > a.clinic-icon-btn:hover,
#PaymentsTable .dash-action-bar > a.clinic-icon-btn:focus,
#PaymentsTable .dash-action-bar > button.clinic-icon-btn:hover,
#PaymentsTable .dash-action-bar > button.clinic-icon-btn:focus,
.payment-linked-doc .dash-action-bar > a.clinic-icon-btn:hover,
.payment-linked-doc .dash-action-bar > a.clinic-icon-btn:focus,
.payment-linked-doc .dash-action-bar > button.clinic-icon-btn:hover,
.payment-linked-doc .dash-action-bar > button.clinic-icon-btn:focus {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff !important;
}

.payment-linked-doc {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-right: 0.75rem;
}

.clinic-actions-dropdown,
.clinic-actions-dropdown.dropdown-menu,
.clinic-actions-dropdown--portal {
  --bs-dropdown-bg: #ffffff;
  z-index: 2000;
  min-width: 12.5rem;
  padding: 0.4rem;
  border-radius: 0.75rem;
  background: #ffffff;
  background-color: #ffffff;
  border: 1px solid var(--table-border);
  box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.18);
  color: var(--ink-color);
  font-size: 0.875rem;
  opacity: 1;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

[data-bs-theme="dark"] .clinic-actions-dropdown,
[data-bs-theme="dark"] .clinic-actions-dropdown.dropdown-menu,
[data-bs-theme="dark"] .clinic-actions-dropdown--portal {
  --bs-dropdown-bg: #1c1c22;
  background: #1c1c22;
  background-color: #1c1c22;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0.65rem 1.8rem rgba(0, 0, 0, 0.55);
  color: #f4f4f5;
}

.clinic-actions-dropdown .clinic-action-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 3rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  background-color: transparent;
  color: var(--ink-color);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  opacity: 1;
}

[data-bs-theme="dark"] .clinic-actions-dropdown .clinic-action-item {
  color: #f4f4f5;
}

.clinic-actions-dropdown .clinic-action-item:hover,
.clinic-actions-dropdown .clinic-action-item:focus {
  background: color-mix(in srgb, var(--accent-color) 14%, var(--card-bg));
  color: var(--ink-color);
}

.clinic-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  flex-shrink: 0;
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--accent-color) 16%, transparent);
  color: var(--accent-color);
}

.clinic-action-icon i {
  font-size: 1.05rem;
}

.clinic-action-label {
  min-width: 0;
}

.item-card-actions .clinic-actions {
  margin-left: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--btn-secondary-border);
  background: #ffffff;
  color: var(--ink-color);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.status-pill.is-active,
.status-pill.is-paid {
  background: rgba(25, 135, 84, 0.12);
  border-color: rgba(20, 108, 67, 0.35);
  color: #146c43;
}

.status-pill.is-passive,
.status-pill.is-unpaid,
.status-pill.is-debt {
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(176, 42, 55, 0.35);
  color: #b02a37;
}

.status-pill.is-warn {
  background: rgba(253, 126, 20, 0.12);
  border-color: rgba(196, 92, 18, 0.35);
  color: #c45c12;
}

.status-pill.is-credit,
.status-pill.is-overpaid {
  background: rgba(25, 135, 84, 0.12);
  border-color: rgba(20, 108, 67, 0.35);
  color: #146c43;
}

.status-pill[data-category="goods" i] {
  background: #fff4e8;
  border-color: rgba(196, 92, 18, 0.35);
  color: #c45c12;
}

.status-pill[data-category="tax" i] {
  background: #eef4ff;
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
}

.status-pill[data-category="expense" i] {
  background: #fdecec;
  border-color: rgba(185, 28, 28, 0.28);
  color: #b91c1c;
}

.status-pill[data-category="investment" i] {
  background: #eefbf6;
  border-color: rgba(15, 118, 110, 0.28);
  color: #0f766e;
}

.status-pill[data-category="service" i] {
  background: #eef8ff;
  border-color: rgba(3, 105, 161, 0.28);
  color: #0369a1;
}

.status-pill[data-category="other" i] {
  background: #f4f4f5;
  border-color: #c8c8ce;
  color: #3f3f46;
}

.status-pill[data-role="1"] {
  background: rgba(253, 126, 20, 0.14);
  border-color: rgba(196, 92, 18, 0.38);
  color: #c45c12;
}

.status-pill[data-role="2"] {
  background: rgba(217, 119, 6, 0.14);
  border-color: rgba(180, 83, 9, 0.35);
  color: #b45309;
}

.status-pill[data-role="3"] {
  background: rgba(13, 148, 136, 0.12);
  border-color: rgba(15, 118, 110, 0.32);
  color: #0f766e;
}

.status-pill[data-role="4"] {
  background: rgba(25, 135, 84, 0.12);
  border-color: rgba(20, 108, 67, 0.35);
  color: #146c43;
}

.status-pill[data-role="5"] {
  background: rgba(8, 145, 178, 0.12);
  border-color: rgba(14, 116, 144, 0.32);
  color: #0e7490;
}

.status-pill[data-role="6"] {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(29, 78, 216, 0.32);
  color: #1d4ed8;
}

.status-pill[data-role="7"] {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(109, 40, 217, 0.32);
  color: #6d28d9;
}

.status-pill[data-role="8"] {
  background: rgba(219, 39, 119, 0.12);
  border-color: rgba(190, 24, 93, 0.32);
  color: #be185d;
}

.status-pill[data-role="9"] {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(67, 56, 202, 0.32);
  color: #4338ca;
}

/* Home page cards, previously declared only in dashboard.php */
.dash-qa-dropdown {
  position: relative;
  z-index: 6;
}

.dash-qa-menu {
  min-width: 230px;
  padding: 0.7rem;
  margin-top: 0.55rem !important;
  border-radius: 18px;
  border: 1px solid rgba(253, 126, 20, 0.22) !important;
  background: var(--card-bg) !important;
  box-shadow: 0 12px 32px rgba(61, 46, 34, 0.12) !important;
}

button.dash-qa-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.dash-qa-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 999px;
  margin: 0.2rem 0;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(253, 126, 20, 0.28) !important;
  background: rgba(253, 126, 20, 0.06) !important;
  color: var(--ink-color) !important;
  font-size: 0.9rem;
  font-weight: 600;
}

.dash-qa-item i {
  color: var(--accent-color);
  width: 1.15rem;
  text-align: center;
}

.dash-qa-item:hover,
.dash-qa-item:focus {
  background: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  color: #fff !important;
}

.dash-qa-item:hover i,
.dash-qa-item:focus i {
  color: #fff;
}

.dash-qa-item:active,
.dash-qa-menu .dropdown-item.active {
  background: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  color: #fff !important;
}

.chart-card,
.stat-card,
.custom-table-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  color: var(--ink-color);
}

.chart-card {
  padding: 24px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
}

.chart-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(253, 126, 20, 0.12);
  background-color: var(--stat-hover-bg);
}

.chart-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--chart-title-color);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  letter-spacing: -0.02em;
}

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-color);
  font-size: 1.05rem;
  line-height: 1;
}

.chart-title .icon-tile {
  width: 2rem;
  height: 2rem;
  margin-right: 10px;
  border-radius: 10px;
  font-size: 0.85rem;
}

.chart-card canvas {
  max-height: 230px;
}

.stat-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.55em;
  row-gap: 0.4em;
  align-items: center;
  align-content: start;
  min-height: 7.25rem;
  padding: 1rem 1.1rem 0.95rem;
  border: 1px solid var(--accent-color);
  transition: all 0.25s ease;
  text-decoration: none !important;
  color: inherit !important;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.stat-card .icon-tile {
  grid-column: 1;
  grid-row: 1;
  position: static;
  width: 1.65em;
  height: 1.65em;
  border: 0;
  border-radius: 0.42em;
  background: var(--accent-soft);
  color: var(--accent-color);
  font-size: 0.82em;
  box-shadow: none;
}

.stat-card .stat-label {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 1;
  min-width: 0;
  color: color-mix(in srgb, var(--chart-title-color) 78%, transparent);
  font-size: 0.84em;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-transform: none;
  white-space: nowrap;
}

.stat-card .stat-value {
  grid-column: 1 / -1;
  grid-row: 2;
  position: relative;
  z-index: 1;
  min-width: 0;
  font-size: 1.85em;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink-color);
  white-space: nowrap;
}

.dash-stats .stat-card .stat-label {
  white-space: normal;
}

.dash-stats .stat-card .stat-value {
  font-size: clamp(1.15rem, 1.55vw, 1.7rem);
}

.dash-stats .stat-card:has(.stat-trend) {
  min-height: 8.75rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.dash-stats .stat-card:has(.stat-trend) .icon-tile > i::after {
  display: none;
}

.dash-stats .stat-card:has(.stat-trend) .stat-label {
  grid-column: 2 / 4;
}

.dash-stats .stat-card:has(.stat-trend) .stat-value {
  grid-column: 1 / 3;
  align-self: end;
  padding-right: 0.65rem;
}

.stat-trend {
  display: contents;
}

.stat-spark {
  grid-column: 1 / -1;
  grid-row: 3;
  width: 100%;
  height: 2.15rem;
  margin-top: 0.35rem;
  display: block;
  overflow: visible;
}

.stat-trend-pct {
  grid-column: 3;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  position: static;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.stat-trend.is-up { color: #1fa97a; }
.stat-trend.is-down { color: #e15b54; }
.stat-trend.is-flat { color: #9a8b7e; }

[data-bs-theme="dark"] .stat-trend.is-up { color: #5ddec0; }
[data-bs-theme="dark"] .stat-trend.is-down { color: #ff8d86; }

.dash-split > [class*="col-"] {
  display: flex;
}

.dash-split > [class*="col-"] > .custom-table-card {
  width: 100%;
  height: 100%;
  margin-bottom: 0;
}

.dash-pair > [class*="col-"] {
  display: flex;
}

.dash-pair > [class*="col-"] > .custom-table-card {
  width: 100%;
  height: 100%;
  margin-bottom: 0;
}

.row.dash-optic-side {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr);
  gap: 1.5rem;
  margin-left: 0;
  margin-right: 0;
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}

.row.dash-optic-side > [class*="col-"] {
  display: contents;
  width: auto;
  max-width: none;
  padding: 0;
}

.row.dash-optic-side .custom-table-card.mb-4 {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 0 !important;
}

.row.dash-optic-side > .col-lg-8 > .custom-table-card:last-child {
  grid-column: 1;
  grid-row: 2;
}

.row.dash-optic-side .dash-mix-card {
  grid-column: 2;
  grid-row: 1;
  height: auto;
  align-self: stretch;
  margin-bottom: 0;
}

.row.dash-optic-side .dash-mix-chart {
  min-height: 0;
}

@media (max-width: 991.98px) {
  .row.dash-optic-side {
    grid-template-columns: 1fr;
  }

  .row.dash-optic-side .dash-mix-card {
    grid-column: 1;
    grid-row: 2;
  }

  .row.dash-optic-side > .col-lg-8 > .custom-table-card:last-child {
    grid-row: 3;
  }

  .row.dash-optic-side .dash-mix-chart {
    min-height: 14rem;
  }
}

.dash-mix-card {
  display: flex;
  flex-direction: column;
}

.dash-mix-chart {
  position: relative;
  flex: 1 1 auto;
  min-height: 16rem;
  margin-top: 0.35rem;
}

.dash-mix-chart canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-height: none;
}

.stat-card:not(:has(.icon-tile)) {
  grid-template-columns: minmax(0, 1fr);
}

.stat-card:not(:has(.icon-tile)) .stat-label,
.stat-card:not(:has(.icon-tile)) .stat-value {
  grid-column: 1;
}

.stat-card .icon-tile > i::after {
  position: absolute;
  right: 0.85rem;
  bottom: -0.85rem;
  z-index: 0;
  font-family: bootstrap-icons !important;
  font-style: normal;
  font-weight: normal !important;
  font-variant: normal;
  text-transform: none;
  font-size: 6.25rem;
  line-height: 1;
  color: var(--accent-color);
  opacity: 0.34;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
}

.stat-card:hover,
.stat-card:active {
  background-color: color-mix(in srgb, var(--accent-color) 62%, #3f2614);
  border-color: color-mix(in srgb, var(--accent-color) 48%, #3f2614);
  box-shadow: 0 12px 28px rgba(63, 38, 20, 0.28);
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-card:hover .stat-label,
.stat-card:active .stat-label,
.stat-card:hover .stat-value,
.stat-card:active .stat-value {
  color: #fff6ef;
}

.stat-card:hover .icon-tile,
.stat-card:active .icon-tile {
  background: color-mix(in srgb, #fff6ef 18%, transparent);
  color: #fff6ef;
}

.stat-card:hover .icon-tile > i::after,
.stat-card:active .icon-tile > i::after {
  color: #fff6ef;
  opacity: 0.22;
}

[data-bs-theme="dark"] .stat-card:hover,
[data-bs-theme="dark"] .stat-card:active {
  background-color: color-mix(in srgb, var(--accent-color) 62%, #3f2614) !important;
  border-color: color-mix(in srgb, var(--accent-color) 48%, #3f2614) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4) !important;
}

.stat-card .icon-tile .bi-archive::after { content: "\f10d"; }
.stat-card .icon-tile .bi-arrow-counterclockwise::after { content: "\f117"; }
.stat-card .icon-tile .bi-arrow-left::after { content: "\f12f"; }
.stat-card .icon-tile .bi-arrow-left-right::after { content: "\f12b"; }
.stat-card .icon-tile .bi-arrow-repeat::after { content: "\f130"; }
.stat-card .icon-tile .bi-arrow-return-left::after { content: "\f131"; }
.stat-card .icon-tile .bi-bag::after { content: "\f179"; }
.stat-card .icon-tile .bi-bank::after { content: "\f62e"; }
.stat-card .icon-tile .bi-bar-chart::after { content: "\f17e"; }
.stat-card .icon-tile .bi-bar-chart-line::after { content: "\f17c"; }
.stat-card .icon-tile .bi-bell::after { content: "\f18a"; }
.stat-card .icon-tile .bi-bell-slash::after { content: "\f631"; }
.stat-card .icon-tile .bi-book::after { content: "\f194"; }
.stat-card .icon-tile .bi-book-half::after { content: "\f193"; }
.stat-card .icon-tile .bi-box-arrow-in-down::after { content: "\f1bc"; }
.stat-card .icon-tile .bi-box-arrow-right::after { content: "\f1c3"; }
.stat-card .icon-tile .bi-box-arrow-up::after { content: "\f1c6"; }
.stat-card .icon-tile .bi-box-arrow-up-right::after { content: "\f1c5"; }
.stat-card .icon-tile .bi-box-seam::after { content: "\f1c7"; }
.stat-card .icon-tile .bi-building::after { content: "\f1dd"; }
.stat-card .icon-tile .bi-calculator::after { content: "\f1e0"; }
.stat-card .icon-tile .bi-calendar::after { content: "\f1f6"; }
.stat-card .icon-tile .bi-calendar-day::after { content: "\f1e6"; }
.stat-card .icon-tile .bi-calendar-week::after { content: "\f1f3"; }
.stat-card .icon-tile .bi-calendar2-heart::after { content: "\f712"; }
.stat-card .icon-tile .bi-calendar3::after { content: "\f214"; }
.stat-card .icon-tile .bi-camera::after { content: "\f220"; }
.stat-card .icon-tile .bi-cart-dash::after { content: "\f23c"; }
.stat-card .icon-tile .bi-cart-plus::after { content: "\f23f"; }
.stat-card .icon-tile .bi-cart3::after { content: "\f244"; }
.stat-card .icon-tile .bi-cash::after { content: "\f247"; }
.stat-card .icon-tile .bi-cash-coin::after { content: "\f632"; }
.stat-card .icon-tile .bi-cash-stack::after { content: "\f246"; }
.stat-card .icon-tile .bi-chat-left-text::after { content: "\f252"; }
.stat-card .icon-tile .bi-check-circle-fill::after { content: "\f26a"; }
.stat-card .icon-tile .bi-check-lg::after { content: "\f633"; }
.stat-card .icon-tile .bi-check2::after { content: "\f272"; }
.stat-card .icon-tile .bi-check2-circle::after { content: "\f270"; }
.stat-card .icon-tile .bi-check2-square::after { content: "\f271"; }
.stat-card .icon-tile .bi-chevron-double-down::after { content: "\f27e"; }
.stat-card .icon-tile .bi-chevron-double-up::after { content: "\f281"; }
.stat-card .icon-tile .bi-chevron-down::after { content: "\f282"; }
.stat-card .icon-tile .bi-clipboard-data::after { content: "\f28c"; }
.stat-card .icon-tile .bi-clipboard2-pulse::after { content: "\f730"; }
.stat-card .icon-tile .bi-clock::after { content: "\f293"; }
.stat-card .icon-tile .bi-clock-history::after { content: "\f292"; }
.stat-card .icon-tile .bi-credit-card::after { content: "\f2dc"; }
.stat-card .icon-tile .bi-currency-euro::after { content: "\f637"; }
.stat-card .icon-tile .bi-currency-exchange::after { content: "\f638"; }
.stat-card .icon-tile .bi-dash-circle::after { content: "\f2e6"; }
.stat-card .icon-tile .bi-diagram-3::after { content: "\f2ee"; }
.stat-card .icon-tile .bi-display::after { content: "\f302"; }
.stat-card .icon-tile .bi-download::after { content: "\f30a"; }
.stat-card .icon-tile .bi-envelope::after { content: "\f32f"; }
.stat-card .icon-tile .bi-envelope-open::after { content: "\f32e"; }
.stat-card .icon-tile .bi-exclamation-circle::after { content: "\f333"; }
.stat-card .icon-tile .bi-exclamation-triangle::after { content: "\f33b"; }
.stat-card .icon-tile .bi-exclamation-triangle-fill::after { content: "\f33a"; }
.stat-card .icon-tile .bi-file-earmark-minus::after { content: "\f375"; }
.stat-card .icon-tile .bi-file-earmark-pdf::after { content: "\f63e"; }
.stat-card .icon-tile .bi-file-earmark-plus::after { content: "\f37d"; }
.stat-card .icon-tile .bi-gear::after { content: "\f3e5"; }
.stat-card .icon-tile .bi-gear-wide-connected::after { content: "\f3e3"; }
.stat-card .icon-tile .bi-geo-alt::after { content: "\f3e8"; }
.stat-card .icon-tile .bi-graph-down::after { content: "\f3f1"; }
.stat-card .icon-tile .bi-graph-down-arrow::after { content: "\f672"; }
.stat-card .icon-tile .bi-graph-up::after { content: "\f3f2"; }
.stat-card .icon-tile .bi-graph-up-arrow::after { content: "\f673"; }
.stat-card .icon-tile .bi-heart-pulse::after { content: "\f76f"; }
.stat-card .icon-tile .bi-hospital::after { content: "\f774"; }
.stat-card .icon-tile .bi-hourglass-split::after { content: "\f41f"; }
.stat-card .icon-tile .bi-house-fill::after { content: "\f424"; }
.stat-card .icon-tile .bi-info-circle::after { content: "\f431"; }
.stat-card .icon-tile .bi-journal-bookmark::after { content: "\f43d"; }
.stat-card .icon-tile .bi-journal-text::after { content: "\f444"; }
.stat-card .icon-tile .bi-journals::after { content: "\f447"; }
.stat-card .icon-tile .bi-key::after { content: "\f44f"; }
.stat-card .icon-tile .bi-layout-sidebar::after { content: "\f45f"; }
.stat-card .icon-tile .bi-layout-sidebar-inset::after { content: "\f45d"; }
.stat-card .icon-tile .bi-lightbulb-fill::after { content: "\f468"; }
.stat-card .icon-tile .bi-lightning-charge::after { content: "\f46d"; }
.stat-card .icon-tile .bi-link-45deg::after { content: "\f470"; }
.stat-card .icon-tile .bi-list::after { content: "\f479"; }
.stat-card .icon-tile .bi-list-check::after { content: "\f473"; }
.stat-card .icon-tile .bi-list-ol::after { content: "\f475"; }
.stat-card .icon-tile .bi-list-ul::after { content: "\f478"; }
.stat-card .icon-tile .bi-moon-stars-fill::after { content: "\f495"; }
.stat-card .icon-tile .bi-pencil::after { content: "\f4cb"; }
.stat-card .icon-tile .bi-people::after { content: "\f4d0"; }
.stat-card .icon-tile .bi-percent::after { content: "\f4d1"; }
.stat-card .icon-tile .bi-person::after { content: "\f4e1"; }
.stat-card .icon-tile .bi-person-badge::after { content: "\f4d3"; }
.stat-card .icon-tile .bi-person-gear::after { content: "\f8a7"; }
.stat-card .icon-tile .bi-person-lines-fill::after { content: "\f4db"; }
.stat-card .icon-tile .bi-person-plus::after { content: "\f4dd"; }
.stat-card .icon-tile .bi-pie-chart::after { content: "\f4e9"; }
.stat-card .icon-tile .bi-plus-circle::after { content: "\f4fa"; }
.stat-card .icon-tile .bi-printer::after { content: "\f501"; }
.stat-card .icon-tile .bi-receipt::after { content: "\f50f"; }
.stat-card .icon-tile .bi-receipt-cutoff::after { content: "\f50e"; }
.stat-card .icon-tile .bi-search::after { content: "\f52a"; }
.stat-card .icon-tile .bi-send::after { content: "\f6c0"; }
.stat-card .icon-tile .bi-shop::after { content: "\f543"; }
.stat-card .icon-tile .bi-sliders::after { content: "\f56b"; }
.stat-card .icon-tile .bi-sort-down::after { content: "\f575"; }
.stat-card .icon-tile .bi-speedometer2::after { content: "\f580"; }
.stat-card .icon-tile .bi-table::after { content: "\f5aa"; }
.stat-card .icon-tile .bi-telephone::after { content: "\f5c1"; }
.stat-card .icon-tile .bi-three-dots-vertical::after { content: "\f5d3"; }
.stat-card .icon-tile .bi-trash::after { content: "\f5de"; }
.stat-card .icon-tile .bi-truck::after { content: "\f5ea"; }
.stat-card .icon-tile .bi-wallet2::after { content: "\f615"; }
.stat-card .icon-tile .bi-x-circle::after { content: "\f623"; }
.stat-card .icon-tile .bi-x-lg::after { content: "\f659"; }

.custom-table-card {
  padding: 22px;
}

.custom-table-card h5 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink-color);
  letter-spacing: -0.02em;
}

.custom-table-card h5 .icon-tile {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  font-size: 0.85rem;
}

.custom-table-card .text-muted {
  color: var(--muted-ink) !important;
}

.custom-table-card .table {
  margin-bottom: 0;
}

.custom-table-card .table thead th {
  background: transparent;
  border-top: none;
  border-bottom: 1px solid var(--table-border);
  text-transform: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--table-head-color);
  padding: 0.65rem 0.75rem;
}

.custom-table-card .table td {
  padding: 0.9rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--table-border);
  color: var(--ink-color);
  background: transparent;
}

.custom-table-card .table tbody tr:last-child td {
  border-bottom: none;
}

.row-link {
  text-decoration: none;
  color: var(--ink-color);
  font-weight: 600;
}

.row-link:hover {
  text-decoration: underline;
  color: var(--ink-color);
}

[data-bs-theme="dark"] .dash-qa-item {
  background: rgba(253, 126, 20, 0.12) !important;
  color: var(--ink-color) !important;
}

[data-bs-theme="dark"] .dash-qa-menu {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55) !important;
}

[data-bs-theme="dark"] .chart-card:hover {
  border-color: rgba(253, 126, 20, 0.42);
  box-shadow: 0 12px 32px rgba(253, 126, 20, 0.12), 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .custom-table-card .table,
[data-bs-theme="dark"] .custom-table-card .table thead,
[data-bs-theme="dark"] .custom-table-card .table thead th,
[data-bs-theme="dark"] .custom-table-card .table td,
[data-bs-theme="dark"] .custom-table-card .table > :not(caption) > * > * {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--ink-color);
  border-color: var(--table-border);
}

[data-bs-theme="dark"] .custom-table-card .table thead th {
  color: var(--table-head-color) !important;
}

[data-bs-theme="dark"] .row-link {
  color: var(--ink-color);
}

[data-bs-theme="dark"] .status-pill {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.48);
  color: #f4f4f5;
}

[data-bs-theme="dark"] .status-pill.is-active,
[data-bs-theme="dark"] .status-pill.is-paid,
[data-bs-theme="dark"] .status-pill.is-credit,
[data-bs-theme="dark"] .status-pill.is-overpaid {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.45);
  color: #4ade80;
}

[data-bs-theme="dark"] .status-pill.is-passive,
[data-bs-theme="dark"] .status-pill.is-unpaid,
[data-bs-theme="dark"] .status-pill.is-debt {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.45);
  color: #f87171;
}

[data-bs-theme="dark"] .status-pill.is-warn {
  background: rgba(253, 126, 20, 0.16);
  border-color: rgba(255, 179, 107, 0.45);
  color: #ffb36b;
}

[data-bs-theme="dark"] .status-pill[data-category="goods" i] {
  background: rgba(253, 126, 20, 0.16);
  border-color: rgba(255, 179, 107, 0.45);
  color: #ffb36b;
}

[data-bs-theme="dark"] .status-pill[data-category="tax" i] {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(147, 197, 253, 0.42);
  color: #93c5fd;
}

[data-bs-theme="dark"] .status-pill[data-category="expense" i] {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(252, 165, 165, 0.42);
  color: #fca5a5;
}

[data-bs-theme="dark"] .status-pill[data-category="investment" i] {
  background: rgba(45, 212, 191, 0.14);
  border-color: rgba(94, 234, 212, 0.4);
  color: #5eead4;
}

[data-bs-theme="dark"] .status-pill[data-category="service" i] {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(125, 211, 252, 0.4);
  color: #7dd3fc;
}

[data-bs-theme="dark"] .status-pill[data-category="other" i] {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  color: #d4d4d8;
}

[data-bs-theme="dark"] .status-pill[data-role="1"] {
  background: rgba(253, 126, 20, 0.18);
  border-color: rgba(255, 179, 107, 0.48);
  color: #ffb36b;
}

[data-bs-theme="dark"] .status-pill[data-role="2"] {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(252, 211, 77, 0.42);
  color: #fcd34d;
}

[data-bs-theme="dark"] .status-pill[data-role="3"] {
  background: rgba(45, 212, 191, 0.14);
  border-color: rgba(94, 234, 212, 0.4);
  color: #5eead4;
}

[data-bs-theme="dark"] .status-pill[data-role="4"] {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.45);
  color: #4ade80;
}

[data-bs-theme="dark"] .status-pill[data-role="5"] {
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(103, 232, 249, 0.4);
  color: #67e8f9;
}

[data-bs-theme="dark"] .status-pill[data-role="6"] {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(147, 197, 253, 0.42);
  color: #93c5fd;
}

[data-bs-theme="dark"] .status-pill[data-role="7"] {
  background: rgba(167, 139, 250, 0.16);
  border-color: rgba(196, 181, 253, 0.42);
  color: #c4b5fd;
}

[data-bs-theme="dark"] .status-pill[data-role="8"] {
  background: rgba(244, 114, 182, 0.16);
  border-color: rgba(249, 168, 212, 0.42);
  color: #f9a8d4;
}

[data-bs-theme="dark"] .status-pill[data-role="9"] {
  background: rgba(129, 140, 248, 0.16);
  border-color: rgba(165, 180, 252, 0.42);
  color: #a5b4fc;
}

[data-bs-theme="dark"] table.tabela td.row-actions > a,
[data-bs-theme="dark"] table.table td.row-actions > a,
[data-bs-theme="dark"] table.tabela td.row-actions > button,
[data-bs-theme="dark"] table.table td.row-actions > button {
  border-color: var(--accent-color);
  background: transparent;
  color: var(--accent-color) !important;
}

[data-bs-theme="dark"] table.tabela td.row-actions > a:hover,
[data-bs-theme="dark"] table.tabela td.row-actions > a:focus,
[data-bs-theme="dark"] table.table td.row-actions > a:hover,
[data-bs-theme="dark"] table.table td.row-actions > a:focus,
[data-bs-theme="dark"] table.tabela td.row-actions > button:hover,
[data-bs-theme="dark"] table.tabela td.row-actions > button:focus,
[data-bs-theme="dark"] table.table td.row-actions > button:hover,
[data-bs-theme="dark"] table.table td.row-actions > button:focus {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: #fff !important;
}

[data-bs-theme="dark"] table.tabela td.row-actions > a.clinic-icon-btn,
[data-bs-theme="dark"] table.table td.row-actions > a.clinic-icon-btn,
[data-bs-theme="dark"] .clinic-icon-btn {
  background: transparent;
  color: var(--accent-color) !important;
}

[data-bs-theme="dark"] table.tabela td.row-actions > a.clinic-icon-btn:hover,
[data-bs-theme="dark"] table.tabela td.row-actions > a.clinic-icon-btn:focus,
[data-bs-theme="dark"] table.table td.row-actions > a.clinic-icon-btn:hover,
[data-bs-theme="dark"] table.table td.row-actions > a.clinic-icon-btn:focus,
[data-bs-theme="dark"] .clinic-icon-btn:hover,
[data-bs-theme="dark"] .clinic-icon-btn:focus {
  background: var(--accent-color);
  color: #fff !important;
}

[data-bs-theme="dark"] table.tabela td.row-actions > a.is-danger,
[data-bs-theme="dark"] table.table td.row-actions > a.is-danger,
[data-bs-theme="dark"] table.tabela td.row-actions > button.is-danger,
[data-bs-theme="dark"] table.table td.row-actions > button.is-danger {
  border-color: #ef4444;
  background: transparent;
  color: #ef4444 !important;
}

[data-bs-theme="dark"] table.tabela td.row-actions > a.is-danger:hover,
[data-bs-theme="dark"] table.tabela td.row-actions > a.is-danger:focus,
[data-bs-theme="dark"] table.table td.row-actions > a.is-danger:hover,
[data-bs-theme="dark"] table.table td.row-actions > a.is-danger:focus,
[data-bs-theme="dark"] table.tabela td.row-actions > button.is-danger:hover,
[data-bs-theme="dark"] table.tabela td.row-actions > button.is-danger:focus,
[data-bs-theme="dark"] table.table td.row-actions > button.is-danger:hover,
[data-bs-theme="dark"] table.table td.row-actions > button.is-danger:focus {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff !important;
}

[data-bs-theme="dark"] .taxonomy-page table.tabela td.row-actions .clinic-row-actions > button {
  border-color: var(--accent-color);
  background: transparent;
  color: var(--accent-color) !important;
}

[data-bs-theme="dark"] .taxonomy-page table.tabela td.row-actions .clinic-row-actions > button:hover,
[data-bs-theme="dark"] .taxonomy-page table.tabela td.row-actions .clinic-row-actions > button:focus {
  background: var(--accent-color);
  color: #fff !important;
}

[data-bs-theme="dark"] .taxonomy-page table.tabela td.row-actions .clinic-row-actions > button.is-danger {
  border-color: #ef4444;
  background: transparent;
  color: #ef4444 !important;
}

[data-bs-theme="dark"] .taxonomy-page table.tabela td.row-actions .clinic-row-actions > button.is-danger:hover,
[data-bs-theme="dark"] .taxonomy-page table.tabela td.row-actions .clinic-row-actions > button.is-danger:focus {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff !important;
}

.split-wrap {
  container-type: inline-size;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: 1rem;
  align-items: start;
}

.split-panel {
  background: var(--card-bg);
  border: 1px solid var(--table-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 1.1rem 1.15rem 1.2rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.split-panel h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem;
}

.split-panel .panel-quiet {
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.92rem;
}

.split-panel .form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-ink);
  margin-bottom: 0.25rem;
}

table.tabela tbody tr.is-selected td {
  background: var(--accent-soft);
}

.row-edit {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.row-edit .form-control,
.row-edit .form-select {
  min-width: 8rem;
}

@container (max-width: 52rem) {
  .split {
    grid-template-columns: 1fr;
  }

  .split-panel {
    position: static;
    max-height: none;
  }
}

@container (min-width: 52.0625rem) and (max-width: 68rem) {
  .split .split-hide {
    display: none;
  }
}

@supports not (container-type: inline-size) {
  @media (max-width: 1199.98px) {
    .split {
      grid-template-columns: 1fr;
    }

    .split-panel {
      position: static;
      max-height: none;
    }
  }
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1060;
  background: rgba(61, 46, 34, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

html:has(.cost-recalc:not([hidden])) {
  overflow: hidden;
}

.cost-recalc {
  position: fixed;
  inset: 0;
  z-index: 1070;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(12, 12, 15, 0.55);
}

.cost-recalc[hidden] {
  display: none !important;
}

.cost-recalc-card {
  width: min(32rem, 100%);
  max-height: min(70vh, 36rem);
  overflow: auto;
  background: var(--card-bg);
  color: var(--ink-color);
  border: 1px solid var(--table-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 1.25rem 1.35rem 1.15rem;
}

.cost-recalc-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.cost-recalc-card p,
.cost-recalc-note {
  margin: 0 0 1rem;
  color: var(--muted-ink);
  font-size: 0.92rem;
}

.cost-recalc-table {
  margin-bottom: 1rem;
  max-height: 14rem;
  overflow: auto;
  border: 1px solid var(--table-border);
  border-radius: 12px;
}

.cost-recalc-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.cost-recalc-table th,
.cost-recalc-table td {
  padding: 0.45rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--table-border);
}

.cost-recalc-table th {
  color: var(--table-head-color);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cost-recalc-card form,
.payment-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

#payment-confirm {
  z-index: 1080;
}

#payment-confirm-title {
  color: var(--accent-color);
  font-size: 1.35rem;
  font-weight: 700;
}

#payment-confirm-body .payment-confirm-note {
  margin: 0 0 0.95rem;
  color: var(--muted-ink);
  font-size: 0.92rem;
  line-height: 1.4;
}

#payment-confirm-body .payment-confirm-totals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1.25rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--table-border);
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--ink-color) 3%, var(--card-bg));
}

#payment-confirm-body .payment-confirm-totals dt,
#payment-confirm-body .payment-confirm-totals dd {
  margin: 0;
}

#payment-confirm-body .payment-confirm-totals dt {
  color: var(--muted-ink);
  font-size: 0.82rem;
}

#payment-confirm-body .payment-confirm-totals dd {
  text-align: right;
  font-size: 0.95rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

#payment-confirm-body .payment-confirm-totals .is-diff {
  color: var(--accent-color);
  padding-top: 0.45rem;
  border-top: 1px solid var(--table-border);
}

#payment-confirm-body .payment-confirm-ask {
  margin: 0 0 1.15rem;
  color: var(--ink-color);
  font-size: 0.95rem;
  font-weight: 650;
}

/* The panel covers the page, so the window bar stays hidden until it closes. */
html:has(.drawer.is-open) {
  overflow: hidden;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1061;
  width: min(100%, 28rem);
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  color: var(--ink-color);
  border-left: 1px solid var(--table-border);
  box-shadow: -16px 0 40px rgba(61, 46, 34, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  overflow: hidden;
  padding-bottom: 1.15rem;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer.is-wide {
  width: min(720px, 92vw);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem 0.35rem;
}

.drawer-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-ink);
  font-size: 1rem;
}

.drawer-close:hover,
.drawer-close:focus {
  background: var(--accent-soft);
  color: var(--ink-color);
}

.drawer form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  padding: 0.6rem 0 0;
}

.drawer-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0.85rem 0.4rem 1.35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-scrollbar-thumb) var(--card-bg);
}

.drawer-fields::-webkit-scrollbar {
  width: var(--sidebar-scrollbar-size, 8px);
}

.drawer-fields::-webkit-scrollbar-track {
  background: var(--card-bg);
}

.drawer-fields::-webkit-scrollbar-thumb {
  background: var(--sidebar-scrollbar-thumb, rgba(253, 126, 20, 0.55));
  border-radius: 999px;
}

.drawer-fields::-webkit-scrollbar-thumb:hover {
  background: var(--sidebar-scrollbar-thumb-hover, rgba(253, 126, 20, 0.75));
}

.drawer-fields .is-wide {
  grid-column: 1 / -1;
}

#bank-drawer .bank-gl-row:has(#bank-status-view:not([hidden])) {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 2fr);
  gap: 0.85rem 1rem;
  align-items: start;
}

#bank-drawer #bank-status-view > div {
  display: flex;
  align-items: center;
  min-height: 2.45rem;
}

#bank-drawer #bank-status-badge.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.45rem;
  padding: 0.4rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.gender-choice {
  display: flex;
  width: 100%;
  min-height: 2.45rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: var(--bs-body-bg);
}

.gender-choice button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 2.45rem;
  margin: 0;
  padding: 0.45rem 0.5rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-color);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.gender-choice button + button {
  border-left: 1px solid var(--bs-border-color);
}

.gender-choice button:hover,
.gender-choice button:focus-visible {
  background: color-mix(in srgb, var(--accent-color) 14%, transparent);
  color: var(--accent-color);
  outline: none;
}

.gender-choice button.is-on,
.gender-choice button.is-on:hover,
.gender-choice button.is-on:focus-visible {
  background: var(--accent-color);
  color: #fff;
}

.gender-choice button:disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.blood-choice {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  width: 100%;
}

.blood-choice-types,
.blood-choice-sign {
  display: flex;
  min-height: 2.45rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: var(--bs-body-bg);
}

.blood-choice-types {
  flex: 1 1 auto;
}

.blood-choice-sign {
  flex: 0 0 7.5rem;
}

.blood-choice button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 2.45rem;
  margin: 0;
  padding: 0.45rem 0.35rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-color);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.blood-choice button + button {
  border-left: 1px solid var(--bs-border-color);
}

.blood-choice button:hover,
.blood-choice button:focus-visible {
  background: color-mix(in srgb, var(--accent-color) 14%, transparent);
  color: var(--accent-color);
  outline: none;
}

.blood-choice button.is-on,
.blood-choice button.is-on:hover,
.blood-choice button.is-on:focus-visible {
  background: var(--accent-color);
  color: #fff;
}

.drawer-section h3 {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-ink);
}

.drawer-section + .drawer-section {
  margin-top: 0.35rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--table-border);
}

.drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

.drawer-grid .is-wide {
  grid-column: 1 / -1;
}

.drawer .form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-ink);
  margin-bottom: 0.25rem;
}

label .req-star,
.form-label .req-star {
  color: #e03131 !important;
  font-weight: 700;
}

.drawer-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.9rem 1.35rem 0;
  background: var(--card-bg);
}

.drawer-foot > :is([data-drawer-close], [data-modal-close], [id$="-cancel"]),
.modal .page-actions > :is([data-modal-close], [id$="-cancel"]),
.clinic-lifecycle-actions > #clinic-lifecycle-cancel,
.payment-confirm-actions > #payment-confirm-cancel,
.doc-dialog-actions > [data-dialog-cancel] {
  order: -1;
}

[data-bs-theme="dark"] .drawer-backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.app-content > main:has(:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #payment-drawer).is-page) > .container,
.app-content > main:has(:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #payment-drawer).is-page) > .container-fluid {
  display: none !important;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer).is-view .invoice-line-remove,
:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer).is-view .invoice-lines-actions {
  display: none;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer).is-view .invoice-paid {
  pointer-events: none;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
}

:is(#expense-drawer, #credit-drawer, #debit-drawer) .drawer-section:first-of-type .drawer-grid {
  grid-template-columns: 12.5rem minmax(14rem, 18rem) 11.5rem 11.5rem;
  justify-content: start;
}

#invoice-drawer .drawer-section:first-of-type .drawer-grid {
  grid-template-columns: minmax(7.5rem, 0.75fr) minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(8.75rem, 0.9fr) minmax(8.75rem, 0.9fr);
  justify-content: stretch;
  width: 100%;
}

#return-drawer .drawer-section:first-of-type .drawer-grid {
  grid-template-columns: minmax(14.5rem, 1.15fr) minmax(7.5rem, 0.65fr) minmax(8.75rem, 0.8fr) minmax(0, 1.2fr) minmax(0, 1.35fr);
  justify-content: stretch;
  width: 100%;
}

@media (min-width: 768px) {
  #return-drawer {
    width: min(96vw, 88rem);
  }
}

.invoice-suggest.is-floating {
  position: fixed;
  z-index: 1200;
  right: auto;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--card-bg);
  border: 1px solid var(--table-border);
  border-radius: 0.85rem;
  box-shadow: var(--card-shadow);
  overflow: auto;
}

.invoice-suggest.is-floating li {
  padding: 0.45rem 0.7rem;
  border-radius: 0.55rem;
  cursor: pointer;
  color: var(--ink-color);
}

.invoice-suggest.is-floating li.is-active,
.invoice-suggest.is-floating li:hover {
  background: color-mix(in srgb, var(--accent-color) 48%, var(--card-bg));
  color: #fff;
}

:is(#credit-drawer, #debit-drawer) .drawer-section:first-of-type .drawer-grid {
  grid-template-columns: 12.5rem 11.5rem minmax(18rem, 1fr) minmax(18rem, 1fr);
}

#expense-drawer .drawer-section:first-of-type .drawer-grid {
  grid-template-columns: minmax(12rem, 1fr) minmax(12rem, 1fr) minmax(12rem, 1fr) minmax(20rem, 1.8fr);
  justify-content: stretch;
  align-items: stretch;
  width: 100%;
}

#expense-drawer .expense-description-box {
  grid-column: 4;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#expense-drawer .expense-description-box textarea {
  flex: 1 1 auto;
  min-height: 5.6rem;
  resize: none;
}

#expense-drawer .expense-status-grid {
  grid-template-columns: repeat(4, max-content);
  justify-content: start;
  gap: 0.65rem 2.5rem;
}

#expense-drawer .expense-payments-box {
  flex: 1 1 auto;
  min-width: 0;
}

#credit-drawer .credit-direct-grid,
#debit-drawer .debit-direct-grid {
  grid-template-columns: 12.5rem 11.5rem;
  justify-content: start;
}

#payment-drawer .payment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "date ."
    "type party"
    "invoices invoices"
    "currency amount"
    "method account"
    "desc desc"
    "warn warn";
  gap: 0.75rem 0.85rem;
  justify-content: stretch;
  align-items: start;
  width: 100%;
}

#payment-drawer .payment-grid .is-date { grid-area: date; }
#payment-drawer .payment-grid .is-amount { grid-area: amount; }
#payment-drawer .payment-grid .is-currency { grid-area: currency; }
#payment-drawer .payment-grid .is-type { grid-area: type; }
#payment-drawer .payment-grid .is-method { grid-area: method; }
#payment-drawer .payment-grid .is-party { grid-area: party; }
#payment-drawer .payment-grid .is-account { grid-area: account; }
#payment-drawer .payment-grid .is-invoices { grid-area: invoices; }
#payment-drawer .payment-grid .is-wide {
  grid-area: desc;
  max-width: none;
}

#payment-drawer .payment-grid .invoice-vat {
  width: 100%;
  min-height: 2.45rem;
}

#payment-drawer .is-muted .form-control,
#payment-drawer .is-muted .payment-select-btn,
#payment-drawer .form-control:disabled,
#payment-drawer .payment-select-btn:disabled {
  opacity: 0.55;
  color: var(--muted-ink) !important;
  cursor: not-allowed;
}

#payment-drawer .payment-select {
  position: relative;
}

#payment-drawer .payment-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#payment-drawer .payment-select-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.45rem;
  text-align: left;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%233d2e22' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.75rem;
  padding-right: 2.1rem;
}

[data-bs-theme="dark"] #payment-drawer .payment-select-btn {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23f0c4a0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}

#payment-drawer .payment-select-btn.is-empty {
  color: var(--muted-ink);
}

#payment-drawer.is-view .payment-select-btn,
#payment-drawer .payment-select-btn:disabled {
  background-image: none;
  padding-right: 0.9rem;
}

#payment-drawer .payment-select .invoice-suggest {
  z-index: 8;
}

#payment-drawer .payment-grid textarea.form-control {
  min-height: 7.5rem;
  height: 7.5rem;
  resize: vertical;
}

#payment-drawer .payment-currency-warn {
  grid-area: warn;
  margin: 0;
  color: #d31212;
  font-size: 0.8rem;
  font-weight: 600;
}

#payment-drawer .payment-invoice-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 14rem;
  overflow: auto;
}

#payment-drawer .payment-invoice-heading {
  display: block;
  margin: 0 0 0.15rem;
  color: var(--muted-ink);
  font-size: 0.75rem;
  font-weight: 650;
}

#payment-drawer .payment-invoice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.4rem;
  gap: 0.55rem;
  align-items: center;
  min-height: 3.7rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--table-border);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--ink-color) 3%, var(--card-bg));
}

#payment-drawer .payment-invoice-pick {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  margin: 0;
}

#payment-drawer .payment-invoice-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#payment-drawer .payment-invoice-copy strong {
  color: var(--ink-color);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.25;
}

#payment-drawer .payment-invoice-copy small {
  color: var(--muted-ink);
  font-size: 0.72rem;
}

#payment-drawer .invoice-alloc-div {
  display: block;
}

#payment-drawer .payment-invoice-list .invoice-allocation-input {
  width: 100%;
  max-width: none;
  min-height: 2.1rem;
  padding: 0.3rem 0.5rem;
}

#payment-drawer .payment-invoice-list .invoice-allocation-input:disabled {
  opacity: 0.45;
}

#payment-drawer .payment-invoices-empty {
  margin: 0;
  color: var(--muted-ink);
}

#payment-drawer.is-view .invoice-vat,
#payment-drawer.is-view .payment-invoice-list input,
#payment-drawer.is-view .payment-invoice-list label {
  pointer-events: none;
}

#payment-drawer.is-view .payment-invoice-heading,
#payment-drawer.is-view .payment-invoice-row:not(:has(.linked-invoice-checkbox:checked)),
#payment-drawer.is-view .linked-invoice-checkbox {
  display: none;
}

#payment-drawer.is-view .payment-invoice-row:has(.linked-invoice-checkbox:checked) {
  grid-template-columns: minmax(0, 1fr) auto;
}

#payment-drawer.is-view .invoice-alloc-div {
  display: block !important;
}

#PaymentsTable th:nth-child(4),
#PaymentsTable td:nth-child(4) {
  width: 28%;
}

#CreditNotesTable,
#DebitNotesTable,
#PaymentsTable {
  width: 100%;
  table-layout: auto;
}

#CreditNotesTable th:nth-child(4),
#CreditNotesTable td:nth-child(4),
#DebitNotesTable th:nth-child(4),
#DebitNotesTable td:nth-child(4) {
  width: 42%;
}

#purchase-drawer .drawer-section:first-of-type .drawer-grid {
  grid-template-columns: minmax(7.5rem, 0.7fr) minmax(0, 1.35fr) minmax(0, 1.15fr) minmax(8.75rem, 0.85fr) minmax(8.75rem, 0.85fr);
  justify-content: stretch;
  width: 100%;
}

:is(#invoice-drawer, #purchase-drawer, #expense-drawer) .drawer-section:first-of-type .drawer-grid .is-wide {
  grid-column: span 2;
  max-width: 34rem;
}

#import-drawer .drawer-section:first-of-type .drawer-grid {
  grid-template-columns: minmax(8rem, 0.85fr) minmax(0, 1.15fr) minmax(0, 1.4fr) minmax(0, 1.15fr);
  justify-content: stretch;
  width: 100%;
}

#import-drawer .import-currency {
  width: 16rem;
  max-width: 16rem;
}

#import-drawer .import-declared-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-summary {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-summary.is-lined,
:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-record {
  padding-right: calc(4.4rem + 0.4rem);
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-note-box,
:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-totals-box {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-note-box {
  flex: 1 1 auto;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-note-box textarea {
  flex: 1 1 auto;
  min-height: 9.25rem;
  height: 100%;
  resize: none;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-totals-box {
  flex: 0 0 auto;
  margin-left: auto;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-totals-box .invoice-totals,
:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer) .invoice-totals {
  width: max-content;
  min-width: 18rem;
  margin-left: auto;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-totals div {
  justify-content: flex-start;
  gap: 1.25rem;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-totals span {
  flex: 1 1 auto;
  text-align: right;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-totals output {
  min-width: 5.5rem;
  text-align: right;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-record {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-record .invoice-meta-grid {
  grid-template-columns: repeat(2, max-content);
  justify-content: end;
  margin-left: auto;
  gap: 0.65rem 2rem;
}

.drawer.is-view input[type="date"],
.drawer.is-view .clinic-date {
  pointer-events: none;
  caret-color: transparent;
}

.drawer.is-view input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
  pointer-events: none;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-meta-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--muted-ink);
  font-size: 0.78rem;
  font-weight: 600;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-meta-grid output {
  color: var(--ink-color);
  font-size: 0.9rem;
  font-weight: 650;
}

/* Edit / secondary actions — all clinic drawers (incl. HR) */
.drawer .btn-invoice-action,
:is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer, #invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .btn-invoice-action {
  border-color: var(--accent-color) !important;
  background: var(--btn-secondary-bg) !important;
  color: var(--ink-color) !important;
}

.drawer .btn-invoice-action:hover,
.drawer .btn-invoice-action:focus,
.drawer .btn-invoice-action:active,
:is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer, #invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .btn-invoice-action:hover,
:is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer, #invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .btn-invoice-action:focus,
:is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer, #invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .btn-invoice-action:active {
  border-color: var(--accent-color) !important;
  background: var(--btn-secondary-hover-bg) !important;
  color: var(--ink-color) !important;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-lookup {
  position: relative;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-suggest {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% - 0.15rem);
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--card-bg);
  border: 1px solid var(--table-border);
  border-radius: 0.85rem;
  box-shadow: var(--card-shadow);
  max-height: 14rem;
  overflow: auto;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-suggest li {
  padding: 0.45rem 0.7rem;
  border-radius: 0.55rem;
  cursor: pointer;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-suggest li.is-active,
:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-suggest li:hover {
  background: color-mix(in srgb, var(--accent-color) 48%, var(--card-bg));
  color: #fff;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line {
  border: 1px solid var(--table-border);
  border-radius: 1rem;
  padding: 0.85rem 0.9rem 0.75rem;
  background: color-mix(in srgb, var(--ink-color) 4%, var(--card-bg));
  margin-bottom: 0.75rem;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-no {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-ink);
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-remove {
  border: 0;
  background: transparent;
  color: #d31212;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0;
}

[data-bs-theme="dark"] :is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-remove {
  color: #ff3b30;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.7rem;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-grid .is-wide {
  grid-column: 1 / -1;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.7rem;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-figures {
  padding-top: 0.7rem;
  border-top: 1px solid var(--table-border);
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-figures label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.72rem;
  font-weight: 600;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-figures input {
  border: 0;
  background: transparent;
  color: var(--ink-color);
  font-weight: 650;
  padding: 0;
  width: 100%;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-vat {
  display: flex;
  min-height: 2.45rem;
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--btn-secondary-bg);
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-vat button {
  flex: 1 1 0;
  border: 0;
  background: transparent;
  color: var(--ink-color);
  font-size: 0.85rem;
  font-weight: 600;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-vat button.is-on {
  background: var(--accent-color);
  color: #fff;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-totals {
  display: grid;
  gap: 0.4rem;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-totals div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted-ink);
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-totals output {
  color: var(--ink-color);
  font-weight: 650;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-totals .is-final {
  margin-top: 0.25rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--table-border);
  color: var(--ink-color);
  font-weight: 700;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .form-control {
  background-color: var(--btn-secondary-bg) !important;
  color: var(--ink-color) !important;
  border-color: var(--btn-secondary-border) !important;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .form-control::placeholder {
  color: var(--muted-ink);
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) input[type="date"]::-webkit-datetime-edit,
:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) input[type="date"]::-webkit-datetime-edit-fields-wrapper,
:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) input[type="date"]::-webkit-datetime-edit-text,
:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) input[type="date"]::-webkit-datetime-edit-month-field,
:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) input[type="date"]::-webkit-datetime-edit-day-field,
:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) input[type="date"]::-webkit-datetime-edit-year-field {
  background: transparent;
  color: inherit;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.7;
  cursor: pointer;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-lines-actions {
  display: flex;
  justify-content: flex-end;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-lines-wrap {
  overflow: visible;
}

:is(#invoice-drawer, #purchase-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-lines-table {
  min-width: 74rem;
}

#import-drawer .invoice-lines-table.is-import {
  min-width: 78rem;
}

:is(#invoice-drawer, #purchase-drawer, #expense-drawer) .invoice-lines-table.is-expense {
  min-width: 58rem;
}

:is(#invoice-drawer, #purchase-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-lines-head,
:is(#invoice-drawer, #purchase-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line {
  display: grid;
  grid-template-columns: 2.2rem minmax(11rem, 1.5fr) 4.5rem 5.4rem 4.8rem 8.2rem 6rem 5.4rem 6rem 5.8rem 4.4rem;
  gap: 0.4rem;
  align-items: center;
}

#expense-drawer .invoice-lines-head,
#expense-drawer .invoice-line {
  display: grid;
  grid-template-columns: 2.2rem minmax(10rem, 1fr) minmax(10rem, 1.2fr) 6rem 8.2rem 6rem 5.6rem 4.4rem;
  gap: 0.4rem;
  align-items: center;
}

#import-drawer .invoice-lines-head,
#import-drawer .invoice-line {
  display: grid;
  grid-template-columns: 2.2rem minmax(10rem, 1.3fr) 4.2rem 5.4rem 4.8rem 4.6rem 5.2rem 5.2rem 5.2rem 4.8rem 4.8rem 5.2rem 5.4rem 4.4rem;
  gap: 0.35rem;
  align-items: center;
}

#import-drawer.is-usd .invoice-lines-head,
#import-drawer.is-usd .invoice-line {
  grid-template-columns: 2.2rem minmax(9rem, 1.2fr) 4.2rem 5.2rem 5.4rem 4.8rem 4.6rem 5rem 5rem 5rem 4.6rem 4.6rem 5rem 5.2rem 4.4rem;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-lines-head {
  padding: 0.2rem 0 0.5rem;
  border-bottom: 1px solid var(--table-border);
  color: var(--muted-ink);
  font-size: 0.72rem;
  font-weight: 700;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--table-border);
  margin: 0;
  padding: 0.4rem 0;
  background: transparent;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line:focus-within {
  position: relative;
  z-index: 2;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line input[type="number"] {
  -moz-appearance: textfield;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line input[type="number"]::-webkit-outer-spin-button,
:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line input[type="number"]::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.clinic-field-pop {
  position: fixed;
  z-index: 1200;
  min-height: 2.45rem;
  padding: 0 0.9rem;
  border: 1px solid var(--accent-color);
  border-radius: 0.85rem;
  background: var(--card-bg);
  color: var(--ink-color);
  caret-color: var(--ink-color);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  outline: none;
}

.clinic-field-pop[hidden] {
  display: none;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-no {
  text-transform: none;
  letter-spacing: 0;
  text-align: center;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-lookup {
  min-width: 0;
}

:is(#invoice-drawer, #purchase-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-vat-cell .invoice-vat {
  min-height: 2.15rem;
}

:is(#invoice-drawer, #purchase-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-vat-cell .invoice-vat button {
  font-size: 0.75rem;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-read {
  font-weight: 650;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-remove,
:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-lines-head span:last-child {
  justify-self: end;
  text-align: right;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-lines-actions {
  margin-top: 0.75rem;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-note-row {
  display: flex;
  align-items: stretch;
  gap: 0.85rem;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-note-row textarea {
  flex: 1 1 auto;
  min-width: 0;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-paid {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex: 0 0 5.6rem;
  width: 5.6rem;
  height: 5.6rem;
  margin: 0;
  padding: 0.65rem 0.45rem 0.7rem;
  border: 1px solid var(--btn-secondary-border);
  border-radius: 0.7rem;
  background: var(--btn-secondary-bg);
  color: var(--ink-color);
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-paid-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  line-height: 1;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-paid-copy i {
  font-size: 1.1rem;
  color: var(--muted-ink);
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-paid input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-paid-switch {
  position: relative;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 1.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-color) 18%, transparent);
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-paid-switch::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.18s ease;
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-paid:has(input:checked) {
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 16%, var(--card-bg));
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-paid:has(input:checked) .invoice-paid-copy i {
  color: var(--accent-color);
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-paid:has(input:checked) .invoice-paid-switch {
  background: var(--accent-color);
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-paid:has(input:checked) .invoice-paid-switch::after {
  transform: translateX(1.05rem);
}

:is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-paid:focus-within {
  box-shadow: 0 0 0 3px rgba(253, 126, 20, 0.35);
}

#import-drawer:not(.is-usd) .import-usd,
#import-drawer:not(.is-usd) .import-rate {
  display: none;
}

#import-drawer.is-usd input[name="EXWPrice[]"] {
  pointer-events: none;
}

#import-drawer.is-view .import-currency,
#import-drawer.is-view .import-vat-cost {
  pointer-events: none;
}

#import-drawer .import-vat-cost {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.35rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--table-border);
  color: var(--ink-color);
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}

#import-drawer .import-vat-cost .form-switch {
  margin: 0;
  padding-left: 2.4em;
  min-height: 0;
}

#import-drawer .import-vat-cost .form-check-input {
  width: 2.4rem;
  height: 1.2rem;
  margin: 0;
  cursor: pointer;
  background-color: color-mix(in srgb, var(--ink-color) 18%, transparent);
  border-color: var(--btn-secondary-border);
}

#import-drawer .import-vat-cost .form-check-input:checked {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

#import-drawer .import-line-figures {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#import-drawer .btn-import-delete {
  border-color: #d31212 !important;
  background: #d31212 !important;
  color: #fff !important;
}

#import-drawer .btn-import-delete:hover,
#import-drawer .btn-import-delete:focus,
[data-bs-theme="dark"] #import-drawer .btn-import-delete,
[data-bs-theme="dark"] #import-drawer .btn-import-delete:hover,
[data-bs-theme="dark"] #import-drawer .btn-import-delete:focus {
  border-color: #b00000 !important;
  background: #b00000 !important;
  color: #fff !important;
}

#expense-drawer.is-view .expense-currency {
  pointer-events: none;
}

#expense-drawer .expense-line-figures {
  grid-template-columns: 1fr 1fr;
}

#expense-drawer .expense-history {
  display: grid;
  gap: 0.55rem;
}

#expense-drawer .expense-history-row {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--table-border);
  border-radius: 0.75rem;
  background: var(--btn-secondary-bg);
}

#expense-drawer .expense-history-row strong {
  font-size: 0.92rem;
}

#expense-drawer .expense-history-row span,
#expense-drawer .expense-history-empty {
  color: var(--muted-ink);
  font-size: 0.82rem;
}

#expense-drawer .expense-history-empty {
  margin: 0;
}

:is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer, #invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .btn-expense-delete,
:is(#expense-drawer, #credit-drawer, #debit-drawer, #payment-drawer) .btn-expense-delete {
  border-color: #d31212 !important;
  background: #d31212 !important;
  color: #fff !important;
}

:is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer, #invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .btn-expense-delete:hover,
:is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer, #invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .btn-expense-delete:focus,
:is(#expense-drawer, #credit-drawer, #debit-drawer, #payment-drawer) .btn-expense-delete:hover,
:is(#expense-drawer, #credit-drawer, #debit-drawer, #payment-drawer) .btn-expense-delete:focus,
[data-bs-theme="dark"] :is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer, #invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .btn-expense-delete,
[data-bs-theme="dark"] :is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer, #invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .btn-expense-delete:hover,
[data-bs-theme="dark"] :is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer, #invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .btn-expense-delete:focus,
[data-bs-theme="dark"] :is(#expense-drawer, #credit-drawer, #debit-drawer, #payment-drawer) .btn-expense-delete,
[data-bs-theme="dark"] :is(#expense-drawer, #credit-drawer, #debit-drawer, #payment-drawer) .btn-expense-delete:hover,
[data-bs-theme="dark"] :is(#expense-drawer, #credit-drawer, #debit-drawer, #payment-drawer) .btn-expense-delete:focus {
  border-color: #b00000 !important;
  background: #b00000 !important;
  color: #fff !important;
}

html.clinic-no-delete .clinic-delete,
html.clinic-no-delete .btn-expense-delete:not(.clinic-delete-keep),
html.clinic-no-delete .btn-import-delete,
html.clinic-no-delete a[href*="invoice_delete"],
html.clinic-no-delete a[href*="payment_delete"],
html.clinic-no-delete a[href*="credit_note_delete"],
html.clinic-no-delete a[href*="debit_note_delete"],
html.clinic-no-delete a[href*="bank_operation_delete"],
html.clinic-no-delete a[href*="account_delete"],
html.clinic-no-delete a[href*="user_delete"],
html.clinic-no-delete a[href*="import_purchase_invoice_delete"],
html.clinic-no-delete a[href*="purchase_invoice_delete"],
html.clinic-no-delete a[href*="expense_delete"],
html.clinic-no-delete form[action*="invoice_delete"],
html.clinic-no-delete form[action*="import_purchase_invoice_delete"],
html.clinic-no-delete form[action*="purchase_invoice_delete"],
html.clinic-no-delete form[action*="expense_delete"],
html.clinic-no-delete [data-bs-target*="delete" i],
html.clinic-no-delete .modal[id*="delete" i] {
  display: none !important;
}

#expense-pay-backdrop {
  z-index: 1062;
}

#expense-pay-drawer {
  z-index: 1063;
}

#expense-pay-drawer .expense-pay-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

#expense-pay-drawer .expense-pay-methods button {
  width: 100%;
  min-height: 2.45rem;
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  background: var(--btn-secondary-bg);
}

#expense-pay-drawer .expense-pay-methods button.is-on {
  border-color: var(--accent-color);
}

#credit-drawer.is-view .credit-direct-vat,
#debit-drawer.is-view .debit-direct-vat {
  pointer-events: none;
}

@media (max-width: 767.98px) {
  :is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-line-figures,
  :is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-meta-grid,
  #import-drawer .import-line-figures,
  #expense-drawer .expense-line-figures {
    grid-template-columns: 1fr 1fr;
  }

  :is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #expense-pay-drawer, #payment-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-summary {
    flex-direction: column;
  }

  :is(#invoice-drawer, #purchase-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-summary.is-lined {
    padding-right: 0;
  }

  :is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-totals-box,
  :is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-totals-box .invoice-totals {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 767.98px) {
  :is(#invoice-drawer, #purchase-drawer, #import-drawer, #expense-drawer, #credit-drawer, #debit-drawer, #return-drawer) .invoice-lines-wrap {
    overflow-x: auto;
  }

  .drawer {
    width: 100%;
  }

  .drawer-fields,
  .drawer-grid,
  #invoice-drawer .drawer-section:first-of-type .drawer-grid,
  #purchase-drawer .drawer-section:first-of-type .drawer-grid,
  #import-drawer .drawer-section:first-of-type .drawer-grid,
  #return-drawer .drawer-section:first-of-type .drawer-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer,
  .drawer-backdrop {
    transition: none;
  }
}

.items-view-toggle {
  display: flex;
  align-items: stretch;
  background: var(--accent-soft);
  border: 1px solid var(--table-border);
  border-radius: 0.75rem;
  padding: 0.2rem;
  gap: 0.2rem;
}

.items-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--muted-ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.items-view-btn.is-active {
  background: var(--accent-color);
  color: #fff;
}

.items-picture-errors {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(220, 53, 69, 0.1);
  color: #b42318;
}

.items-picture-errors p {
  margin: 0;
}

.items-picture-errors p + p {
  margin-top: 0.25rem;
}

.item-name-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.item-thumb,
.pos-hit-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 0.45rem;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--muted-ink);
}

.item-thumb img,
.pos-hit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.items-card-shell {
  padding: 1.15rem 1.2rem 0.9rem;
  overflow: visible;
}

.items-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  color: var(--muted-ink);
  font-size: 0.85rem;
}

.items-card-toolbar .dataTables_length,
.items-card-toolbar .dataTables_filter {
  display: inline-flex;
  align-items: center;
  min-height: 2.45rem;
  margin: 0;
}

.items-card-search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.items-card-toolbar .dataTables_filter {
  margin-left: 0;
}

#itemsViewList .dataTables_wrapper .dataTables_length label,
.items-card-toolbar .dataTables_length label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#itemsViewList .dataTables_wrapper .dataTables_filter {
  gap: 0.65rem;
}

#itemsViewList .dataTables_wrapper .items-view-toggle {
  margin: 0;
}

#itemsViewList .dataTables_wrapper .dataTables_filter input,
.items-card-toolbar .dataTables_filter input {
  width: 13.5rem;
  margin-left: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.items-card-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--ink-color);
  font-size: 0.85rem;
  font-weight: 400;
  white-space: nowrap;
}

.items-card-toolbar select,
.items-card-toolbar input {
  background-color: var(--btn-secondary-bg);
  color: var(--ink-color);
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  outline: none;
}

.items-card-toolbar select:focus,
.items-card-toolbar input:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.items-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  color: var(--muted-ink);
  font-size: 0.85rem;
}

.items-card-foot .dataTables_paginate {
  margin-left: auto;
}

.items-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.item-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--table-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  cursor: pointer;
}

.item-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-ink);
  font-size: 1.6rem;
}

.item-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.item-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.65rem;
  padding: 0.9rem 1rem 1rem;
}

.item-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.item-card-title-row h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.item-card-body dl {
  display: grid;
  gap: 0.3rem;
  margin: 0;
}

.item-card-body dl div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.item-card-body dt {
  margin: 0;
  color: var(--muted-ink);
  font-weight: 600;
}

.item-card-body dd {
  margin: 0;
  text-align: right;
}

.item-card-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  margin-top: auto;
}

.item-card-actions > .item-card-movement {
  margin-top: 0;
  align-self: auto;
  color: var(--accent-color);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.item-card-actions > button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-color);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.item-card-actions > .item-card-movement:hover,
.item-card-actions > .item-card-movement:focus {
  color: #e8590c;
  text-decoration: underline;
}

:is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer).is-view select,
:is(#client-drawer, #supplier-drawer).is-view .form-check {
  pointer-events: none;
}

:is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer).is-view select {
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
}

:is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer).is-view select:disabled,
:is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer).is-view .form-control:disabled,
:is(#item-drawer, #client-drawer, #supplier-drawer, #account-drawer, #bank-drawer, #bank-op-drawer, #stock-adj-drawer, #user-drawer).is-view .form-control[readonly] {
  opacity: 1;
  color: var(--ink-color);
}

#item-drawer.is-view .item-photo-upload,
#item-drawer.is-view .item-photo-remove,
#item-drawer.is-view .item-photo-set-cover,
#item-drawer.is-view .item-photo-grip {
  display: none !important;
}

.items-card-none {
  margin: 1rem 0 0;
  color: var(--muted-ink);
}

.item-photo-card {
  border: 1px solid var(--table-border);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem 1rem;
  background: var(--card-bg);
}

.item-photo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.item-photo-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.42rem 0.95rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent-color);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(253, 126, 20, 0.32);
}

.item-photo-upload:hover,
.item-photo-upload:focus {
  background: #e8590c;
  color: #fff;
}

.item-photo-empty,
.item-photo-note {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--muted-ink);
}

.item-photo-note {
  color: #b42318;
}

.item-photo-row {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 0.85rem;
}

.item-photo-row:has(.item-photo-grid:empty) {
  display: none;
}

.item-photo-scroller {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.item-photo-row.is-paged .item-photo-scroller {
  flex: 0 0 auto;
  width: calc(100% - 4.8rem);
  margin-inline: auto;
}

.item-photo-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.65rem;
  width: max-content;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.item-photo-grid.is-settled {
  transition: none;
}

.item-photo-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(253, 126, 20, 0.18);
  color: #fd7e14;
  font-size: 1rem;
  line-height: 0;
  transform: translateY(-50%);
}

.item-photo-arrow.is-prev { left: 0; }
.item-photo-arrow.is-next { right: 0; }

.item-photo-arrow.is-off {
  visibility: hidden;
  pointer-events: none;
}

.item-photo-arrow:hover,
.item-photo-arrow:focus {
  background: var(--accent-color);
  color: #fff;
}

.item-photo-arrow[hidden] {
  display: none !important;
}

.item-photo-tile {
  position: relative;
  flex: 0 0 auto;
  width: 7.25rem;
  aspect-ratio: 1;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--accent-soft);
  border: 2px solid rgba(253, 126, 20, 0.72);
}

.item-photo-tile.is-cover {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(253, 126, 20, 0.35);
}

.item-photo-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.item-photo-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-photo-badge {
  position: absolute;
  left: 0.4rem;
  bottom: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-color);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.item-photo-set-cover,
.item-photo-remove {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 12, 15, 0.72);
  color: #fff;
  line-height: 0;
}

.item-photo-set-cover .bi,
.item-photo-arrow .bi,
.item-photo-grip .bi {
  display: block;
  line-height: 1;
}

.item-photo-set-cover .bi,
.item-photo-grip .bi { font-size: 0.78rem; }
.item-photo-arrow .bi { font-size: 1rem; }

.item-photo-set-cover .bi::before,
.item-photo-arrow .bi::before,
.item-photo-grip .bi::before {
  display: block;
  vertical-align: 0;
}

.item-photo-remove svg {
  display: block;
  width: 0.7rem;
  height: 0.7rem;
}

.item-photo-set-cover {
  left: 0.35rem;
  bottom: 0.35rem;
}

.item-photo-remove {
  top: 0.35rem;
  right: 0.35rem;
}

.item-photo-grip {
  position: absolute;
  top: 0.35rem;
  left: 50%;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.15rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 12, 15, 0.72);
  color: #fff;
  line-height: 0;
  transform: translateX(-50%);
  cursor: grab;
  touch-action: none;
}

.item-photo-row.is-sortable .item-photo-grip {
  display: inline-flex;
}

.item-photo-tile.is-dragging {
  opacity: 0.55;
  z-index: 3;
}

.item-photo-tile.is-dragging .item-photo-grip {
  cursor: grabbing;
}

.item-photo-set-cover:hover,
.item-photo-set-cover:focus,
.item-photo-remove:hover,
.item-photo-remove:focus,
.item-photo-grip:hover,
.item-photo-grip:focus {
  background: var(--accent-color);
  color: #fff;
}

.item-thumb:has(img) {
  cursor: zoom-in;
}

.item-picture-viewer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  background: rgba(8, 8, 10, 0.9);
  backdrop-filter: blur(14px);
}

.item-picture-viewer[hidden] {
  display: none !important;
}

.item-picture-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  padding: 0.65rem 1rem 0.65rem 1.15rem;
  background: rgba(12, 12, 15, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f4f4f5;
}

.item-picture-viewer-name {
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-picture-viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.item-picture-viewer-download {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(253, 126, 20, 0.55);
  color: #fdba74;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.item-picture-viewer-download:hover {
  color: #fff;
  background: rgba(253, 126, 20, 0.22);
}

.item-picture-viewer-close,
.item-picture-viewer-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.item-picture-viewer-close {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 8px;
}

.item-picture-viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  transform: translateY(-50%);
  background: rgba(12, 12, 15, 0.78);
}

.item-picture-viewer-nav.is-prev { left: 0.85rem; }
.item-picture-viewer-nav.is-next { right: 0.85rem; }

.item-picture-viewer-nav[hidden] {
  display: none !important;
}

.item-picture-viewer-close:hover,
.item-picture-viewer-close:focus,
.item-picture-viewer-nav:hover,
.item-picture-viewer-nav:focus {
  background: rgba(253, 126, 20, 0.85);
  color: #fff;
}

.item-picture-viewer-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 4.25rem;
}

.item-picture-viewer-stage img {
  max-width: min(92vw, 1200px);
  max-height: calc(100dvh - 6.5rem);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.pos-search-dropdown li .pos-hit {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.pos-cart-name {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.pos-item-name {
  font-weight: 600;
  line-height: 1.25;
  min-width: 0;
}

/* ═══════════════════════════════════════════════════════════
   POS module — gate + register layouts
   ═══════════════════════════════════════════════════════════ */

.app-content > main:has(.pos-gate),
.app-content > main:has(.pos-register) {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pos-gate {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem 2rem;
  min-height: calc(100dvh - 9rem);
}

.pos-gate-card {
  width: min(36rem, 100%);
  padding: 2.1rem 1.85rem 1.75rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: calc(var(--card-radius) + 4px);
  box-shadow: var(--card-shadow);
}

.pos-gate-card-wide {
  width: min(40rem, 100%);
}

.pos-gate-badge {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-color) 18%, transparent);
  color: var(--accent-color);
  font-size: 1.35rem;
  margin-bottom: 0.85rem;
}

.pos-gate-badge.is-ok {
  background: color-mix(in srgb, #22c55e 20%, transparent);
  color: #22c55e;
}

.pos-gate-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink-color);
}

.pos-gate-lead {
  margin: 0.4rem 0 1.25rem;
  color: var(--muted-ink);
  line-height: 1.45;
}

.pos-gate-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.85rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.pos-gate-alert.is-bad {
  background: color-mix(in srgb, #d31212 14%, transparent);
  color: #ffb4b4;
  border: 1px solid color-mix(in srgb, #d31212 35%, transparent);
}

[data-bs-theme="light"] .pos-gate-alert.is-bad {
  color: #8a1212;
}

.pos-gate-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  width: 100%;
}

.pos-gate-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-self: stretch;
  gap: 0.3rem;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
}

.pos-field-label {
  display: block;
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.pos-gate-form .pos-field,
.pos-gate-form .pos-terminal-select,
.pos-gate-form .pos-money-input {
  display: block !important;
  align-self: stretch;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  min-height: 3rem;
  height: 3rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px !important;
  border: 1px solid var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: var(--ink-color);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  field-sizing: fixed;
}

/* Native select is clipped by dressEntriesSelect (.entries-native).
   Style the visible .entries-menu wrapper/button instead (same pattern as drawers). */
.pos-gate-form .entries-menu {
  display: flex;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.pos-gate-form .entries-menu-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  height: 3rem;
  box-sizing: border-box;
  padding: 0.55rem 2.5rem 0.55rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--btn-secondary-border);
  background-color: var(--btn-secondary-bg);
  color: var(--ink-color);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239a9aa3' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
}

[data-bs-theme="dark"] .pos-gate-form .entries-menu-btn {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23f0c4a0' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E");
}

.pos-gate-form .entries-menu-btn:focus,
.pos-gate-form .entries-menu.is-open .entries-menu-btn {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.pos-money-field {
  position: relative;
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
}

.pos-money-prefix {
  position: absolute;
  right: 1.05rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-ink);
  font-weight: 600;
  pointer-events: none;
  z-index: 1;
  line-height: 1;
}

.pos-money-field > input,
.pos-gate-form .pos-money-input {
  padding-right: 2.2rem !important;
}

.pos-money-field > input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.pos-money-field > input[type="number"]::-webkit-outer-spin-button,
.pos-money-field > input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pos-float-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  align-self: stretch;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.pos-float-row .pos-chip-row {
  margin: 0;
  justify-content: flex-end;
}

.pos-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.pos-chip {
  border: 1px solid var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: var(--ink-color);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.pos-chip:hover,
.pos-chip.is-active {
  border-color: var(--accent-color);
  color: #fff;
  background: var(--accent-color);
}

.pos-gate-submit {
  width: 100%;
  margin-top: 1rem;
  min-height: 2.85rem;
}

.pos-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.15rem;
}

.pos-gate-actions .btn {
  flex: 1 1 auto;
  min-height: 2.7rem;
}

.pos-close-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.pos-metric {
  padding: 0.85rem 0.8rem;
  border-radius: 1rem;
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  display: grid;
  gap: 0.25rem;
}

.pos-metric span {
  color: var(--muted-ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.pos-metric strong {
  color: var(--ink-color);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.pos-metric.is-ok,
.pos-diff-live.is-ok {
  border-color: color-mix(in srgb, #22c55e 45%, transparent);
}

.pos-metric.is-over,
.pos-diff-live.is-over {
  border-color: color-mix(in srgb, #22c55e 45%, transparent);
}

.pos-metric.is-short,
.pos-diff-live.is-short {
  border-color: color-mix(in srgb, #d31212 45%, transparent);
}

.pos-metric.is-ok strong,
.pos-diff-live.is-ok strong {
  color: #22c55e;
}

.pos-metric.is-over strong,
.pos-diff-live.is-over strong {
  color: #22c55e;
}

.pos-metric.is-short strong,
.pos-diff-live.is-short strong {
  color: #f87171;
}

.pos-close-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1rem;
  margin-bottom: 0.35rem;
}

.pos-close-breakdown > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--table-border, var(--card-border));
  color: var(--muted-ink);
  font-size: 0.86rem;
}

.pos-close-breakdown b {
  color: var(--ink-color);
  font-weight: 600;
}

.pos-diff-live {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
}

.pos-diff-live span {
  color: var(--muted-ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.pos-register {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: calc(100dvh - 8.5rem);
  padding: 0.85rem 0 1.25rem;
}

.pos-register-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.8rem 1.15rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-bg) 82%, var(--accent-color) 18%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color) 18%, transparent);
}

.pos-register-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
  color: var(--ink-color);
  font-size: 1rem;
  font-weight: 500;
}

.pos-register-terminal {
  color: var(--ink-color);
  font-weight: 700;
  font-size: 1.08rem;
}

.pos-register-sep {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--muted-ink);
  opacity: 0.55;
}

.pos-register-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pos-register-actions .btn {
  font-size: 0.92rem;
  padding: 0.48rem 1.15rem;
  min-height: 2.4rem;
}

.pos-register-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17.5rem, 21rem);
  gap: 0.85rem;
  align-items: stretch;
}

.pos-cart-panel,
.pos-checkout {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  min-height: 0;
}

.pos-cart-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  container-type: inline-size;
  container-name: pos-cart;
}

.pos-cart-search {
  position: relative;
  z-index: 22;
  padding: 0.85rem 0.85rem 0.65rem;
  border-bottom: 1px solid var(--card-border);
  flex: 0 0 auto;
  background: var(--card-bg);
}

.pos-search-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pos-search-bar .pos-search-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.pos-stock-filter,
.pos-search-view {
  flex: 0 0 auto;
}

.pos-stock-filter .items-view-btn {
  white-space: nowrap;
}

#pos-oos-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.72);
}

#pos-oos-modal .modal-content {
  margin: 0;
  width: min(28rem, 100%);
  padding: 1.4rem 1.4rem 1.2rem;
  background: var(--card-bg);
  color: var(--ink-color);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

#pos-oos-modal .page-title {
  margin: 0 0 0.55rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #e03131;
}

#pos-oos-modal .page-lead {
  margin: 0 0 1.15rem;
  color: var(--ink-color);
  font-size: 1rem;
  line-height: 1.45;
}

#pos-oos-modal .page-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

#pos-oos-modal .btn {
  min-width: 7rem;
}

.pos-search-view .items-view-btn span {
  display: none;
}

@media (min-width: 900px) {
  .pos-search-view .items-view-btn span {
    display: inline;
  }
}

.pos-cart-search .form-control {
  padding-left: 2.55rem;
  min-height: 2.85rem;
  font-size: 1rem;
}

.pos-search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-ink);
  pointer-events: none;
  z-index: 2;
  line-height: 1;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1em;
  width: 1em;
}

.pos-search-wrap {
  position: relative;
}

.pos-cart-scroll {
  position: relative;
  flex: 1 1 auto;
  overflow: auto;
  min-height: 18rem;
}

table.pos-items {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

table.pos-items thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card-bg);
  color: var(--muted-ink);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--card-border);
  padding: 0.7rem 0.65rem;
  text-align: left;
  white-space: nowrap;
}

table.pos-items td {
  border-bottom: 1px solid var(--card-border);
  padding: 0.65rem;
  vertical-align: middle;
  color: var(--ink-color);
}

table.pos-items.is-empty thead {
  display: none;
}

table.pos-items .form-control {
  min-height: 2.2rem;
  min-width: 0;
  padding: 0.3rem 0.55rem;
}

.pos-col-type { width: 5.5rem; white-space: nowrap; }
.pos-col-qty { width: 7.5rem; }
.pos-col-price { width: 9rem; }
.pos-col-vat { width: 4.25rem; text-align: center; }
.pos-col-rebate { width: 5.75rem; }
.pos-col-total { width: 8.25rem; }
.pos-col-remove { width: 2.5rem; }

table.pos-items .pos-col-type .badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  vertical-align: middle;
}

table.pos-items input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

table.pos-items input[type="number"]::-webkit-outer-spin-button,
table.pos-items input[type="number"]::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.pos-qty {
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  width: 100%;
  height: 2.2rem;
  min-height: 2.2rem;
  border: 1px solid var(--btn-secondary-border);
  border-radius: 0.7rem;
  background: var(--btn-secondary-bg);
  overflow: hidden;
}

.pos-qty:focus-within {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.pos-qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1.7rem;
  width: 1.7rem;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted-ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.pos-qty-btn:hover,
.pos-qty-btn:focus {
  color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 12%, transparent);
  outline: none;
}

table.pos-items .pos-qty .rowQty {
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 1rem;
  line-height: calc(2.2rem - 2px) !important;
  text-align: center;
  color: var(--ink-color);
}

table.pos-items .pos-qty .rowQty:focus {
  outline: none;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--ink-color);
}

.pos-empty {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  place-items: center;
  gap: 0.35rem;
  text-align: center;
  color: var(--muted-ink);
  padding: 2rem;
}

.pos-empty.is-visible {
  display: grid;
}

.pos-empty i {
  font-size: 2rem;
  color: var(--accent-color);
  opacity: 0.85;
  margin-bottom: 0.35rem;
}

.pos-empty strong {
  color: var(--ink-color);
  font-size: 1.05rem;
}

.pos-checkout {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 1rem;
}

.pos-checkout-block {
  display: grid;
  gap: 0.35rem;
}

.pos-field-hint {
  color: var(--muted-ink);
  font-size: 0.78rem;
  line-height: 1.35;
}

.pos-print-card {
  padding: 1.25rem 1.35rem 1.2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.pos-print-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
}

.pos-print-row .form-label {
  display: block;
  margin: 0 0 0.2rem;
  color: var(--ink-color);
  font-weight: 650;
}

.pos-print-row .pos-field-hint {
  margin: 0 0 0.7rem;
}

.pos-print-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pos-print-controls .btn {
  flex: 0 0 auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.pos-print-card .entries-menu {
  display: flex;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.pos-print-card .entries-menu-btn {
  width: 100%;
  min-width: 0;
  min-height: 2.55rem;
  text-align: left;
}

.pos-print-note {
  margin: 1.15rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--table-border);
  color: var(--muted-ink);
  font-size: 0.84rem;
  line-height: 1.5;
}

@media (max-width: 800px) {
  .pos-print-grid {
    grid-template-columns: 1fr;
  }
}

.pos-checkout-totals {
  margin-top: auto;
  display: grid;
  gap: 0.45rem;
  padding-top: 0.35rem;
}

.pos-total-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted-ink);
  font-size: 0.9rem;
}

.pos-total-hero {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--card-border);
  color: var(--ink-color);
}

.pos-total-hero strong {
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  font-weight: 750;
}

.pos-charge-btn {
  width: 100%;
  min-height: 3.1rem;
  font-size: 1.05rem;
}

.pos-search-dropdown {
  position: absolute;
  z-index: 1050;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  max-height: 22rem;
  overflow-y: auto;
  display: none;
  text-align: left;
  background: var(--card-bg);
  color: var(--ink-color);
  border: 1px solid var(--table-border);
  border-radius: 0.85rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.pos-cart-panel > #posSearchList.pos-item-results {
  z-index: 20;
  inset: 0;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  max-height: none;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.85rem;
  box-sizing: border-box;
  border-radius: var(--card-radius);
  border: 1px solid var(--card-border);
  box-shadow: none;
}

.pos-cart-panel > #posSearchList.pos-item-results:not(.is-open) {
  display: none !important;
}

.pos-cart-panel > #posSearchList.pos-item-results.is-open {
  display: block !important;
}

.pos-cart-panel > #posSearchList.pos-item-results.is-cards.is-open {
  display: grid !important;
}

.pos-search-dropdown li {
  min-height: 3.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink-color);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.3;
}

.pos-search-dropdown li .pos-hit {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1 1 auto;
}

.pos-hit-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.pos-hit-price {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.75rem;
  flex: 0 0 auto;
  min-width: 0;
}

.pos-hit-price .pos-oos,
.pos-search-dropdown li small.pos-oos,
.pos-search-dropdown li.is-active small.pos-oos,
.pos-search-dropdown li:hover small.pos-oos,
#posSearchList li.active small.pos-oos,
#posSearchList li:hover small.pos-oos,
.pos-cart-panel > #posSearchList.is-cards .pos-hit-price small.pos-oos {
  color: #e03131 !important;
  opacity: 1 !important;
  font-style: normal;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: nowrap;
  order: -1;
}

.pos-search-dropdown li.is-out {
  opacity: 0.72;
}

.pos-hit-copy strong {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-cart-panel > #posSearchList .pos-hit-thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.pos-cart-panel > #posSearchList li b {
  color: var(--ink-color);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  flex: 0 0 auto;
}

.pos-cart-panel > #posSearchList li.active b,
.pos-cart-panel > #posSearchList li.is-active b,
.pos-cart-panel > #posSearchList li:hover b {
  color: #fff;
}

.pos-cart-panel > #posSearchList.is-cards {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 17.5rem;
  gap: 1rem;
  align-content: start;
  align-items: stretch;
  justify-content: start;
  padding: 0.85rem;
}

.pos-cart-panel > #posSearchList.is-cards > li {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0.8rem;
  overflow: hidden;
  background: var(--btn-secondary-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.85rem;
  box-sizing: border-box;
}

.pos-cart-panel > #posSearchList.is-cards > li.active,
.pos-cart-panel > #posSearchList.is-cards > li.is-active,
.pos-cart-panel > #posSearchList.is-cards > li:hover {
  border-color: var(--accent-color);
}

.pos-cart-panel > #posSearchList.is-cards .pos-hit {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.pos-cart-panel > #posSearchList.is-cards .pos-hit-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 7.5rem;
  margin: 0 0 0.55rem;
  flex: none;
  flex-basis: auto;
  border-radius: 0.65rem;
  overflow: hidden;
}

.pos-cart-panel > #posSearchList.is-cards .pos-hit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pos-cart-panel > #posSearchList.is-cards .pos-hit-copy {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 3.2rem;
  margin: 0;
  overflow: hidden;
}

.pos-cart-panel > #posSearchList.is-cards .pos-hit-copy strong,
.pos-cart-panel > #posSearchList.is-cards .pos-hit-copy small {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.pos-cart-panel > #posSearchList.is-cards .pos-hit-copy strong {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.pos-cart-panel > #posSearchList.is-cards .pos-hit-copy small {
  font-size: 0.78rem;
  margin: 0;
}

.pos-cart-panel > #posSearchList.is-cards > li > .pos-hit-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 1.7rem;
  margin: auto 0 0;
}

.pos-cart-panel > #posSearchList.is-cards > li > .pos-hit-price > b {
  display: block;
  width: auto;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--ink-color);
  flex: none;
}

.pos-cart-panel > #posSearchList.is-cards > li > .pos-hit-price > .pos-oos {
  order: 1;
  margin-left: auto;
}

@container pos-cart (max-width: 860px) {
  .pos-cart-panel > #posSearchList.is-cards {
    grid-template-columns: repeat(3, minmax(10rem, 1fr));
  }

  .pos-cart-panel > #posSearchList.is-cards .pos-hit-thumb {
    height: 6.75rem;
  }
}

@container pos-cart (max-width: 620px) {
  .pos-cart-panel > #posSearchList.is-cards {
    grid-template-columns: repeat(2, minmax(9rem, 1fr));
    gap: 0.75rem;
    padding: 0.7rem;
  }

  .pos-cart-panel > #posSearchList.is-cards > li {
    padding: 0.7rem;
  }

  .pos-cart-panel > #posSearchList.is-cards .pos-hit-thumb {
    height: 6rem;
  }
}

@container pos-cart (max-width: 380px) {
  .pos-cart-panel > #posSearchList.is-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .pos-cart-panel > #posSearchList.is-cards .pos-hit-thumb {
    height: 7.25rem;
  }
}

@media (max-width: 1200px) {
  .pos-cart-panel > #posSearchList.is-cards {
    grid-template-columns: repeat(3, minmax(10rem, 1fr));
  }
}

@media (max-width: 900px) {
  .pos-cart-panel > #posSearchList.is-cards {
    grid-template-columns: repeat(2, minmax(9rem, 1fr));
  }
}

@media (max-width: 520px) {
  .pos-search-bar {
    flex-wrap: wrap;
  }

  .pos-stock-filter,
  .pos-search-view {
    width: auto;
    flex: 1 1 auto;
  }

  .pos-search-view .items-view-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

.pos-search-dropdown li.active,
.pos-search-dropdown li.is-active,
.pos-search-dropdown li:hover,
#clientList li.active,
#clientList li.is-active,
#clientList li:hover,
#posSearchList li.active,
#posSearchList li.is-active,
#posSearchList li:hover {
  background: var(--accent-color) !important;
  color: #fff !important;
}

.pos-search-dropdown li.active small,
.pos-search-dropdown li.is-active small,
.pos-search-dropdown li:hover small,
#clientList li.active small,
#clientList li:hover small,
#posSearchList li.active small,
#posSearchList li:hover small {
  color: #fff !important;
  opacity: 0.9;
}

.pos-search-dropdown li small {
  opacity: 0.75;
  font-weight: 400;
}

.pos-vat-cell {
  text-align: center;
  white-space: nowrap;
  font-weight: 600;
}

.badge-service {
  background: #6f42c1;
}

.badge-product {
  background: #198754;
}

.pos-pay-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  padding: 0.85rem 0 0;
}

#pos-pay-drawer .pos-pay-fields {
  grid-template-columns: 1fr;
  gap: 1.35rem;
  padding: 0 1.15rem 0.75rem 1.35rem;
}

#pos-pay-drawer .pos-pay-fields .form-label {
  display: block;
  margin-bottom: 0.45rem;
}

#pos-pay-drawer .drawer-foot {
  margin-top: auto;
  padding-top: 0.85rem;
}

#pos-pay-drawer .drawer-foot .btn-primary {
  margin-left: auto;
}

.pos-pay-due {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  background: var(--btn-secondary-bg);
  border: 1px solid var(--card-border);
}

.pos-pay-due span {
  color: var(--muted-ink);
  font-weight: 600;
}

.pos-pay-due strong {
  font-size: 1.7rem;
  color: var(--ink-color);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.pos-pay-due strong span {
  color: var(--ink-color);
}

.pos-pay-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.pos-pay-quick .btn {
  min-height: 2.55rem;
}

#pos-pay-drawer .pos-pay-quick .btn,
#pos-pay-drawer .pos-fill-btn {
  border-color: var(--accent-color);
  color: var(--accent-color) !important;
  background: transparent;
  background-color: transparent;
}

#pos-pay-drawer .pos-pay-quick .btn:hover,
#pos-pay-drawer .pos-pay-quick .btn:focus,
#pos-pay-drawer .pos-fill-btn:hover,
#pos-pay-drawer .pos-fill-btn:focus {
  border-color: var(--accent-color);
  color: var(--accent-color) !important;
  background: color-mix(in srgb, var(--accent-color) 16%, transparent);
  background-color: color-mix(in srgb, var(--accent-color) 16%, transparent);
}

#pos-pay-drawer .pos-fill-btn:disabled {
  opacity: 0.45;
}

#pos-pay-drawer .pos-bank-cards,
.pos-bank-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 0.55rem;
  margin-top: 0.55rem;
}

#pos-pay-drawer .pos-bank-card,
.pos-bank-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.7rem 0.8rem;
  text-align: left;
  color: var(--ink-color);
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, var(--table-border, #e9ecef));
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

#pos-pay-drawer .pos-bank-card:hover,
#pos-pay-drawer .pos-bank-card:focus-visible,
.pos-bank-card:hover,
.pos-bank-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent-color, #0d6efd) 55%, var(--card-border, #e9ecef));
  outline: none;
}

#pos-pay-drawer .pos-bank-card.is-on,
.pos-bank-card.is-on {
  border-color: var(--accent-color, #0d6efd);
  background: color-mix(in srgb, var(--accent-color, #0d6efd) 8%, var(--card-bg, #fff));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color, #0d6efd) 35%, transparent);
}

#pos-pay-drawer .pos-bank-card-dot,
.pos-bank-card-dot {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--ink-color) 28%, transparent);
  background: transparent;
  box-shadow: inset 0 0 0 0 transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#pos-pay-drawer .pos-bank-card.is-on .pos-bank-card-dot,
.pos-bank-card.is-on .pos-bank-card-dot {
  border-color: var(--accent-color, #0d6efd);
  background: var(--accent-color, #0d6efd);
  box-shadow: inset 0 0 0 3px var(--card-bg, #fff);
}

#pos-pay-drawer .pos-bank-card-body,
.pos-bank-card-body {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

#pos-pay-drawer .pos-bank-card-body strong,
.pos-bank-card-body strong {
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#pos-pay-drawer .pos-bank-card-body small,
.pos-bank-card-body small {
  color: var(--muted-ink, #868e96);
  font-size: 0.78rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#pos-pay-drawer .pos-bank-card-check,
.pos-bank-card-check {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color, #0d6efd);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

#pos-pay-drawer .pos-bank-card.is-on .pos-bank-card-check,
.pos-bank-card.is-on .pos-bank-card-check {
  opacity: 1;
  transform: scale(1);
}

.pos-tender-grid {
  display: grid;
  gap: 1.15rem;
}

.pos-tender-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.pos-tender-controls .pos-fill-btn {
  min-width: 4.75rem;
  min-height: 2.45rem;
  padding: 0.45rem 1.05rem;
  font-size: 0.9rem;
}

#pos-pay-drawer .pos-money-field {
  width: 100%;
}

#pos-pay-drawer .tender-input {
  padding-right: 2.2rem;
  min-height: 2.45rem;
}

.pos-pay-status {
  display: grid;
  gap: 0.4rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--card-border);
}

.pos-pay-status > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--muted-ink);
  font-size: 1.05rem;
}

.pos-pay-status b {
  color: var(--ink-color);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.pos-pay-status b span {
  color: var(--ink-color);
}

.pos-pay-status .is-hidden {
  display: none !important;
}

#pos-pay-drawer .tender-input,
#pos-pay-drawer #inCard.tender-input[readonly],
#rv-in-card,
#rv-in-card[readonly] {
  color: var(--ink-color, var(--bs-body-color, inherit));
  background: var(--bs-body-bg, #fff) !important;
  background-color: var(--bs-body-bg, #fff) !important;
  border-color: var(--card-border, var(--table-border, #ced4da));
  opacity: 1;
  box-shadow: none;
}

#pos-pay-drawer #inCard.tender-input[readonly],
#pos-pay-drawer #inBank.tender-input[readonly],
#rv-in-card[readonly] {
  cursor: pointer;
}

#pos-pay-drawer #inCard.tender-input[readonly]:focus,
#pos-pay-drawer #inBank.tender-input[readonly]:focus,
#rv-in-card[readonly]:focus {
  border-color: var(--focus-border, var(--accent-color));
  box-shadow: 0 0 0 3px var(--focus-ring, rgba(13, 110, 253, 0.2));
  outline: none;
}

.pos-card-lines {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
  color: var(--muted-ink, #868e96);
  font-size: 0.84rem;
  line-height: 1.4;
}

.pos-card-lines[hidden] {
  display: none !important;
}

.pos-card-lines li {
  margin: 0;
  padding: 0;
  font-variant-numeric: tabular-nums;
}

#pos-card-drawer,
#rv-card-drawer {
  z-index: 1063;
}

#pos-card-drawer.pos-card-bank-modal,
#rv-card-drawer.pos-card-bank-modal {
  /* Sit just left of the take-payment drawer (default drawer width 28rem). */
  top: 50%;
  right: calc(min(28rem, 100vw) + 0.85rem);
  bottom: auto;
  left: auto;
  width: min(22rem, calc(100vw - 1.5rem));
  height: auto;
  max-height: min(80vh, 36rem);
  border-radius: 1rem;
  border: 1px solid var(--card-border, var(--table-border));
  border-left: 1px solid var(--card-border, var(--table-border));
  box-shadow: 0 18px 48px rgba(61, 46, 34, 0.18);
  transform: translate(1.25rem, -50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding-bottom: 0;
  overflow: hidden;
  transition: transform 0.28s ease, opacity 0.2s ease, visibility 0.2s ease;
}

#pos-card-drawer.pos-card-bank-modal.is-open,
#rv-card-drawer.pos-card-bank-modal.is-open {
  transform: translate(0, -50%);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Reception: anchored beside the card amount field (JS sets top/left). */
#rv-card-drawer.pos-card-bank-modal.is-anchored {
  right: auto;
  bottom: auto;
  transform: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#rv-card-drawer.pos-card-bank-modal.is-anchored.is-open {
  transform: none;
}

@media (max-width: 900px) {
  #pos-card-drawer.pos-card-bank-modal,
  #rv-card-drawer.pos-card-bank-modal:not(.is-anchored) {
    right: 0.75rem;
  }
}

#pos-card-drawer.pos-card-bank-modal .drawer-head,
#rv-card-drawer.pos-card-bank-modal .drawer-head {
  padding: 0.85rem 1rem 0.65rem;
  flex: 0 0 auto;
}

#pos-card-drawer.pos-card-bank-modal .drawer-fields,
#rv-card-drawer.pos-card-bank-modal .drawer-fields {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 1rem 0.75rem;
}

#pos-card-drawer.pos-card-bank-modal .drawer-foot,
#rv-card-drawer.pos-card-bank-modal .drawer-foot {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--card-border, var(--table-border));
}

#pos-card-drawer .pos-card-drawer-fields,
#rv-card-drawer .pos-card-drawer-fields,
#rv-card-drawer .drawer-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-content: start;
}

#pos-card-drawer #pos-card-drawer-lead,
#rv-card-drawer #rv-card-drawer-lead {
  margin: 0;
  width: 100%;
}

.pos-card-bank-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  min-width: 0;
}

.pos-card-bank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7.25rem, 8.75rem);
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.pos-card-bank-name {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.pos-card-bank-name strong {
  font-size: 0.95rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.pos-card-bank-name small {
  color: var(--muted-ink, #868e96);
  font-size: 0.78rem;
}

.pos-card-bank-row .pos-money-field,
.pos-card-bank-row .rv-money {
  width: 100%;
  min-width: 0;
}

.pos-card-bank-row .pos-money-field > input,
.pos-card-bank-row .rv-money > input {
  width: 100%;
  min-width: 0;
}

@media (max-width: 520px) {
  .pos-card-bank-row {
    grid-template-columns: 1fr;
  }
}

#PosSalesTable tfoot th,
#PosSalesTable tfoot td {
  padding: 1rem 0.9rem !important;
}

.page-table:has(#PosSalesTable) {
  padding-bottom: 0.35rem;
}

@media (max-width: 1100px) {
  .pos-col-price,
  .pos-col-rebate,
  .pos-col-total {
    width: 7.25rem;
  }
}

@media (max-width: 991.98px) {
  .pos-register-body {
    grid-template-columns: 1fr;
  }

  .pos-checkout {
    order: -1;
  }

  .pos-close-metrics {
    grid-template-columns: 1fr;
  }

  .pos-close-breakdown {
    grid-template-columns: 1fr;
  }

  .pos-float-row {
    grid-template-columns: 1fr;
  }

  .pos-float-row .pos-chip-row {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .pos-register-bar {
    border-radius: 1.1rem;
  }

  .pos-col-vat,
  .pos-col-rebate,
  table.pos-items thead th.pos-col-vat,
  table.pos-items thead th.pos-col-rebate {
    display: none;
  }

  table.pos-items td.pos-col-vat,
  table.pos-items td.pos-col-rebate {
    display: none;
  }
}

