/*
 * TreasuryWindow / TreasuryTransactionDialog / TreasuryTypeDialog /
 * TreasuryCashboxTransferDialog / EmployeeCashboxAssignmentsDialog /
 * TreasuryStatisticsWindow / TreasuryReportsWindow (offline PySide6 source).
 *
 * Visual-only Qt geometry overlay. All financial data, permissions and
 * mutation handling remain in the existing authorized Cloud components.
 * Keep this stylesheet after qt-shell.css and qt-offline-layout.css.
 */
body.qt-desktop-mode .qt-treasury {
  gap:10px;
  color:#173e6a;
  background:#f6f9fc;
}
body.qt-desktop-mode .qt-treasury-toolbar {
  background:transparent;
  border:0;
  border-radius:0;
  padding:0;
  gap:7px;
  min-height:44px;
  flex-basis:auto;
  justify-content:center;
}
body.qt-desktop-mode .qt-treasury-toolbar > .qt-treasury-button {
  min-height:44px;
  height:44px;
  border-radius:7px;
}
body.qt-desktop-mode .qt-treasury-filter {
  border:1px solid #d7e2ee;
  border-radius:10px;
  padding:9px 12px;
  background:#fff;
  gap:7px;
}
body.qt-desktop-mode .qt-treasury-filter-row > span {
  color:#294968;
  font-weight:600;
}
body.qt-desktop-mode .qt-treasury-filter-row input,
body.qt-desktop-mode .qt-treasury-filter-row select {
  background:#fff;
  color:#173e6a;
  border:1px solid #c9d7e6;
  border-radius:7px;
  padding-inline:9px;
  min-height:36px;
  height:36px;
}
body.qt-desktop-mode .qt-treasury-filter-row input:focus-visible,
body.qt-desktop-mode .qt-treasury-filter-row select:focus-visible {
  outline:1px solid #2e74b5;
  outline-offset:0;
  border-color:#2e74b5;
}
body.qt-desktop-mode .qt-treasury-shortcuts .qt-treasury-button.quick {
  min-height:34px;
  height:34px;
  min-width:unset;
  padding-inline:12px;
  font-size:12px;
  font-weight:600;
  border:1px solid #d2deea;
  background:#fff;
  border-radius:7px;
}
body.qt-desktop-mode .qt-treasury-shortcuts .qt-treasury-button.quick:hover:not(:disabled) {
  background:#eff6fd;
  border-color:#9fc2e6;
}
body.qt-desktop-mode .qt-treasury-filter > .qt-treasury-filter-actions {
  justify-content:flex-end;
}
body.qt-desktop-mode .qt-treasury-result .qt-treasury-scroll {
  background:#fff;
  border:1px solid #d5e1ed;
  border-radius:9px;
  min-width:0;
}
body.qt-desktop-mode .qt-treasury-result .qt-treasury-table {
  min-width:1210px; /* 78+86+120+135+250+125+105+155+78+78 Qt columns */
  table-layout:fixed;
  border-collapse:collapse;
}
body.qt-desktop-mode .qt-treasury-result .qt-treasury-table thead th {
  background:#244f80;
  color:#fff;
  border:0;
  border-inline-start:1px solid #3d6793;
  padding:8px 6px;
  font-weight:700;
}
body.qt-desktop-mode .qt-treasury-result .qt-treasury-table thead th:hover {
  background:#2c5c92;
}
body.qt-desktop-mode .qt-treasury-result .qt-treasury-table tbody td {
  box-sizing:border-box;
  height:36px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding:5px 8px;
  color:#173e6a;
  border:1px solid #dde7f1;
  border-bottom:1px solid #e7eef6;
}
body.qt-desktop-mode .qt-treasury-result .qt-treasury-table tbody tr:nth-child(even) {
  background:#f8fbff;
}
body.qt-desktop-mode .qt-treasury-result .qt-treasury-table tbody tr:hover {
  background:#e8f2fc;
}
body.qt-desktop-mode .qt-treasury-empty-state {
  border:1px solid #d7e2ee;
  border-radius:10px;
}
body.qt-desktop-mode .qt-treasury-empty-icon {
  width:58px;
  height:58px;
  border-radius:50%;
  border:1px solid #d5e6f7;
  background:#edf5fd;
  color:#2b5c8f;
  font-size:25px;
  font-weight:800;
}
body.qt-desktop-mode .qt-treasury-empty-state h2 {color:#173e6a;font-weight:800}
body.qt-desktop-mode .qt-treasury-empty-state p {color:#6d8297}
body.qt-desktop-mode .qt-treasury-pager {
  min-height:52px;
  border:1px solid #d7e2ee;
  border-radius:9px;
}
body.qt-desktop-mode .qt-treasury-page-count {
  background:#1e64a3;
  color:#fff;
  border-radius:6px;
  padding:7px 13px;
  font-weight:700;
}
body.qt-desktop-mode .qt-treasury-total-label {
  color:#294968;
  font-weight:700;
}
body.qt-desktop-mode .qt-treasury-totals,
body.qt-desktop-mode .qt-treasury-types-group {
  border:1px solid #d7e2ee;
  border-radius:10px;
  background:#fff;
  padding:12px 10px 10px;
}
body.qt-desktop-mode .qt-treasury-stat-list {gap:10px}
body.qt-desktop-mode .qt-treasury-stat {min-height:72px;border-radius:9px}
body.qt-desktop-mode .qt-treasury-types {max-height:72px}

/* Desktop QDialogs use distinct dimensions, not a single generic 990px modal. */
body.qt-desktop-mode .qt-treasury-backdrop .qt-treasury-modal {
  box-sizing:border-box;
  width:min(var(--qt-treasury-dialog-width,990px),calc(100vw - 32px));
  max-width:calc(100vw - 32px);
  min-height:min(var(--qt-treasury-dialog-height,0px),calc(100dvh - 32px));
  max-height:calc(100dvh - 32px);
  padding:16px;
  direction:rtl;
  overflow:auto;
  background:#fff;
  border:1px solid #c9d7e6;
  border-radius:9px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-modal {
  --qt-treasury-dialog-width:500px;
  --qt-treasury-dialog-height:450px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="payment"] .qt-treasury-modal {
  --qt-treasury-dialog-width:600px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="types"] .qt-treasury-modal {
  --qt-treasury-dialog-width:980px;
  --qt-treasury-dialog-height:520px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transfer"] .qt-treasury-modal {
  --qt-treasury-dialog-width:660px;
  --qt-treasury-dialog-height:450px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="assignments"] .qt-treasury-modal {
  --qt-treasury-dialog-width:830px;
  --qt-treasury-dialog-height:570px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="statistics"] .qt-treasury-modal {
  --qt-treasury-dialog-width:1000px;
  --qt-treasury-dialog-height:680px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="reports"] .qt-treasury-modal {
  --qt-treasury-dialog-width:1100px;
}
body.qt-desktop-mode .qt-treasury-modal-heading {
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;border-bottom:1px solid #d7e2ee;padding:0 0 10px;margin:0 0 12px;
}
body.qt-desktop-mode .qt-treasury-modal-heading h2 {
  margin:0;color:#244875;font-size:18px;font-weight:800;
}
body.qt-desktop-mode .qt-treasury-modal :is(input,select,textarea):focus-visible {
  outline:2px solid #2e74b5;
  outline-offset:1px;
}
@media(max-width:1080px){
 body.qt-desktop-mode .qt-treasury-toolbar {justify-content:flex-start}
 body.qt-desktop-mode .qt-treasury-stat-list {grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:650px){
 body.qt-desktop-mode .qt-treasury-toolbar {justify-content:flex-start}
 body.qt-desktop-mode .qt-treasury-stat-list {grid-template-columns:repeat(2,minmax(0,1fr))}
 body.qt-desktop-mode .qt-treasury-filter > .qt-treasury-filter-actions {justify-content:flex-start;flex-wrap:wrap}
 body.qt-desktop-mode .qt-treasury-backdrop .qt-treasury-modal {padding:11px}
}


/* TreasuryTransferDialog and UserCashboxAssignmentDialog: PySide6 _DIALOG_STYLE
 * group boxes, 38px inputs, 40px actions, blue headers and right-to-left grid.
 * Keep these selectors inside treasury dialogs; unrelated module forms are not touched.
 */
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transfer"] .qt-treasury-modal,
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="assignments"] .qt-treasury-modal {
  background:#f6f8fb;
  color:#172033;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transfer"] .qt-cashbox-transfers {
  background:transparent;
  box-shadow:none;
  border:0;
  padding:0;
  direction:rtl;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transfer"] .qt-cashbox-transfers > h3,
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="assignments"] .qt-cashbox-assignments > h2 {
  font-size:18px;
  font-weight:700;
  color:#244875;
  margin:0 0 8px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transfer"] .qt-cashbox-transfers > .muted {
  color:#64748b;
  margin:0 0 10px;
  line-height:1.6;
  font-size:12px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transfer"] .qt-cashbox-transfer-form {
  border:1px solid #d7deea;
  border-radius:8px;
  padding:18px 12px 12px;
  margin:12px 0 0;
  background:#fff;
  position:relative;
  gap:10px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transfer"] .qt-cashbox-transfer-form::before {
  content:"بيانات التحويل";
  position:absolute;
  top:-10px;right:12px;
  font-size:12px;
  font-weight:800;
  color:#244875;
  background:#fff;
  padding:0 6px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transfer"] .qt-cashbox-transfer-form > .form-grid {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:10px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transfer"] .qt-cashbox-transfer-form > .form-grid > label {
  display:grid;
  grid-template-columns:112px minmax(0,1fr);
  align-items:center;
  gap:12px;
  font-weight:700;
  font-size:12px;
  min-width:0;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transfer"] .qt-cashbox-transfer-form :is(select,input),
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="assignments"] .qt-cashbox-assignment-label select {
  box-sizing:border-box;
  height:38px;
  min-height:38px;
  border:1px solid #cbd5e1;
  border-radius:6px;
  background:#fff;
  padding:0 10px;
  min-width:0;
  font-size:12px;
  color:#172033;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transfer"] .qt-cashbox-transfer-form > button,
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="assignments"] .qt-cashbox-assignments .qt-treasury-button {
  min-height:40px;
  height:40px;
  border-radius:7px;
  font-weight:700;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="assignments"] .qt-cashbox-assignment-form {
  border:1px solid #d7deea;
  border-radius:8px;
  background:#fff;
  margin-top:12px;
  padding:16px 12px;
  position:relative;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="assignments"] .qt-cashbox-assignment-form::before {
  content:"إعداد الربط";
  position:absolute;
  top:-10px;right:12px;
  background:#fff;
  padding:0 6px;
  color:#244875;
  font-weight:700;
  font-size:12px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="assignments"] .qt-cashbox-assignment-grid {
  grid-template-columns:1.2fr 1.2fr 1fr auto;
  align-items:end;
  gap:8px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="assignments"] .qt-cashbox-assignment-table {
  min-height:190px;
  max-height:350px;
  border:1px solid #d7deea;
  border-radius:7px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="assignments"] .qt-cashbox-assignment-table .qt-treasury-table thead th {
  background:#244875;
  color:#fff;
  text-align:center;
  font-weight:700;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="types"] .qt-treasury-native-types > .qt-treasury-filter-actions {
  justify-content:flex-start;
  min-height:40px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="types"] .qt-treasury-native-types .table-scroll {
  border:1px solid #d7deea;
  border-radius:7px;
  background:#fff;
  overflow:auto;
  max-height:min(480px,50dvh);
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="types"] .qt-treasury-native-types .qt-treasury-table thead th {
  background:#244875;
  color:#fff;
  text-align:center;
  white-space:nowrap;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="types"] .qt-treasury-native-types > .panel {
  background:#fff;
  border:1px solid #d7deea;
  border-radius:8px;
  margin-block:10px;
}
@media(max-width:780px){
  body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="assignments"] .qt-cashbox-assignment-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:520px){
  body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transfer"] .qt-cashbox-transfer-form > .form-grid > label {
    grid-template-columns:1fr;
    gap:5px;
  }
  body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="assignments"] .qt-cashbox-assignment-grid {
    grid-template-columns:minmax(0,1fr);
  }
}


/* Offline TreasuryTransactionDialog: five-row QFormLayout in the
 * "معلومات المعاملة" group. The Cloud posts only the verified independent
 * receipt/disbursement fields; customer documentation is not fabricated.
 */
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-modal {
  background:#f6f8fb;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-manual-vouchers {
  border:0;
  background:transparent;
  box-shadow:none;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:9px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-manual-vouchers > h2 {
  display:none;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-manual-vouchers > .form {
  order:1;
  position:relative;
  background:#fff;
  border:1px solid #d7deea;
  border-radius:8px;
  padding:23px 12px 12px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-manual-vouchers > .form::before {
  content:"معلومات المعاملة";
  position:absolute;
  top:-10px;
  right:12px;
  padding:0 6px;
  color:#244875;
  background:#fff;
  font-weight:700;
  font-size:12px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-manual-vouchers > .muted {
  order:2;
  margin:0;
  line-height:1.7;
  color:#64748b;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-manual-vouchers > .form > .form-grid {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:10px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-manual-vouchers > .form > .form-grid > label {
  display:grid;
  grid-template-columns:105px minmax(0,1fr);
  align-items:center;
  gap:10px;
  font-size:12px;
  font-weight:700;
  min-width:0;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-manual-vouchers > .form > .form-grid > label :is(input,select) {
  min-height:38px;
  height:38px;
  min-width:0;
  border:1px solid #cbd5e1;
  background:#fff;
  color:#172033;
  border-radius:6px;
  padding:0 10px;
  font-size:12px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-manual-vouchers > .form .qt-treasury-filter-actions {
  justify-content:flex-end;
  flex-wrap:wrap;
  padding-top:8px;
}
body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-manual-vouchers > .form .qt-treasury-filter-actions button {
  min-width:110px;
  min-height:40px;
  border-radius:7px;
}
@media(max-width:520px){
  body.qt-desktop-mode .qt-treasury-backdrop[data-treasury-window="transaction"] .qt-treasury-manual-vouchers > .form > .form-grid > label {
    grid-template-columns:minmax(0,1fr);
  }
}
