@font-face {
  font-family: Vazirmatn;
  src: url("./fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f3f7fc;
  --surface: #fff;
  --surface-alt: #f6f9fe;
  --line: #dce6f1;
  --text: #15263e;
  --muted: #52647c;
  --brand: #195dc4;
  --brand-hover: #124ba6;
  --brand-soft: #e5efff;
  --on-brand: #fff;
  --sidebar: #fbfdff;
  --chart-secondary: #8cbaf1;
  --green: #18704e;
  --green-bg: #e0f5eb;
  --red: #ac3450;
  --red-bg: #fce7ee;
  --amber: #895217;
  --amber-bg: #fff0db;
  --blue: #2e5ca1;
  --blue-bg: #e8f0fd;
  font-family: Vazirmatn, "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 15px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1625;
  --surface: #152235;
  --surface-alt: #1a2a40;
  --line: #2b405b;
  --text: #edf4ff;
  --muted: #adbed5;
  --brand: #78b3ff;
  --brand-hover: #9bc6ff;
  --brand-soft: #1b3b66;
  --on-brand: #091e3c;
  --sidebar: #101d30;
  --chart-secondary: #526f94;
  --green: #8cdbb5;
  --green-bg: #213f37;
  --red: #ff9fb4;
  --red-bg: #4b2637;
  --amber: #ffcd9e;
  --amber-bg: #493323;
  --blue: #a0c6ff;
  --blue-bg: #253853;
}
*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
[hidden] { display: none !important; }
.ui-icon { display: inline-block; flex: 0 0 auto; width: 20px; height: 20px; vertical-align: middle; }
.skip-link { position: absolute; z-index: 10; inset-block-start: 8px; inset-inline-start: 8px; padding: 10px; background: var(--surface); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
h1, h2, p { margin: 0; }
p { line-height: 1.7; }
h1 { font-size: clamp(1.45rem, 2.35vw, 2.05rem); letter-spacing: -.025em; line-height: 1.3; }
h2 { font-size: 1.1rem; margin-block-end: 1rem; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 254px minmax(0, 1fr); }
.shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
.shell.sidebar-collapsed > .sidebar { display: none; }
.sidebar {
  height: 100vh; position: sticky; top: 0; padding: 23px 15px 13px; display: flex;
  flex-direction: column; overflow: auto; border-inline-end: 1px solid var(--line); background: var(--sidebar);
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0; }
.brand-mark {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px; object-fit: cover;
  background: #195dc4; box-shadow: 0 6px 14px #1a5cb646;
}
.install-app { width: 100%; margin-block-start: 12px; }
.install-app .ui-icon { width: 17px; height: 17px; }
.brand strong, .brand small, .side-account a small { display: block; }
.brand strong { font-size: 1.14rem; }
.brand small, .side-account a small { margin-top: 3px; color: var(--muted); font-size: .77rem; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 5px 24px; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.sidebar-close { display: none; }
.nav-home, .nav-group summary, .nav-group a {
  display: flex; gap: .6rem; align-items: center; min-height: 43px; padding: 7px 10px;
  border-radius: 9px; font-size: .9rem; color: var(--muted); font-weight: 650;
}
.nav-group summary { cursor: pointer; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary .ui-icon, .nav-home .ui-icon { width: 18px; height: 18px; }
.nav-group summary:hover, .nav-group[open] > summary { color: var(--text); background: var(--surface-alt); }
.nav-group.current > summary { color: var(--brand); }
.nav-chevron { margin-inline-start: auto; display: grid; place-items: center; }
.nav-chevron .ui-icon { width: 15px; height: 15px; }
.nav-group[open] .nav-chevron { transform: rotate(180deg); }
.nav-links { display: grid; gap: 2px; margin: 4px 0; padding-inline-start: 6px; margin-inline-start: 18px; border-inline-start: 1px solid var(--line); }
.nav-group a { min-height: 36px; padding-inline: 8px; font-weight: 550; font-size: .85rem; }
.nav-group a i { display: inline-grid; width: 1.2rem; place-items: center; font-style: normal; font-size: 1.12rem; }
.nav-home:hover, .nav-home.active, .nav-group a:hover, .nav-group a.active { background: var(--brand-soft); color: var(--brand); }
.nav-group a.active, .nav-home.active { font-weight: 800; }
.side-account { border-top: 1px solid var(--line); padding-block-start: 12px; margin-block-start: 14px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.side-account a { min-width: 0; display: flex; gap: 8px; align-items: center; font-size: .85rem; }
.avatar { display: grid; flex: 0 0 28px; height: 28px; place-items: center; background: var(--brand-soft); border-radius: 50%; }
.workspace { min-width: 0; }
.topbar {
  height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-inline: clamp(16px, 3vw, 37px); border-bottom: 1px solid var(--line); background: var(--surface);
  font-size: .86rem;
}
.topbar > div { display: flex; gap: 10px; align-items: center; }
.topbar a, .topbar span { color: var(--muted); }
.top-context { min-width: 0; }
.top-context b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-meta { flex: 0 0 auto; position: relative; }
.top-preference, .top-logout { margin: 0; }
.icon-control {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 39px; min-height: 39px;
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-alt); color: var(--text);
}
.icon-control:hover, .icon-control:focus-visible { background: var(--brand-soft); color: var(--brand); }
.icon-control:disabled { opacity: .65; cursor: wait; }
.icon-control .ui-icon { width: 18px; height: 18px; display: block; }
.language-control { font-size: .83rem; font-weight: 650; }
.logout-control span { color: inherit; font-weight: 650; }
.preference-error { position: absolute; inset-block-start: calc(100% + 5px); inset-inline-end: 0; min-width: max-content; z-index: 4; }
#main { max-width: 1600px; padding: 30px clamp(16px, 3vw, 37px) 50px; margin-inline: auto; }
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-block-end: 20px;
  min-height: 92px; padding: 15px 20px; border: 1px solid var(--line); border-radius: 13px;
  background: linear-gradient(111deg, var(--surface), var(--surface-alt)); border-inline-start: 3px solid var(--brand);
}
.page-head p { margin-block-start: 6px; color: var(--muted); font-size: .89rem; }
.head-actions, .row-actions, .form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 13px;
  border: 1px solid transparent; border-radius: 8px; font-size: .84rem; line-height: 1.2; font-weight: 650;
  white-space: nowrap; background: transparent; color: var(--text);
}
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.secondary, .btn.icon-btn { background: var(--surface); border-color: var(--line); }
.btn.secondary:hover, .btn.icon-btn:hover, .btn.subtle:hover { background: var(--brand-soft); }
.btn.subtle { min-height: 29px; padding: 4px 7px; color: var(--muted); }
.btn.danger { color: var(--red); background: var(--red-bg); }
.btn.danger:hover { border-color: var(--red); }
.head-actions .btn { min-height: 39px; }
.dashboard-calendar {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-block-end: 15px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--surface);
}
.calendar-item { display: flex; align-items: center; gap: 11px; padding: 13px 16px; min-width: 0; }
.calendar-item + .calendar-item { border-inline-start: 1px solid var(--line); }
.calendar-icon { display: grid; flex: 0 0 37px; height: 37px; place-items: center; border-radius: 10px; color: var(--brand); background: var(--brand-soft); }
.calendar-item div > span { display: block; font-size: .8rem; color: var(--muted); margin-block-end: 2px; }
.calendar-item time { display: block; font-size: clamp(1rem,1.75vw,1.35rem); font-weight: 750; font-variant-numeric: tabular-nums; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-block-end: 16px; }
.metric, .panel { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 3px 12px #112c4d09; }
.metric { display: grid; gap: 6px; padding: 16px; }
.metric > span:nth-child(2) { color: var(--muted); font-size: .85rem; }
.metric strong { font-size: clamp(1rem, 1.7vw, 1.46rem); }
.metric-icon, .cash-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; font-weight: 800; }
.accent, .cash-icon { color: var(--brand); background: var(--brand-soft); }
.mint { color: var(--green); background: var(--green-bg); }
.blue { color: var(--blue); background: var(--blue-bg); }
.peach, .cash-icon.peach { color: var(--amber); background: var(--amber-bg); }
.panel { padding: 18px; margin-block-end: 15px; min-width: 0; }
.panel > p { margin-block-end: 12px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 15px; }
.chart-meta { display: flex; justify-content: space-between; gap: 9px; color: var(--muted); font-size: .77rem; flex-wrap: wrap; }
.chart-meta > div { display: flex; gap: 12px; }
.dot { display: inline-block; vertical-align: middle; margin-inline-end: 4px; width: 8px; height: 8px; border-radius: 50%; }
.dot.sales { background: var(--brand); }
.dot.purchases { background: var(--chart-secondary); }
.trend-chart { position: relative; width: 100%; height: 225px; margin-block-start: 12px; }
.balance-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.balance-row small, .cell-note { display: block; color: var(--muted); font-size: .76rem; margin-block-start: 3px; }
.balance-row .money small { display: inline; margin: 0; }
.panel-footer { padding-block-start: 9px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money small { font-size: .73em; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: start; font-size: .87rem; }
td, th { padding: 9px 11px; text-align: start; border-bottom: 1px solid var(--line); }
th { background: var(--surface-alt); color: var(--muted); font-size: .82rem; font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.table-filters { margin-block-end: 10px; }
.record-table.has-live-table .table-fallback { display: none; }
.record-table,
#main .summary-table-frame {
  --grid-header: color-mix(in srgb, var(--surface-alt), var(--brand-soft) 48%);
  --grid-stripe: color-mix(in srgb, var(--surface), var(--surface-alt) 62%);
  --grid-hover: color-mix(in srgb, var(--surface), var(--brand-soft) 62%);
  --grid-rule: color-mix(in srgb, var(--line), var(--surface) 20%);
}
.record-table .dt-container { color: var(--text); }
.record-table:not(.has-live-table) .table-wrap,
.record-table .dt-layout-table > .dt-layout-cell,
#main .summary-table-frame {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  scrollbar-width: thin; scrollbar-color: var(--line) var(--surface);
}
.record-table .table-wrap:has(> .dt-container) { overflow: visible; }
.record-table .table-scrollable:focus-visible,
#main .summary-table-frame:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.record-table table.records-grid, #main .summary-table-frame > table {
  width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: .88rem;
}
.record-table table.grid-wide { min-inline-size: 41rem; }
.record-table table.prices-grid { min-inline-size: 33rem; }
.record-table .prices-grid > :is(thead,tbody) > tr > :nth-child(2) { min-inline-size: 3rem; width: 1%; text-align: center; }
.prices-grid > :is(thead,tbody) > tr > :nth-child(3) { min-inline-size: 9rem; }
.prices-grid > :is(thead,tbody) > tr > :nth-child(n+4) { width: 26%; }
.prices-grid [data-price-row] { inline-size: 1.1rem; block-size: 1.1rem; margin: 0; vertical-align: middle; cursor: pointer; }
.prices-grid tr.price-edited { --grid-row: var(--grid-hover); }
.prices-grid .price-cell { display: grid; grid-template-columns: minmax(5.5rem, 1fr) 4.5rem; gap: 6px; }
.prices-grid .price-cell :is(input,select) { min-height: 36px; padding: 5px 8px; }
.price-cell input { text-align: right; font-variant-numeric: tabular-nums; }
.price-cell select { direction: ltr; font-size: .8rem; }
.pricing-tools {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr)); gap: 12px;
}
.pricing-tool { min-inline-size: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-alt); }
.pricing-tool h2 { margin-block-end: 10px; font-size: .91rem; }
.pricing-tool-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) auto; align-items: end; gap: 8px; }
.pricing-tool-fields .btn { min-height: 38px; text-align: center; }
[data-price-form] .pricing-tool-fields { grid-template-columns: repeat(3,minmax(0,1fr)); }
.price-adjust-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.price-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-block: 12px; margin-block-end: 12px; border-bottom: 1px solid var(--line); }
.price-status { display: flex; flex-wrap: wrap; gap: 6px; margin-inline-end: auto; }
.price-status span { padding: 4px 9px; border-radius: 20px; background: var(--surface-alt); color: var(--muted); font-size: .78rem; }
.price-status .has-price-drafts { background: var(--brand-soft); color: var(--brand); }
.price-actions .btn:disabled { opacity: .55; cursor: default; }
.pricing-tools:not(:has([data-price-form]:not([hidden]))) { margin-block-end: 12px; }
.record-table table.records-grid > thead > tr > th, #main .summary-table-frame th {
  padding: 12px 14px; color: var(--text); font-size: .8rem; font-weight: 750;
  background: var(--grid-header); border-bottom: 1px solid var(--line); text-align: start;
}
.records-grid > tbody > tr > td, #main .summary-table-frame td {
  padding: 10px 14px; height: 46px; vertical-align: middle; border-bottom: 1px solid var(--grid-rule);
  background: var(--grid-row, var(--surface)); overflow-wrap: anywhere;
}
.records-grid > tbody > tr:nth-child(even), #main .summary-table-frame tbody tr:nth-child(even) { --grid-row: var(--grid-stripe); }
.records-grid > tbody > tr:hover, .records-grid > tbody > tr:focus-within,
#main .summary-table-frame tbody tr:hover { --grid-row: var(--grid-hover); }
.record-table div.dt-container.dt-empty-footer .records-grid > tbody > tr:last-child > td,
.records-grid > tbody > tr:last-child > td, #main .summary-table-frame tbody tr:last-child td { border-bottom: 0; }
.record-table .records-grid .dt-column-header { justify-content: flex-start; gap: 8px; }
.record-table .records-grid .row-number .dt-column-header { justify-content: center; }
.records-grid > thead > tr > th[aria-sort] { color: var(--brand); }
.records-grid > thead > tr > th:is(.dt-orderable-asc,.dt-orderable-desc) { cursor: pointer; }
.records-grid > thead > tr > th:is(.dt-orderable-asc,.dt-orderable-desc):hover { background: var(--brand-soft); }
.records-grid > thead .dt-column-order { color: var(--brand); }
.table-scrollable > .grid-wide > thead > tr > th:nth-child(2),
.table-scrollable > .grid-wide > tbody > tr > td:nth-child(2) {
  position: sticky; inset-inline-start: 0; z-index: 1; min-inline-size: 7rem; max-inline-size: 11rem;
  border-inline-end: 1px solid var(--line);
}
.table-scrollable > .prices-grid > :is(thead,tbody) > tr > :is(th,td):nth-child(2) {
  min-inline-size: 3rem; max-inline-size: 4rem;
}
.records-grid .money, .table-code { font-weight: 650; }
:is(th, td).row-number, #main :is(.records-grid, .summary-table-frame, .cart-table) .row-number {
  width: 1%; padding-inline: 8px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums;
}
td.row-number { color: var(--muted); }
.table-code {
  display: inline-block; max-inline-size: 12rem; border-radius: 6px; padding: 2px 7px; background: var(--surface-alt);
  color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; vertical-align: middle;
}
.records-grid .row-actions { gap: 4px; flex-wrap: nowrap; }
.records-grid .row-actions .btn {
  min-height: 30px; padding-inline: 9px; background: var(--surface); color: var(--muted); border-color: var(--line);
}
.records-grid .row-actions .btn:hover { background: var(--brand-soft); color: var(--text); border-color: var(--brand); }
.records-grid .row-actions .btn.danger { color: var(--red); background: var(--red-bg); }
.records-grid .badge { padding: 4px 9px; gap: 5px; font-weight: 650; }
.records-grid .badge::before {
  content: ""; flex: 0 0 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75;
}
.record-table .records-grid > tbody > tr > .dt-empty {
  padding: 33px 15px; color: var(--muted); text-align: center; background: var(--surface);
}
.record-table div.dt-container div.dt-layout-row:not(.dt-layout-table) {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px 14px;
}
.record-table div.dt-container div.dt-layout-row.dt-layout-table { margin-block: 10px 0; }
.record-table div.dt-container div.dt-layout-row:last-child:not(.dt-layout-table) {
  margin-block: 0; padding-block-start: 10px; min-height: 46px;
}
.record-table div.dt-container div.dt-layout-row:not(.dt-layout-table) div.dt-layout-cell {
  display: flex; width: auto; margin: 0; text-align: start;
}
.record-table div.dt-container div.dt-layout-row:not(.dt-layout-table) div.dt-layout-cell > * { margin: 0; }
.record-table .dt-container .dt-layout-row:first-child { margin-block-start: 0; }
.record-table .dt-search, .record-table .dt-length { display: flex; align-items: center; gap: 8px; font-size: .85rem; white-space: nowrap; }
.record-table .dt-search label { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.record-table .dt-search, .grid-search { position: relative; }
.record-table .dt-search::before, .grid-search::before,
.record-table .dt-search::after, .grid-search::after {
  position: absolute; content: ""; pointer-events: none; color: var(--muted);
}
.record-table .dt-search::before, .grid-search::before {
  inset-inline-start: 12px; inset-block-start: calc(50% - 7px); width: 11px; height: 11px;
  border: 1.5px solid currentColor; border-radius: 50%;
}
.record-table .dt-search::after, .grid-search::after {
  inset-inline-start: 21px; inset-block-start: calc(50% + 3px); width: 6px; height: 1.5px; background: currentColor;
  transform: rotate(45deg); border-radius: 2px;
}
[dir="rtl"] .record-table .dt-search::after, [dir="rtl"] .grid-search::after { transform: rotate(-45deg); }
.record-table .dt-container .dt-search input, .record-table .dt-container .dt-length select {
  background: var(--surface-alt); color: var(--text); border: 1px solid var(--line); border-radius: 9px; margin: 0; min-height: 38px;
}
.record-table .dt-container .dt-search input, .search-bar .grid-search input {
  width: min(34vw, 18rem); padding-inline: 34px 10px;
}
.record-table .dt-length select { width: auto; padding-inline: 8px; }
.record-table .dt-info { color: var(--muted); font-size: .81rem; }
.record-table .dt-container .dt-paging nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.record-table .dt-container .dt-paging .dt-paging-button {
  display: inline-grid; place-items: center; min-width: 34px; min-height: 34px; margin: 0; padding: 3px 7px;
  border-radius: 8px; border: 1px solid var(--line); font-size: .84rem; background: var(--surface); box-shadow: none;
}
.record-table .dt-container .dt-paging .dt-paging-button:is(.previous,.next) { font-size: 1.2rem; }
.record-table .dt-container .dt-paging .dt-paging-button.disabled { opacity: .62; }
.record-table .dt-container .dt-paging .dt-paging-button.current {
  background: var(--brand); color: var(--on-brand) !important; border-color: var(--brand); font-weight: 750;
}
.record-table .dt-container .dt-paging .dt-paging-button:not(.disabled,.current):hover {
  background: var(--brand-soft); color: var(--brand) !important; border-color: var(--brand);
}
.record-table .dt-container .dt-processing {
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 5px 18px #10274a24;
}
.text-link { color: var(--brand); font-weight: 750; }
.text-link:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 20px; font-size: .76rem; background: var(--surface-alt); color: var(--muted); white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.empty { min-height: 105px; display: grid; place-content: center; justify-items: center; gap: 3px; text-align: center; color: var(--muted); font-size: .86rem; }
.empty > span { color: var(--brand); font-size: 1.35rem; }
.alert { margin-block-end: 15px; border-radius: 10px; padding: 12px 14px; background: var(--green-bg); color: var(--green); }
.alert.error { background: var(--red-bg); color: var(--red); }
.was-validated .is-invalid { border-color: var(--red); }
.was-validated .is-invalid:focus { outline-color: var(--red); }
.was-validated .invalid-feedback { display: block; color: var(--red); font-size: .79rem; line-height: 1.45; }
.was-validated td > .invalid-feedback { margin-block-start: 4px; }
.was-validated .check:has(.invalid-feedback) { flex-wrap: wrap; }
.was-validated .check > .invalid-feedback { flex-basis: 100%; }
.swal2-popup { font-family: inherit; }
.muted, small.muted { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; align-items: start; }
.record-dialog {
  --record-form-columns: 2;
  width: 100%; max-width: 43rem; margin: 0 auto 15px; padding: 0; overflow: visible;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text);
}
.record-dialog:where(.record-dialog-wide, :has(.form-grid > :nth-child(4 of .field, .check))) {
  --record-form-columns: 3;
  max-width: 72rem;
}
.record-dialog:modal {
  display: flex; flex-direction: column; width: calc(100% - 28px); max-height: calc(100dvh - 28px); margin: auto;
  box-shadow: 0 24px 72px #07172a66;
}
.record-dialog::backdrop { background: #07172a96; }
html:has(.record-dialog:modal) { overflow: hidden; }
.record-dialog-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding: 16px 20px; border-block-end: 1px solid var(--line); border-radius: 16px 16px 0 0; background: var(--surface-alt);
}
.record-dialog-header h2 { color: var(--text); font-size: 1.17rem; line-height: 1.5; }
.record-dialog-header p { color: var(--muted); font-size: .84rem; margin-block-start: 3px; overflow-wrap: anywhere; }
.record-dialog-close { flex: 0 0 auto; }
.record-dialog-body { min-height: 0; padding: 18px 20px; }
.record-dialog:modal .record-dialog-body { overflow: auto; overscroll-behavior: contain; }
.record-dialog .form-grid { grid-template-columns: repeat(var(--record-form-columns),minmax(0,1fr)); }
.record-dialog-actions { border-block-start: 1px solid var(--line); padding-block-start: 14px; margin-block-start: 6px; }
.record-dialog .invoice-editor { margin: 0; }
.record-dialog .invoice-editor > .panel:last-child { margin-block-end: 0; }
.return-lines { margin-block-end: 16px; }
.return-lines table { min-width: 37rem; }
.return-lines input[data-return-line] { min-width: 5rem; max-width: 8rem; }
.return-payment .summary-strip { margin-block-end: 0; }
.record-dialog .swal2-confirm { background: var(--brand); color: var(--on-brand); }
[data-record-dialog-link][aria-busy="true"] { opacity: .7; cursor: progress; }
@media (max-width: 740px) {
  .record-dialog { --record-form-columns: 2; }
}
@media (max-width: 560px) {
  .record-dialog { --record-form-columns: 1; }
  .record-dialog:modal { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .record-dialog-header, .record-dialog-body { padding-inline: 13px; }
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .choice-field > label { color: var(--muted); font-size: .82rem; font-weight: 630; }
.choice-control { position: relative; display: flex; align-items: stretch; gap: 5px; }
.choice-control > select { flex: 1 1 auto; text-overflow: ellipsis; }
.searchable-choice > select { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; padding: 0; }
.choice-search-toggle {
  display: flex; width: 100%; min-width: 0; min-height: 38px; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text);
  font: inherit; text-align: start;
}
.choice-search-toggle > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.choice-search-toggle .ui-icon { width: 16px; height: 16px; color: var(--muted); }
.choice-search-toggle[aria-expanded="true"] { background: var(--surface-alt); border-color: var(--brand); }
.choice-search-panel {
  position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 6; padding: 7px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 9px 22px #10274838;
}
.choice-results { max-height: min(36vh, 220px); overflow-y: auto; margin-block-start: 4px; }
.choice-results > button {
  display: block; width: 100%; padding: 6px 8px; min-height: 33px; border: 0; border-radius: 5px;
  color: var(--text); background: transparent; font-size: .85rem; text-align: start; overflow-wrap: anywhere;
}
.choice-results > button:is(:hover,:focus-visible,[aria-current]) { background: var(--brand-soft); color: var(--text); }
.choice-empty { padding: 6px 8px 3px; font-size: .82rem; color: var(--muted); }
.wide { grid-column: 1 / -1; }
input:not([type="checkbox"]):not([type="hidden"]), select, textarea {
  min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
  background: var(--surface); color: var(--text); width: 100%; min-width: 0;
}
input[type="checkbox"] { accent-color: var(--brand); }
textarea { resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; }
.settings-tabs { display: flex; gap: 7px; margin-block-end: 16px; border-bottom: 1px solid var(--line); }
.settings-tabs a { padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 650; }
.settings-tabs a:hover, .settings-tabs a[aria-current] { color: var(--brand); border-bottom-color: var(--brand); }
.print-settings-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,225px),1fr)); gap: 14px; margin: 14px 0 18px; }
.check-group { margin: 0; padding: 9px 12px 12px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-alt); }
.check-group legend { padding-inline: 5px; font-weight: 750; }
.check-group .check { padding-block: 5px; cursor: pointer; }
.unframed { border: 0; margin: 0; padding: 0; min-width: 0; }
.search-bar, .date-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-block: 0 14px; }
.date-filter > label { min-width: 145px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-block-start: 10px; color: var(--muted); }
.summary-strip { display: flex; justify-content: space-between; gap: 15px; padding: 13px; background: var(--surface-alt); border-radius: 12px; margin-block-end: 13px; flex-wrap: wrap; }
.summary-strip span, .summary-strip strong { display: block; }
.summary-strip span { color: var(--muted); font-size: .82rem; margin-block-end: 5px; }
.statement-identity { display: flex; gap: 8px 22px; flex-wrap: wrap; color: var(--muted); margin-block-end: 14px; }
.statement-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr)); gap: 10px; }
.statement-summary > div {
  display: grid; align-content: start; gap: 5px; padding: 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface-alt);
}
.statement-summary > div > span, .statement-summary small { color: var(--muted); font-size: .82rem; }
.statement-summary strong { font-size: 1.1rem; }
.paper .statement-summary { margin-block: 14px 18px; }
.paper .summary-table-frame { margin-block-end: 18px; }
.routine summary { cursor: pointer; color: var(--brand); font-size: .82rem; white-space: nowrap; }
.routine form { min-width: min(225px, 65vw); margin-block-start: 9px; }
.routine .field { margin-block-end: 5px; }
.danger-zone summary { color: var(--red); }
.lookup { position: relative; max-width: 520px; margin-block-end: 15px; }
.lookup-results {
  position: absolute; z-index: 2; overflow: auto; max-height: 300px; margin-top: 5px; width: 100%; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); box-shadow: 0 12px 34px #112c4d32;
}
.lookup-results button { width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: start; }
.lookup-results button:not(:disabled):hover, .lookup-results button[data-active="true"] { background: var(--brand-soft); }
.lookup-results button:disabled { color: var(--muted); cursor: default; }
.lookup-results > p { padding: 10px; color: var(--muted); }
.cart-table td, .cart-table th { padding-inline: 6px; }
.cart-table td:nth-child(2) { min-width: 135px; }
.cart-table select { min-width: 86px; }
.cart-table input { min-width: 78px !important; }
.cart-table [type="date"] { min-width: 130px !important; }
.document-meta, .document-totals { display: grid; gap: 7px; margin-block: 0 13px; }
.document-meta { grid-template-columns: 1fr 1fr; }
.document-meta div, .document-totals div { display: flex; gap: 8px; justify-content: space-between; }
.document-meta div { justify-content: start; flex-wrap: wrap; }
.document-meta dt, .document-totals dt { color: var(--muted); }
.document-meta dd, .document-totals dd { margin: 0; font-weight: 650; }
.document-totals { margin-block-start: 14px; margin-inline-start: auto; max-width: 360px; }
.document-totals .document-grand-total { border-block: 1px solid var(--line); padding-block: 7px; }
.document-note { white-space: pre-wrap; }
.auth { background: radial-gradient(ellipse at 50% 5%, var(--brand-soft), var(--bg) 65%); }
.auth-frame { min-block-size: 100vh; min-block-size: 100dvh; display: flex; padding: 18px; }
.auth-card {
  width: min(100%,800px); min-height: 410px; margin: auto; display: grid; grid-template-columns: .9fr 1.1fr;
  background: var(--surface); border: 1px solid var(--line); border-radius: 21px; overflow: hidden; box-shadow: 0 18px 65px #153a6224;
}
.auth-brand {
  position: relative; display: flex; flex-direction: column; gap: 22px; padding: 32px; overflow: hidden;
  color: #fff; background:
    radial-gradient(ellipse at 95% 80%, #64b4ff91, transparent 68%),
    linear-gradient(145deg, #103b86, #1a66cb 68%, #2581e4);
}
.auth-brand .brand { z-index: 1; }
.auth-brand .brand small { color: #dfeeff; }
.auth-brand .brand-mark { background: #ffffff25; border: 1px solid #ffffff48; box-shadow: none; }
.auth-emblem {
  position: absolute; inset-block-start: 52%; inset-inline-start: 50%; translate: -50% -50%;
  width: 155px; aspect-ratio: 1; border-radius: 38px; background: #d8ecff23; border: 1px solid #e1f3ff65;
  box-shadow: 0 0 0 16px #c9e7ff12, 0 0 0 34px #c9e7ff0c; transform: rotate(-12deg);
}
[dir="rtl"] .auth-emblem { translate: 50% -50%; }
.auth-emblem::before, .auth-emblem::after {
  content: ""; position: absolute; top: 50%; left: 50%; translate: -50% -50%; background: #e2f1ff; border-radius: 5px;
}
.auth-emblem::before { width: 68px; height: 21px; }
.auth-emblem::after { width: 21px; height: 68px; }
.auth-content { align-self: center; padding: 38px clamp(24px,4.6vw,50px); }
.auth-content h1 { font-size: clamp(1.5rem,2.5vw,1.85rem); margin-block-end: 25px; }
.auth-form { display: grid; gap: 15px; }
.auth-form .field > label { color: var(--text); font-weight: 650; font-size: .86rem; }
.auth-input { position: relative; }
.auth-form .auth-input input { min-height: 45px; padding-inline: 44px; background: var(--surface-alt); }
.input-icon, .password-visibility { position: absolute; inset-block: 0; display: grid; place-items: center; width: 40px; color: var(--muted); }
.input-icon { inset-inline-start: 2px; pointer-events: none; }
.password-visibility { inset-inline-end: 2px; border: 0; border-radius: 8px; background: transparent; padding: 0; }
.password-visibility:hover { color: var(--brand); }
.auth-input input::-ms-reveal { display: none; }
.auth-submit { gap: 8px; min-height: 45px; width: 100%; margin-block-start: 5px; }
.print-controls { max-width: 800px; margin: 12px auto; display: flex; gap: 7px; justify-content: center; }
.paper { background: #fff; width: min(calc(100% - 24px), 190mm); margin: 0 auto 15px; padding: 18px; color: #171620; }
.paper header { text-align: center; margin-block-end: 15px; border-bottom: 1px solid #bbb; }
.paper header p { margin-block: 2px; }
.paper header > :last-child { margin-block-end: 9px; }
.paper h1 { font-size: 1.65rem; }
.paper.thermal, .thermal .paper { width: min(calc(100% - 12px), 80mm); font-size: 10px; padding: 4mm; }
.thermal .paper h1 { font-size: 16px; }
.thermal .paper h2 { font-size: 13px; margin-block-end: 5px; }
.thermal .document-meta { grid-template-columns: auto; gap: 3px; }
.thermal table, .thermal th { font-size: 9px; }
.thermal td, .thermal th { padding: 4px 3px; }
.thermal td:first-child { overflow-wrap: anywhere; }
.thermal td:not(:first-child) .money small { display: none; }
.thermal .document-totals { gap: 3px; }
@media (max-width: 990px) {
  .shell { grid-template-columns: 200px minmax(0,1fr); }
  .sidebar { padding-inline: 10px; }
  .dash-grid { grid-template-columns: 1fr; gap: 0; }
  .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { display: none; position: fixed; inset: 0 auto 0 0; z-index: 5; width: min(260px,85vw); box-shadow: 0 0 0 100vmax #0c1d366b; }
  [dir="rtl"] .sidebar { inset: 0 0 0 auto; }
  .sidebar.open { display: flex; }
  body.nav-open { overflow: hidden; }
  .sidebar-close { display: inline-grid; place-items: center; }
  .sidebar-close { border: 0; padding: 8px; border-radius: 8px; background: var(--surface-alt); color: var(--muted); }
  .topbar { height: 52px; }
  #main { padding-block-start: 20px; }
  .page-head { align-items: start; flex-direction: column; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric, .panel { padding: 12px; }
  .record-table .dt-container .dt-search input, .search-bar .grid-search input { width: min(45vw, 14rem); }
}
@media (max-width: 575px) {
  .pricing-tool-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  [data-price-form] .pricing-tool-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  [data-price-form] .pricing-tool-fields > .field:nth-of-type(3) { grid-column: 1 / -1; }
  .pricing-tool-fields > .btn { grid-column: 1 / -1; }
  .price-actions > [data-save-prices] { inline-size: 100%; }
  .record-table table.prices-grid { min-inline-size: 28rem; }
  .prices-grid > :is(thead,tbody) > tr > :nth-child(3) { min-inline-size: 7rem; }
  .prices-grid .price-cell { grid-template-columns: minmax(4.3rem, 1fr) 3.5rem; gap: 4px; }
  .prices-grid .price-cell :is(input,select) { padding-inline: 5px; }
  .record-table table.prices-grid > :is(thead,tbody) > tr > :is(th,td) { padding-inline: 8px; }
  .topbar { gap: .55rem; }
  .topbar > div { gap: 6px; }
  .top-context > a, .top-context > span { display: none; }
  .logout-control > span { display: none; }
  .dashboard-calendar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .calendar-item:first-child { grid-column: 1 / -1; border-block-end: 1px solid var(--line); }
  .calendar-item:nth-child(2) { border-inline-start: 0; }
  .calendar-item { padding: 11px; gap: 7px; }
  .calendar-icon { flex-basis: 32px; height: 32px; }
  .calendar-icon .ui-icon { width: 17px; height: 17px; }
  .auth-card { max-width: 420px; grid-template-columns: 1fr; min-height: 0; }
  .auth-brand { min-height: 97px; padding: 21px 23px; justify-content: center; }
  .auth-emblem { inset-inline-start: auto; inset-inline-end: -16px; inset-block-start: 58%; translate: 0 -50%; width: 103px; }
  [dir="rtl"] .auth-emblem { translate: 0 -50%; }
  .auth-emblem::before { width: 48px; height: 15px; }
  .auth-emblem::after { width: 15px; height: 48px; }
  .auth-content { padding: 29px 23px; }
}
@media (max-width: 390px) {
  .form-grid { grid-template-columns: 1fr; }
  .brand small { font-size: .73rem; }
  .record-table .dt-layout-row:first-child .dt-layout-cell:first-child,
  .record-table .dt-layout-row:first-child .dt-search { width: 100% !important; }
  .record-table .dt-container .dt-search input { width: 100%; }
}
