:root {
  --py-primary: #5a8dee;
  --py-primary-dark: #477bd8;
  --py-indigo: #7367f0;
  --py-success: #28c76f;
  --py-warning: #ff9f43;
  --py-danger: #ff5b5c;
  --py-info: #00bad1;
  --py-heading: #25396f;
  --py-text: #516377;
  --py-muted: #8492a6;
  --py-border: #e6eaf1;
  --py-bg: #f5f6fa;
}

html, body, button, input, textarea, select {
  font-family: "primary-font", "VazirLocal", Tahoma, Arial, sans-serif !important;
}

.bx,
.bx::before {
  font-family: "boxicons" !important;
}

html, body { min-height: 100%; }
html { overflow-x: clip; }
body { margin: 0; direction: rtl; background: var(--py-bg); color: var(--py-text); }
button, input, textarea, select { font: inherit; }
code { font-family: Consolas, "Courier New", monospace !important; }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(90, 141, 238, .28);
  outline-offset: 2px;
}

.layout-wrapper, .layout-container { min-height: 100vh; }
.admin-sidebar {
  position: fixed !important;
  inset: 0 0 0 auto;
  z-index: 1040;
  width: 270px !important;
  overflow: hidden;
  box-shadow: -3px 0 24px rgba(37, 57, 111, .08);
  transition: width .2s ease, transform .2s ease;
}
.layout-page { width: 100%; min-width: 0; max-width: 100%; min-height: 100vh; padding-right: 270px; transition: padding-right .2s ease; }
.layout-menu-collapsed .admin-sidebar { width: 82px !important; }
.layout-menu-collapsed .layout-page { padding-right: 82px; }
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .menu-text,
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .menu-header,
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .menu-link div,
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .menu-new-badge,
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .sidebar-help,
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .sidebar-user-section .user-copy,
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .sidebar-user-section summary .bx-chevron-down { display: none !important; }
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .sidebar-user-section { padding-inline: .4rem !important; margin-block: .4rem !important; }
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .sidebar-user-section summary { padding: .3rem !important; justify-content: center !important; border-radius: 12px !important; width: 44px !important; height: 44px !important; margin: 0 auto !important; }
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .sidebar-user-section summary > div { gap: 0 !important; width: 100% !important; justify-content: center !important; }
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .sidebar-user-section .user-avatar { width: 34px !important; height: 34px !important; font-size: 1.15rem !important; border-radius: 10px !important; margin: 0 auto !important; }
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .sidebar-user-section .user-menu-panel { position: absolute !important; top: 0 !important; right: 100% !important; left: auto !important; margin-right: .5rem !important; z-index: 1090 !important; width: 220px !important; }
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .app-brand { padding-inline: .75rem .65rem; }
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .menu-inner > .menu-item { margin-inline: .65rem; }
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .menu-link { justify-content: center; padding-inline: .7rem; }
.layout-menu-collapsed:not(.layout-menu-hover) .admin-sidebar .menu-icon { margin: 0 !important; }

@media (min-width: 1200px) {
  .layout-menu-collapsed.layout-menu-hover .admin-sidebar {
    width: 270px !important;
    z-index: 1050;
    box-shadow: -.35rem 0 1.3rem rgba(31, 52, 89, .14);
  }
  .layout-menu-collapsed.layout-menu-hover .admin-sidebar .app-brand { padding: 0 1.5rem 0 1.25rem; }
}

.admin-sidebar .app-brand.demo { height: 64px; padding: 0 1.5rem 0 1.25rem; overflow: visible; }
.app-brand-link { min-width: 0; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: .5rem;
  color: #fff;
  background: linear-gradient(135deg, var(--py-primary), var(--py-indigo));
  box-shadow: none;
  font-size: 1.1rem;
}
.app-brand-text { color: var(--py-heading) !important; font-size: 1.55rem !important; letter-spacing: 0 !important; line-height: 1 !important; }
.admin-sidebar .app-brand .layout-menu-toggle {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--py-primary) !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
.admin-sidebar .app-brand .layout-menu-toggle:hover { color: #315fae !important; background: transparent !important; transform: none !important; }
.admin-sidebar .app-brand .layout-menu-toggle i { color: inherit !important; font-size: 1.5rem !important; transform: none !important; transition: none !important; }
.admin-sidebar .app-brand .layout-menu-toggle .menu-toggle-icon::before { content: "\ea50" !important; }
.layout-menu-collapsed .admin-sidebar .app-brand .layout-menu-toggle .menu-toggle-icon::before { content: "\ea4d" !important; }
.menu-header { color: #9ba7b8; font-weight: 700; letter-spacing: 0; }
.menu-inner > .menu-item { margin: .18rem .9rem; }
.menu-inner > .menu-item > .menu-link { min-height: 46px; border-radius: .75rem; color: #60718a; }
.menu-inner > .menu-item > .menu-link:hover { color: var(--py-primary); background: #f1f5ff; }
.menu-inner > .menu-item > .menu-link.active {
  color: #fff !important;
  background: linear-gradient(118deg, var(--py-primary), var(--py-indigo)) !important;
  box-shadow: 0 5px 14px rgba(90, 141, 238, .34);
}
.menu-link.active .menu-icon { color: #fff !important; }
.admin-sidebar .menu-inner > .menu-item > .menu-toggle { min-height: 46px; border-radius: .75rem; }
.admin-sidebar .menu-inner > .menu-item.active > .menu-toggle { color: #526783; }
.admin-sidebar .menu-sub > .menu-item > .menu-link { min-height: 40px; border-radius: .55rem; color: #718096; font-size: .65rem; }
.admin-sidebar .menu-sub > .menu-item > .menu-link.active { color: var(--py-primary) !important; background: transparent !important; box-shadow: none; font-weight: 800; }
.admin-sidebar .menu-sub > .menu-item > .menu-link.active::before { background-color: var(--py-primary) !important; }
.menu-new-badge { margin-inline-end: 1.2rem; padding: .2rem .4rem; font-size: .48rem; }
.sidebar-help {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin: .7rem 1rem;
  padding: 1rem;
  border: 1px solid #dce7fb;
  border-radius: 1rem;
  background: linear-gradient(145deg, #f5f8ff, #fff);
}
.sidebar-help-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #e5efff; color: var(--py-primary); font-size: 1.25rem; }
.sidebar-help strong { color: var(--py-heading); font-size: .82rem; }
.sidebar-help small { color: #8292a8; font-size: .68rem; line-height: 1.7; }

.billing-module-intro {
  display: flex;
  min-height: 310px;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem;
  border: 1px solid #e1e8f2;
  background: radial-gradient(circle at 15% 20%, #eef5ff 0, transparent 34%), linear-gradient(145deg, #fff, #fbfcff);
}
.billing-module-intro__icon { display: grid; width: 92px; height: 92px; flex: 0 0 92px; place-items: center; border-radius: 28px; color: #23966d; background: linear-gradient(145deg, #e4f8f0, #f4fcf9); box-shadow: 0 14px 35px rgba(35, 150, 109, .12); font-size: 2.6rem; }
.billing-module-intro__content { max-width: 760px; }
.billing-module-intro__badge { display: inline-flex; margin-bottom: .55rem; padding: .26rem .6rem; border-radius: 99px; color: #237c5d; background: #e1f6ed; font-size: .56rem; font-weight: 900; }
.billing-module-intro h2 { margin: 0; color: var(--py-heading); font-size: 1rem; font-weight: 950; }
.billing-module-intro p { margin: .7rem 0 0; color: #7c8ba0; font-size: .68rem; line-height: 2; }
.billing-module-intro__scope { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.billing-module-intro__scope span { display: inline-flex; align-items: center; gap: .35rem; padding: .48rem .65rem; border: 1px solid #e1e9f3; border-radius: .62rem; color: #647892; background: rgba(255,255,255,.75); font-size: .58rem; font-weight: 750; }
.billing-module-intro__scope i { color: #2fa979; font-size: .85rem; }

.admin-topbar {
  height: 82px;
  margin: 1rem 1.5rem 0;
  border: 1px solid rgba(230, 234, 241, .7);
  border-radius: 1.1rem;
  box-shadow: 0 4px 18px rgba(58, 53, 65, .055);
}
.admin-topbar .container-fluid { display: flex; align-items: center; justify-content: space-between; }
.topbar-start { display: flex; align-items: center; gap: .9rem; }
.topbar-eyebrow { display: inline-flex; align-items: center; gap: .25rem; color: var(--py-primary); font-size: .66rem; font-weight: 700; }
.topbar-title { margin-top: .12rem; color: var(--py-heading); font-size: .98rem; font-weight: 800; }
.topbar-start small { display: block; margin-top: .08rem; font-size: .68rem; }
.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: .6rem; padding: .42rem .65rem; border: 1px solid #e6ebf3; border-radius: .85rem; background: #fff; cursor: pointer; list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-avatar { display: flex !important; align-items: center !important; justify-content: center !important; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #5a8dee, #7367f0); font-weight: 800; flex-shrink: 0; }
.user-avatar i, .welcome-avatar-badge i { display: inline-flex !important; align-items: center !important; justify-content: center !important; line-height: 1 !important; margin: 0 !important; padding: 0 !important; }
.user-avatar.small { width: 34px; height: 34px; flex: 0 0 34px; }
.user-copy { flex-direction: column; min-width: 90px; }
.user-copy strong, .user-menu-head strong { color: #40516d; font-size: .75rem; }
.user-copy small, .user-menu-head small { color: #95a1b2; font-size: .62rem; }
.user-menu-panel { position: absolute; top: calc(100% + .55rem); left: 0; z-index: 1080; width: 230px; padding: .6rem; border: 1px solid #e8ecf2; border-radius: .9rem; background: #fff; box-shadow: 0 14px 38px rgba(37, 57, 111, .16); }
.user-menu-head { display: flex; gap: .6rem; align-items: center; padding: .4rem .35rem .75rem; border-bottom: 1px solid #edf0f4; }
.user-menu-head div { display: flex; flex-direction: column; }
.user-menu-action { display: flex; align-items: center; gap: .5rem; width: 100%; margin-top: .45rem; padding: .65rem .7rem; border: 0; border-radius: .65rem; color: var(--py-danger); background: transparent; font-size: .76rem; text-align: right; }
.user-menu-action:hover { background: #fff0f0; }
.password-change-dialog { width: min(100%, 520px); }
.password-change-fields { display: grid; gap: 1rem; }
.password-change-fields .form-label { margin-bottom: .42rem; color: #536780; font-size: .7rem; font-weight: 800; }
.password-change-fields .form-control { min-height: 48px; }
.password-change-fields .validation-message { display: block; margin-top: .35rem; color: var(--py-danger); font-size: .62rem; }
.password-change-alert { display: flex; align-items: flex-start; gap: .45rem; margin-bottom: 1rem; font-size: .67rem; line-height: 1.8; }
.password-change-alert i { flex: 0 0 auto; margin-top: .15rem; font-size: 1rem; }
.password-save-button { min-width: 140px; }

.content-wrapper { min-width: 0; max-width: 100%; min-height: calc(100vh - 98px); }
.content-wrapper > .container-xxl { min-width: 0; }
.container-p-y { padding-top: 1.5rem !important; }
.content-footer { background: transparent !important; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.page-kicker { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .35rem; color: var(--py-primary); font-size: .72rem; font-weight: 800; }
.page-heading h1 { margin: 0; color: var(--py-heading); font-size: 1.55rem; font-weight: 900; }
.content-wrapper h1[tabindex="-1"]:focus,
.auth-heading h1[tabindex="-1"]:focus,
.error-card h1[tabindex="-1"]:focus { outline: none; }
.page-heading p { margin: .35rem 0 0; color: var(--py-muted); font-size: .8rem; }
.page-heading-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn { border-radius: .7rem; font-weight: 600; }
.btn-primary { box-shadow: 0 5px 12px rgba(90, 141, 238, .26); }
.form-control, .form-select, .input-group-text { border-radius: .7rem; border-color: #dfe4ec; }
.form-control:focus, .form-select:focus { border-color: #8eb2f5; box-shadow: 0 0 0 .16rem rgba(90, 141, 238, .13); }
.select2-container { width: 100% !important; direction: rtl; font-family: "primary-font", "VazirLocal", Tahoma, Arial, sans-serif !important; }
.select2-container .select2-selection--single { position: relative; height: 46px; border: 1px solid #dfe4ec; border-radius: .7rem; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.select2-container .select2-selection--single .select2-selection__rendered { padding-right: 1rem; padding-left: 5.1rem; color: #52657f; line-height: 44px; text-align: right; }
.select2-container .select2-selection--single .select2-selection__placeholder { color: #a2adbd; }
.select2-container .select2-selection--single .select2-selection__arrow { top: 50%; right: auto; left: .7rem; width: 24px; height: 24px; transform: translateY(-50%); }
.select2-container--default .select2-selection--single .select2-selection__clear {
  position: absolute;
  top: 50%;
  right: auto;
  left: 2.85rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  color: #94a2b5;
  background: transparent;
  float: none;
  font-size: 1rem;
  line-height: 1;
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover { color: #e34f50; background: #fff0f0; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single { border-color: #8eb2f5; box-shadow: 0 0 0 .16rem rgba(90, 141, 238, .13); }
.select2-container--default.select2-container--disabled .select2-selection--single { color: #9ca8b8; background: #f3f5f8; cursor: not-allowed; }
.select2-container--open { z-index: 1810; }
.select2-dropdown { overflow: hidden; border: 1px solid #dfe6f1; border-radius: .8rem; background: #fff; box-shadow: 0 14px 38px rgba(37, 57, 111, .16); direction: rtl; }
.select2-search--dropdown { padding: .65rem; }
.select2-container--default .select2-search--dropdown .select2-search__field { min-height: 38px; padding: .45rem .7rem; border: 1px solid #dfe6f1; border-radius: .6rem; color: #405674; outline: 0; text-align: right; }
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: #8eb2f5; box-shadow: 0 0 0 .14rem rgba(90, 141, 238, .12); }
.select2-results__options { padding: .35rem; }
.select2-container--default .select2-results__option { margin: .12rem 0; padding: .6rem .7rem; border-radius: .55rem; color: #586b85; font-size: .72rem; text-align: right; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { color: #315fae; background: #edf3ff; }
.select2-container--default .select2-results__option--selected { color: #fff; background: linear-gradient(118deg, var(--py-primary), var(--py-indigo)); }
.select2-container--default .select2-selection--multiple { min-height: 46px; padding: .18rem .45rem; border: 1px solid #dfe4ec; border-radius: .7rem; }
.select2-container--default.select2-container--focus .select2-selection--multiple { border-color: #8eb2f5; box-shadow: 0 0 0 .16rem rgba(90, 141, 238, .13); }
.select2-container--default .select2-selection--multiple .select2-selection__choice { border: 0; border-radius: .55rem; color: #3e64a9; background: #eaf1ff; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { border: 0; color: #6f8fc7; }
.select2-results__message { color: #8c99aa !important; text-align: center !important; }
.app-modal .select2-container .select2-selection--single { height: 44px; background: #fbfcff; }
.app-modal .select2-container .select2-selection--single .select2-selection__rendered { line-height: 42px; }
.notice-alert { display: flex; align-items: center; gap: .55rem; border: 0; border-radius: .9rem; box-shadow: 0 4px 15px rgba(58, 53, 65, .06); }
.notice-alert > i { font-size: 1.25rem; }
.notice-alert > span { flex: 1; }

html .swal2-container.py-admin-swal {
  z-index: 1900 !important;
  padding: 1rem !important;
  direction: rtl;
}
.py-admin-swal .py-admin-swal-popup {
  width: min(420px, calc(100vw - 2rem));
  padding: 1.45rem 1.35rem 1.25rem !important;
  border: 1px solid rgba(230, 234, 241, .8);
  border-radius: 1.2rem !important;
  box-shadow: 0 24px 70px rgba(28, 40, 66, .24) !important;
  font-family: "primary-font", "VazirLocal", Tahoma, Arial, sans-serif !important;
}
.py-admin-swal .swal2-icon { margin: .25rem auto 1rem !important; transform: scale(.86); }
.py-admin-swal .py-admin-swal-title {
  padding: 0 .5rem !important;
  color: var(--py-heading) !important;
  font-size: 1.05rem !important;
  font-weight: 900 !important;
  line-height: 1.8 !important;
}
.py-admin-swal .py-admin-swal-text {
  margin-top: .45rem !important;
  padding: 0 .35rem !important;
  color: #71829a !important;
  font-size: .78rem !important;
  line-height: 1.95 !important;
  text-align: center !important;
  white-space: pre-line;
}
.py-admin-swal .swal2-actions { gap: .5rem; margin-top: 1.1rem !important; }
.py-admin-swal .py-admin-swal-confirm { min-width: 112px; }

.card { border: 0; border-radius: 1.05rem; box-shadow: 0 4px 18px rgba(58, 53, 65, .06); }
.stat-card { height: 100%; transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 9px 25px rgba(58, 53, 65, .1); }
.stat-card .card-body { display: flex; align-items: center; gap: .9rem; padding: 1.05rem 1.1rem; }
.stat-icon { display: grid; place-items: center; width: 50px; height: 50px; flex: 0 0 50px; border-radius: 15px; font-size: 1.5rem; }
.stat-icon.primary { color: var(--py-primary); background: #eaf1ff; }
.stat-icon.success { color: var(--py-success); background: #e5f9ee; }
.stat-icon.info { color: var(--py-info); background: #e2f8fb; }
.stat-icon.warning { color: var(--py-warning); background: #fff2e5; }
.stat-card .card-body > div > small,
.stat-card .card-body > div > strong,
.stat-card .card-body > div > span { display: block; }
.stat-card small { color: #8896a9; font-size: .7rem; }
.stat-card strong { margin: .08rem 0; color: var(--py-heading); font-size: 1.35rem; line-height: 1.2; }
.stat-card div > span { color: #a0aaba; font-size: .62rem; }

.bulk-sync-card { overflow: hidden; background: linear-gradient(118deg, #eef4ff, #f8f6ff 65%, #fff); border: 1px solid #dde8fa; }
.bulk-sync-card .card-body { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; }
.bulk-sync-copy { display: flex; align-items: center; gap: .85rem; }
.bulk-sync-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 52px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--py-primary), var(--py-indigo)); box-shadow: 0 7px 18px rgba(90, 141, 238, .25); font-size: 1.55rem; }
.bulk-sync-copy h2 { margin: 0 0 .2rem; color: var(--py-heading); font-size: .98rem; font-weight: 900; }
.bulk-sync-copy p { margin: 0; color: #71819a; font-size: .72rem; }
.bulk-sync-button { min-width: 190px; }

.hospitals-card { max-width: 100%; overflow: hidden; }
.hospital-table-wrap,
.doctors-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.hospital-list-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.05rem 1.2rem; border-bottom: 1px solid #edf0f5; }
.hospital-list-header h2 { margin: 0; color: var(--py-heading); font-size: 1rem; font-weight: 900; }
.hospital-list-header small { color: #98a4b4; font-size: .68rem; }
.hospital-list-tools { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; flex: 1 1 auto; }
.hospital-connection-filter { width: auto; min-width: 235px; height: 42px; color: #62738b; background-color: #f9fafc; font-size: .7rem; }
.search-box { position: relative; width: min(340px, 100%); }
.search-box > i { position: absolute; top: 50%; right: .85rem; z-index: 1; transform: translateY(-50%); color: #9ca8b8; font-size: 1.15rem; }
.search-box input { height: 42px; padding-right: 2.55rem; padding-left: 2.25rem; background: #f9fafc; font-size: .75rem; }
.search-box > button { position: absolute; top: 50%; left: .55rem; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; transform: translateY(-50%); border: 0; border-radius: 8px; color: #94a1b1; background: transparent; }
.search-box > button:hover { color: var(--py-danger); background: #fff0f0; }
.search-box.compact { width: 260px; }
.search-box.compact input { height: 38px; }
.hospital-table thead th, .doctors-table thead th { padding: .75rem 1rem; border: 0; color: #8492a6; background: #f7f8fb; font-size: .69rem; font-weight: 800; white-space: nowrap; }
.hospital-table tbody td, .doctors-table tbody td { padding: .9rem 1rem; border-color: #edf0f4; vertical-align: middle; font-size: .73rem; }
.hospital-table tbody tr { transition: background .15s ease; }
.hospital-table tbody tr:hover { background: #fbfcff; }
.inactive-row { opacity: .7; background: #fafafa; }
.hospital-identity { display: flex; align-items: center; gap: .75rem; min-width: 255px; }
.hospital-avatar { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px; border-radius: 14px; color: var(--py-primary); background: linear-gradient(135deg, #e7efff, #f1edff); font-size: 1.25rem; }
.hospital-avatar.large { width: 54px; height: 54px; flex-basis: 54px; border-radius: 16px; font-size: 1.55rem; }
.hospital-identity strong, .hospital-identity small, .hospital-identity code { display: block; }
.hospital-identity strong { margin-bottom: .15rem; color: #334767; font-size: .78rem; font-weight: 900; }
.hospital-identity small { color: #8493a8; font-size: .64rem; }
.hospital-identity small i { color: var(--py-primary); }
.hospital-identity code { max-width: 290px; margin-top: .2rem; overflow: hidden; color: #9aa5b5; font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; gap: .25rem; padding: .3rem .55rem; border-radius: 999px; font-size: .64rem; font-weight: 800; white-space: nowrap; }
.status-pill.active { color: #1d9c57; background: #e5f9ee; }
.status-pill.inactive { color: #e1595a; background: #ffe9e9; }
.connection-state { display: flex; align-items: center; gap: .55rem; min-width: 100px; }
.connection-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px; font-size: 1rem; }
.connection-state.connected .connection-icon { color: #1d9c57; background: #e5f9ee; }
.connection-state.disconnected .connection-icon { color: #d94b4c; background: #ffe9e9; }
.connection-state.unknown .connection-icon { color: #7f8da1; background: #f0f2f6; }
.connection-state strong, .connection-state small { display: block; }
.connection-state.connected strong { color: #1d8d51; }
.connection-state.disconnected strong { color: #c74647; }
.connection-state.unknown strong { color: #6f7d91; }
.connection-state strong { font-size: .68rem; }
.connection-state small { color: #9da8b7; font-size: .57rem; }
.doctor-counts strong, .doctor-counts small, .last-sync strong, .last-sync small { display: block; }
.doctor-counts strong { color: var(--py-heading); font-size: .95rem; }
.doctor-counts small { display: flex; gap: .45rem; margin-top: .1rem; font-size: .57rem; }
.missing-mobile-badge { display: inline-flex; align-items: center; gap: .2rem; margin-top: .3rem; padding: .18rem .38rem; border-radius: 999px; color: #c76d16; background: #fff1df; font-size: .55rem; font-weight: 800; white-space: nowrap; }
.last-sync strong { color: #53657e; font-size: .65rem; white-space: nowrap; }
.last-sync small { margin-top: .15rem; color: #9ba6b5; font-size: .57rem; }
.row-actions { display: flex; justify-content: center; gap: .3rem; min-width: 255px; }
.row-actions .btn { display: inline-flex; align-items: center; gap: .2rem; white-space: nowrap; }
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .65rem; min-height: 250px; color: #8291a6; }
.loading-state strong { font-size: .75rem; }
.loading-state.compact { min-height: 145px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; min-height: 280px; padding: 1rem; color: #8593a7; text-align: center; }
.empty-state i { color: #a5b6d2; font-size: 2.8rem; }
.empty-state strong { color: #536987; font-size: .88rem; }
.empty-state span { font-size: .7rem; }
.empty-state.compact { min-height: 180px; }
.empty-state.error i { color: var(--py-danger); }

.app-modal { position: fixed; inset: 0; z-index: 1090; display: block !important; overflow: auto; padding: 1rem; background: rgba(25, 39, 65, .58); backdrop-filter: blur(5px); }
body.modal-open,
body:has(.app-modal) { overflow: hidden; }
.app-modal .modal-dialog { width: min(100%, 620px); max-width: none; margin: auto; min-height: calc(100vh - 2rem); }
.app-modal .modal-dialog.modal-lg { width: min(100%, 980px); }
.app-modal .modal-dialog.modal-xl { width: min(100%, 1180px); }
.app-modal .modal-content { isolation: isolate; overflow: hidden; border: 1px solid rgba(224, 231, 241, .95); border-radius: 1.15rem; color: #425574; background: #fff; box-shadow: 0 28px 80px rgba(13, 25, 48, .32); }
.app-modal .modal-header { padding: 1rem 1.15rem; border-color: #e5ebf3; background: linear-gradient(135deg, #fff, #f7faff); }
.app-modal .modal-body { padding: 1.15rem; background: #fff; }
.app-modal .modal-footer { justify-content: flex-start; padding: .8rem 1.15rem; border-color: #e5ebf3; background: #f7f9fc; }
.app-modal .btn-close { width: 34px; height: 34px; margin: 0; border-radius: 10px; background-color: #edf2f8; opacity: .7; transition: background-color .15s ease, opacity .15s ease; }
.app-modal .btn-close:hover { background-color: #e4eaf3; opacity: 1; }
.app-modal .form-control,
.app-modal .input-group-text { min-height: 44px; border-color: #dce4ef; color: #364b6c; background: #fbfcff; box-shadow: none; }
.app-modal .form-control:focus { border-color: #7da4ed; background: #fff; box-shadow: 0 0 0 3px rgba(91, 134, 216, .12); }
.app-modal .input-group[dir="ltr"] .form-control { text-align: left; font-weight: 800; }
.modal-heading { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.modal-heading > div { min-width: 0; }
.modal-heading h3 { margin: 0; overflow-wrap: anywhere; color: var(--py-heading); font-size: .95rem; font-weight: 900; }
.modal-heading small { display: block; margin-top: .18rem; color: #8d9aad; font-size: .66rem; }
.modal-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; font-size: 1.3rem; }
.modal-icon.primary { color: var(--py-primary); background: #e8f0ff; }
.modal-icon.info { color: var(--py-info); background: #e1f8fb; }
.modal-icon.success { color: var(--py-success); background: #e4f9ed; }
.modal-icon.danger { color: var(--py-danger); background: #ffe8e8; }
.form-label { color: #50617a; font-size: .7rem; font-weight: 800; }
.form-hint { display: flex; align-items: center; gap: .25rem; margin-top: .35rem; color: #98a4b4; font-size: .62rem; }
.form-hint i { color: var(--py-primary); }
.ltr-field { direction: ltr; text-align: left; font-family: Consolas, "Courier New", monospace !important; }

.sync-modal { z-index: 1100; }
.sync-modal .modal-dialog { max-width: min(1250px, calc(100vw - 2rem)); }
.sync-modal .modal-content { max-height: calc(100vh - 2rem); }
.sync-modal-body { overflow-y: auto; }
.hospital-sync-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border: 1px solid #dce7fa; border-radius: 1rem; background: linear-gradient(135deg, #f3f7ff, #fbfcff); }
.sync-hospital-copy { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.sync-hospital-copy strong, .sync-hospital-copy small, .sync-hospital-copy code { display: block; }
.sync-hospital-copy strong { color: var(--py-heading); font-size: .9rem; }
.sync-hospital-copy small { margin-top: .12rem; color: #8493a8; font-size: .65rem; }
.sync-hospital-copy code { max-width: 470px; margin-top: .18rem; overflow: hidden; color: #94a1b3; font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.sync-connection-state { margin-top: .55rem; }
.sync-hero-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.sync-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin-top: .8rem; }
.sync-stat-grid-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sync-stat { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: .6rem; align-items: center; min-height: 76px; padding: .7rem; border: 1px solid #e7ecf4; border-radius: .9rem; background: #fff; }
.sync-stat-action { width: 100%; color: inherit; font-family: inherit; text-align: right; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.sync-stat-action:hover { border-color: #ffbd7d; box-shadow: 0 7px 18px rgba(255, 159, 67, .12); transform: translateY(-1px); }
.sync-stat > span { grid-row: 1 / 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: 1.2rem; }
.sync-stat > span.blue { color: var(--py-primary); background: #eaf1ff; }
.sync-stat > span.green { color: var(--py-success); background: #e5f9ee; }
.sync-stat > span.orange { color: var(--py-warning); background: #fff2e4; }
.sync-stat > span.purple { color: var(--py-indigo); background: #eeecff; }
.sync-stat > span.red { color: var(--py-danger); background: #ffe8e8; }
.sync-stat small { color: #8c99ab; font-size: .62rem; }
.sync-stat strong { color: #354a6b; font-size: .95rem; }
.sync-stat .date-value { font-size: .66rem; white-space: nowrap; }
.sync-progress-panel { margin-top: .85rem; padding: .85rem; border: 1px solid #e3e9f3; border-radius: 1rem; background: #f9fbfe; }
.sync-progress-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .7rem; }
.sync-progress-head > div { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.sync-progress-head small { color: #8795a8; font-size: .61rem; }
.sync-progress-head code { color: #8d99aa; font-size: .57rem; }
.sync-status { display: inline-flex; align-items: center; gap: .3rem; padding: .32rem .58rem; border-radius: 999px; font-size: .65rem; font-weight: 800; }
.sync-status.success { color: #1d9d57; background: #e4f9ed; }
.sync-status.warning { color: #d68022; background: #fff2df; }
.sync-status.danger { color: #df5051; background: #ffe8e8; }
.sync-status.running { color: #4f7fd7; background: #e8f0ff; }
.sync-running { display: inline-flex; align-items: center; gap: .4rem; color: #6d7f98; font-size: .65rem; }
.sync-result-card { margin-top: .55rem; padding: .75rem; border: 1px solid #e2e9f2; border-right: 4px solid var(--py-success); border-radius: .8rem; background: #fff; }
.sync-result-card.failed { border-right-color: var(--py-danger); }
.sync-result-card.running { border-right-color: var(--py-primary); background: #f8faff; }
.sync-result-title { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .55rem; }
.sync-result-title strong { color: #3c506f; font-size: .72rem; }
.sync-result-title span { color: #75869c; font-size: .62rem; }
.result-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: .4rem; }
.result-stat-row > div { padding: .42rem .25rem; border-radius: .55rem; background: #f7f9fc; text-align: center; }
.result-stat-row small, .result-stat-row strong { display: block; }
.result-stat-row small { color: #929eae; font-size: .55rem; }
.result-stat-row strong { margin-top: .08rem; color: #415675; font-size: .75rem; }
.result-error { margin-top: .5rem; padding: .45rem .55rem; border-radius: .55rem; color: #d85051; background: #fff0f0; font-size: .62rem; }
.sync-waiting { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 100px; color: #7c8ca2; font-size: .68rem; }

/* Clinical AI billing and retention */
.ai-pricing-strip { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1rem; padding: .78rem 1rem; overflow-x: auto; border: 1px solid #dce8f9; border-radius: 1rem; background: linear-gradient(115deg, #f1f6ff, #faf8ff); box-shadow: 0 8px 24px rgba(65, 89, 130, .06); }
.ai-pricing-strip > div { display: flex; align-items: center; gap: .38rem; white-space: nowrap; }
.ai-pricing-strip > div:first-child { padding-left: 1rem; border-left: 1px solid #dce4f0; }
.ai-pricing-strip i { color: var(--py-indigo); font-size: 1.1rem; }
.ai-pricing-strip span { color: #8190a6; font-size: .62rem; }
.ai-pricing-strip strong { color: #3b4f70; font-size: .68rem; }
.ai-pricing-strip a { margin-right: auto; color: var(--py-primary); font-size: .63rem; white-space: nowrap; }
.ai-hospitals-card { overflow: hidden; }
.ai-hospital-list { display: grid; gap: .7rem; padding: .9rem; background: #f8fafe; }
.ai-hospital-row { display: grid; grid-template-columns: minmax(210px, 1.45fr) minmax(130px, .7fr) minmax(125px, .65fr) auto auto; align-items: center; gap: 1rem; padding: .85rem; border: 1px solid #e4eaf3; border-right: 4px solid var(--py-primary); border-radius: .95rem; background: #fff; transition: transform .16s ease, box-shadow .16s ease; }
.ai-hospital-row:hover { transform: translateY(-1px); box-shadow: 0 10px 25px rgba(42, 61, 93, .08); }
.ai-hospital-row.free { border-right-color: var(--py-success); background: linear-gradient(90deg, #fff, #f7fdfa); }
.ai-hospital-row.empty { border-right-color: var(--py-danger); background: linear-gradient(90deg, #fff, #fff9f9); }
.ai-hospital-identity { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.ai-hospital-logo { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px; border-radius: 13px; color: var(--py-primary); background: #e9f0ff; font-size: 1.25rem; }
.ai-hospital-identity div { min-width: 0; }
.ai-hospital-identity strong, .ai-hospital-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-hospital-identity strong { color: var(--py-heading); font-size: .76rem; }
.ai-hospital-identity small { margin-top: .22rem; color: #8b98aa; font-size: .59rem; }
.ai-balance-block small, .ai-balance-block strong, .ai-balance-block span, .ai-usage-block small, .ai-usage-block strong, .ai-usage-block span { display: block; }
.ai-balance-block small, .ai-usage-block small { color: #8a98ab; font-size: .57rem; }
.ai-balance-block strong, .ai-usage-block strong { margin: .12rem 0; color: #3c506f; font-size: .82rem; }
.ai-balance-block span, .ai-usage-block span { color: #9aa5b5; font-size: .54rem; }
.ai-balance-block .free-label { color: var(--py-success); }
.ai-free-switch { display: grid; grid-template-columns: 34px auto; align-items: center; gap: .3rem; cursor: pointer; }
.ai-free-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ai-free-switch > span { position: relative; width: 34px; height: 19px; border-radius: 99px; background: #cbd4df; transition: .2s ease; }
.ai-free-switch > span::after { position: absolute; top: 3px; right: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); content: ""; transition: .2s ease; }
.ai-free-switch input:checked + span { background: var(--py-success); }
.ai-free-switch input:checked + span::after { transform: translateX(-15px); }
.ai-free-switch em { color: #62738b; font-size: .59rem; font-style: normal; white-space: nowrap; }
.ai-row-actions { display: flex; gap: .38rem; }
.quick-credit-row { display: flex; gap: .45rem; margin-top: .65rem; direction: ltr; }
.quick-credit-row button { min-width: 58px; padding: .38rem .65rem; border: 1px solid #d9e2f1; border-radius: .6rem; color: #5074b5; background: #f5f8ff; font-size: .68rem; font-weight: 800; }
.quick-credit-row button:hover { border-color: var(--py-primary); background: #eaf1ff; }
.recharge-preview { display: flex; align-items: center; justify-content: space-between; margin-top: .8rem; padding: .72rem .82rem; border: 1px solid #dce9df; border-radius: .75rem; color: #668071; background: #f4fbf6; }
.recharge-preview span { font-size: .65rem; font-weight: 700; }
.recharge-preview strong { color: #20995c; font-size: .83rem; }
.ai-history-body { min-height: 260px; max-height: 70vh; overflow: auto; background: #f6f8fc !important; }
.history-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin-bottom: .85rem; }
.history-summary > div { padding: .72rem .8rem; border: 1px solid #e0e7f1; border-radius: .8rem; background: #fff; box-shadow: 0 5px 14px rgba(44, 64, 99, .04); }
.history-summary small,
.history-summary strong { display: block; }
.history-summary small { color: #8795a8; font-size: .59rem; }
.history-summary strong { margin-top: .18rem; color: #334d73; font-size: .82rem; }
.history-table-shell { overflow: hidden; border: 1px solid #dee6f0; border-radius: .85rem; background: #fff; }
.ai-history-table { margin: 0; color: #52647d; font-size: .65rem; }
.ai-history-table thead th { padding: .72rem .65rem; border-bottom: 1px solid #dce5ef; color: #536987; background: #edf3fa; font-size: .6rem; font-weight: 900; white-space: nowrap; }
.ai-history-table tbody td { padding: .68rem .65rem; border-color: #e8edf4; vertical-align: middle; }
.ai-history-table tbody tr:nth-child(even) td { background: #fafcff; }
.ai-history-table tbody tr:hover td { background: #f2f6fc; }
.ai-history-table .balance-cell { color: #4a5f7d; font-weight: 800; white-space: nowrap; }
.ai-history-table .description-cell { min-width: 220px; color: #667991; line-height: 1.65; }
.ai-history-table .credit { color: var(--py-success); font-weight: 900; }
.ai-history-table .debit { color: var(--py-danger); font-weight: 900; }
.transaction-type { display: inline-flex; padding: .28rem .5rem; border-radius: 999px; font-size: .57rem; font-weight: 800; }
.transaction-type.credit { color: var(--py-success); background: #e5f9ee; }
.transaction-type.debit { color: #d67a29; background: #fff1e4; }
.cleanup-modal { z-index: 1120; }
.cleanup-modal .modal-dialog { max-width: min(1050px, calc(100vw - 2rem)); }
.cleanup-body { max-height: 68vh; overflow-y: auto; background: #f9fbfe; }
.cleanup-safety-note { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .85rem; padding: .8rem; border: 1px solid #dbe8f7; border-radius: .85rem; color: #45617e; background: #f0f7ff; }
.cleanup-safety-note > i { color: var(--py-primary); font-size: 1.5rem; }
.cleanup-safety-note strong, .cleanup-safety-note span { display: block; }
.cleanup-safety-note strong { font-size: .7rem; }
.cleanup-safety-note span { margin-top: .18rem; color: #75879c; font-size: .6rem; line-height: 1.6; }
.hospital-step-list { display: grid; gap: .55rem; }
.hospital-step { display: grid; grid-template-columns: 35px minmax(0,1fr) auto; align-items: center; gap: .65rem; padding: .68rem .75rem; border: 1px solid #e2e8f1; border-right: 4px solid #b7c3d2; border-radius: .75rem; background: #fff; }
.hospital-step.checking, .hospital-step.processing { border-right-color: var(--py-primary); background: #f8faff; }
.hospital-step.ready { border-right-color: var(--py-info); }
.hospital-step.done { border-right-color: var(--py-success); background: #f8fdf9; }
.hospital-step.failed { border-right-color: var(--py-danger); background: #fffafa; }
.step-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; color: #6f8097; background: #edf1f6; }
.hospital-step.checking .step-icon, .hospital-step.processing .step-icon { color: var(--py-primary); background: #e8f0ff; }
.hospital-step.done .step-icon, .hospital-step.ready .step-icon { color: var(--py-success); background: #e5f9ee; }
.hospital-step.failed .step-icon { color: var(--py-danger); background: #ffe8e8; }
.hospital-step strong, .hospital-step small { display: block; }
.hospital-step strong { color: #3c506e; font-size: .68rem; }
.hospital-step small { margin-top: .18rem; color: #8593a5; font-size: .57rem; }
.step-count { color: #7f8da0; font-size: .58rem; white-space: nowrap; }
.cleanup-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; margin-top: .8rem; }
.cleanup-summary > div { padding: .65rem; text-align: center; border: 1px solid #e3e9f2; border-radius: .7rem; background: #fff; }
.cleanup-summary small, .cleanup-summary strong { display: block; }
.cleanup-summary small { color: #8b98aa; font-size: .56rem; }
.cleanup-summary strong { margin-top: .2rem; color: #405673; font-size: .9rem; }
.cleanup-footer-status { margin-left: auto; color: #71829a; font-size: .62rem; }
@media (max-width: 1199px) {
  .ai-hospital-row { grid-template-columns: minmax(220px, 1.4fr) 1fr 1fr; }
  .ai-free-switch, .ai-row-actions { grid-column: auto; }
}
@media (max-width: 767px) {
  .ai-pricing-strip { align-items: flex-start; flex-direction: column; gap: .5rem; }
  .ai-pricing-strip > div:first-child { padding-left: 0; border-left: 0; }
  .ai-pricing-strip a { margin-right: 0; }
  .ai-hospital-row { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .ai-hospital-identity, .ai-row-actions { grid-column: 1 / -1; }
  .ai-row-actions .btn { flex: 1; }
  .cleanup-summary { grid-template-columns: 1fr 1fr; }
  .hospital-step { grid-template-columns: 35px minmax(0,1fr); }
  .step-count { grid-column: 2; }
}
.source-verification-warning { display: flex; align-items: flex-start; gap: .6rem; margin-top: .7rem; padding: .7rem .8rem; border: 1px solid #ffdfb7; border-radius: .8rem; color: #9c641e; background: #fff8ed; }
.source-verification-warning > i { margin-top: .05rem; font-size: 1.2rem; }
.source-verification-warning strong, .source-verification-warning span { display: block; }
.source-verification-warning strong { font-size: .7rem; }
.source-verification-warning span { margin-top: .12rem; color: #ae7d42; font-size: .61rem; line-height: 1.8; }
.conflict-panel { margin-top: .85rem; overflow: hidden; border: 1px solid #ffd7b0; border-radius: 1rem; background: #fff; }
.conflict-panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem .9rem; border-bottom: 1px solid #ffe3c7; background: #fff8ef; }
.conflict-panel-head > div { display: flex; align-items: center; gap: .55rem; }
.conflict-panel-head > div > i { color: var(--py-warning); font-size: 1.4rem; }
.conflict-panel-head h4 { margin: 0; color: #795126; font-size: .76rem; font-weight: 900; }
.conflict-panel-head small { display: block; margin-top: .12rem; color: #a47b50; font-size: .6rem; }
.conflict-panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: .45rem; flex-wrap: wrap; }
.conflict-panel-actions > span { padding: .22rem .45rem; border-radius: 999px; color: #b3671b; background: #ffe7ca; font-size: .6rem; font-weight: 800; white-space: nowrap; }
.conflict-panel-actions .btn { display: inline-flex; align-items: center; white-space: nowrap; }
.conflict-table th, .conflict-table td { padding: .65rem .8rem; font-size: .63rem; vertical-align: middle; }
.conflict-table th { color: #98724e; background: #fffdf9; white-space: nowrap; }
.conflict-table code, .conflict-table span[dir="ltr"] { color: #596b83; font-size: .6rem; }
.conflict-doctor-name { color: #465b78; font-weight: 800; white-space: nowrap; }

.doctor-list-section { margin-top: .9rem; border: 1px solid #e5eaf2; border-radius: 1rem; overflow: hidden; }
.doctor-list-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .85rem 1rem; background: #fbfcfe; border-bottom: 1px solid #e9edf3; }
.doctor-list-head h4 { margin: 0; color: var(--py-heading); font-size: .85rem; font-weight: 900; }
.doctor-list-head small { color: #94a0b1; font-size: .62rem; }
.doctor-filters { display: flex; align-items: center; gap: .4rem; }
.doctor-filters .form-select { width: 145px; height: 38px; font-size: .68rem; }
.doctors-table { margin-bottom: 0; }
.doctor-identity { display: flex; align-items: center; gap: .55rem; min-width: 150px; }
.doctor-identity > span { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; color: var(--py-primary); background: #eaf1ff; font-size: .68rem; font-weight: 900; }
.doctor-identity strong, .doctor-identity small { display: block; }
.doctor-identity strong { color: #405471; font-size: .7rem; }
.doctor-identity small { margin-top: .1rem; color: #9aa6b6; font-size: .56rem; }
.doctors-table code, .mobile-list { color: #60718a; font-size: .63rem; white-space: nowrap; }
.doctor-warning, .doctor-manual { display: inline-flex; align-items: center; gap: .15rem; margin-top: .25rem; padding: .15rem .35rem; border-radius: 999px; font-size: .52rem; font-weight: 800; direction: rtl; }
.doctor-warning { color: #cb6710; background: #fff0df; }
.doctor-manual { color: #547fd0; background: #eaf1ff; }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .9rem; border-top: 1px solid #edf0f4; color: #8794a6; font-size: .62rem; }
.pagination-bar > div { display: flex; align-items: center; gap: .45rem; }
.pagination-bar strong { color: #60718a; font-size: .62rem; }
.doctor-edit-modal { z-index: 1140; background: rgba(28, 39, 61, .62); }
.manual-switch { display: flex; align-items: flex-start; gap: .65rem; padding: .75rem; border: 1px solid #dfe7f3; border-radius: .8rem; background: #f8faff; cursor: pointer; }
.manual-switch input { margin-top: .25rem; }
.manual-switch div { display: flex; flex-direction: column; }
.manual-switch strong { color: #4c607c; font-size: .7rem; }
.manual-switch small { margin-top: .18rem; color: #8d9bae; font-size: .61rem; }
.doctor-edit-scope { display: flex; align-items: flex-start; gap: .45rem; margin-bottom: .9rem; padding: .65rem .7rem; border: 1px solid #dbe7fa; border-radius: .75rem; color: #5f7596; background: #f2f7ff; font-size: .63rem; line-height: 1.9; }
.doctor-edit-scope i { margin-top: .12rem; color: var(--py-primary); font-size: 1rem; }
.doctor-hospital-connection { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; padding: .7rem; border: 1px solid #e3e8f1; border-radius: .8rem; background: #fbfcfe; }
.doctor-hospital-name { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.doctor-hospital-name > i { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; color: var(--py-primary); background: #eaf1ff; }
.doctor-hospital-name small, .doctor-hospital-name strong { display: block; }
.doctor-hospital-name small { color: #97a3b4; font-size: .56rem; }
.doctor-hospital-name strong { overflow: hidden; color: #4d607b; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.doctor-login-cell { display: flex; flex-direction: column; min-width: 125px; }
.doctor-login-cell strong { display: inline-flex; align-items: center; gap: .25rem; color: #3f7fce; font-size: .66rem; }
.doctor-login-cell strong i { font-size: .9rem; }
.doctor-login-cell small { margin-top: .15rem; color: #8e9bae; font-size: .55rem; white-space: nowrap; }
.never-login-badge { display: inline-flex; align-items: center; gap: .22rem; padding: .25rem .45rem; border-radius: 999px; color: #7f8da1; background: #f0f2f6; font-size: .56rem; font-weight: 800; white-space: nowrap; }

.activity-scope-note { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; padding: .75rem .9rem; border: 1px solid #dbe8fb; border-radius: .9rem; color: #587297; background: linear-gradient(135deg, #f2f7ff, #f8fbff); }
.activity-scope-note > i { flex: 0 0 auto; color: var(--py-primary); font-size: 1.35rem; }
.activity-scope-note strong, .activity-scope-note span { display: block; }
.activity-scope-note strong { color: #456181; font-size: .7rem; }
.activity-scope-note span { margin-top: .1rem; color: #7f91a8; font-size: .61rem; }
.activity-stat-card .activity-last-login { min-width: 130px; font-size: .72rem; line-height: 1.5; }
.doctor-activity-card { overflow: hidden; }
.doctor-activity-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; }
.doctor-activity-header h2 { margin: 0; color: var(--py-heading); font-size: .9rem; font-weight: 900; }
.doctor-activity-header > div > small { display: block; margin-top: .18rem; color: #929fb1; font-size: .62rem; }
.doctor-activity-filters { display: flex; align-items: center; gap: .45rem; }
.doctor-activity-filters .search-box { width: 285px; }
.doctor-activity-filters .form-select { width: 165px; height: 40px; font-size: .66rem; }
.activity-loading, .activity-empty { min-height: 260px; }
.doctor-activity-table th, .doctor-activity-table td { padding: .8rem .9rem; vertical-align: middle; }
.doctor-activity-table th { color: #718099; background: #fbfcfe; font-size: .61rem; font-weight: 800; white-space: nowrap; }
.doctor-activity-table td { color: #65758d; font-size: .64rem; }
.activity-doctor-identity { min-width: 180px; }
.activity-doctor-identity small b { color: #667895; font-size: .57rem; }
.activity-hospital-list { display: flex; flex-wrap: wrap; gap: .25rem; min-width: 150px; }
.activity-hospital-list span { display: inline-flex; align-items: center; gap: .15rem; padding: .22rem .4rem; border-radius: 999px; color: #5f7597; background: #eef4fc; font-size: .54rem; font-weight: 700; white-space: nowrap; }
.activity-hospital-list i { color: #6591d9; font-size: .68rem; }
.login-count-badge { display: inline-flex; align-items: center; gap: .25rem; min-width: 64px; padding: .3rem .5rem; border-radius: 999px; color: #218a59; background: #e7f8ef; font-size: .6rem; font-weight: 900; white-space: nowrap; }
.login-count-badge i { font-size: .85rem; }
.last-login-cell { display: flex; flex-direction: column; min-width: 135px; }
.last-login-cell strong { color: #4d617e; font-size: .64rem; font-weight: 800; }
.last-login-cell small { margin-top: .15rem; color: #94a0b0; font-size: .54rem; direction: rtl; }
.doctor-activity-pagination { padding-inline: 1rem; }

.auth-shell { display: grid; place-items: center; min-height: 100vh; padding: 1rem; background: radial-gradient(circle at 10% 20%, rgba(115, 103, 240, .18), transparent 34%), radial-gradient(circle at 90% 80%, rgba(90, 141, 238, .2), transparent 32%), #f7f8fc; }
.auth-card { width: min(430px, 100%); padding: 2rem; border: 1px solid rgba(230, 234, 241, .85); border-radius: 1.35rem; background: #fff; box-shadow: 0 20px 65px rgba(58, 53, 65, .14); }
.auth-brand { display: flex; align-items: center; gap: .75rem; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { color: var(--py-heading); font-size: 1.05rem; }
.auth-brand small { margin-top: .15rem; color: #91a0b2; font-size: .64rem; }
.auth-heading { margin: 1.6rem 0 1.25rem; }
.auth-heading h1 { margin: 0; color: var(--py-heading); font-size: 1.35rem; font-weight: 900; }
.auth-heading p { margin: .45rem 0 0; color: #8492a6; font-size: .72rem; }
.auth-form .input-group-text { color: #8494aa; background: #f8f9fc; }
.auth-submit { display: flex; align-items: center; justify-content: center; gap: .45rem; height: 45px; }

.error-page { display: grid; place-items: center; min-height: 100vh; padding: 1rem; background: radial-gradient(circle at 12% 18%, rgba(115, 103, 240, .13), transparent 30%), radial-gradient(circle at 88% 82%, rgba(90, 141, 238, .16), transparent 30%), var(--py-bg); }
.content-wrapper .error-page { min-height: calc(100vh - 98px); }
.error-card { width: min(540px, 100%); padding: 2rem; border: 1px solid rgba(230, 234, 241, .9); border-radius: 1.25rem; background: #fff; box-shadow: 0 20px 60px rgba(37, 57, 111, .12); text-align: center; }
.error-icon { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 1rem; border-radius: 20px; color: var(--py-danger); background: #ffeaea; font-size: 2rem; }
.error-card h1 { margin: .15rem 0 .65rem; color: var(--py-heading); font-size: 1.35rem; font-weight: 900; }
.error-card > p { margin: 0 auto; color: #71819a; font-size: .76rem; line-height: 1.9; }
.error-request-id { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1.2rem; padding: .7rem .8rem; border: 1px solid #e6eaf1; border-radius: .75rem; background: #f8faff; color: #8291a6; font-size: .68rem; text-align: right; }
.error-request-id code { max-width: 70%; overflow-wrap: anywhere; color: #516377; font-size: .62rem; text-align: left; }
.error-actions { display: flex; justify-content: center; gap: .6rem; margin-top: 1.25rem; }
.error-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }

.layout-overlay { display: none; }
#blazor-error-ui { display: none; position: fixed; right: 1rem; bottom: 1rem; left: 1rem; z-index: 2000; padding: .8rem 1rem; border-radius: .8rem; color: #8b3031; background: #ffe7e7; box-shadow: 0 8px 25px rgba(58, 53, 65, .15); }
#blazor-error-ui .reload { margin-inline: .5rem; }
#blazor-error-ui .dismiss { float: left; padding: 0 .35rem; border: 0; color: inherit; background: transparent; cursor: pointer; font-size: 1.15rem; line-height: 1; }

@media (max-width: 1199.98px) {
  .admin-sidebar, .layout-menu-collapsed .admin-sidebar { z-index: 1080; transform: translateX(100%); width: 270px !important; }
  .layout-menu-collapsed .admin-sidebar .menu-text { display: inline-block; }
  .layout-menu-collapsed .admin-sidebar .menu-header,
  .layout-menu-collapsed .admin-sidebar .menu-link div { display: block; }
  .layout-menu-collapsed .admin-sidebar .sidebar-help { display: flex; }
  .layout-page, .layout-menu-collapsed .layout-page { padding-right: 0; }
  .layout-menu-expanded .admin-sidebar { transform: translateX(0); }
  .layout-menu-expanded .layout-overlay { position: fixed; inset: 0; z-index: 1076; display: block; border: 0; background: rgba(30, 42, 64, .45); }
  .admin-topbar { margin: .75rem; }
  .container-p-y { padding-top: 1.2rem !important; }
}

@media (max-width: 991.98px) {
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading-actions { width: 100%; }
  .page-heading-actions .btn { flex: 1; }
  .sync-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-stat-row { grid-template-columns: repeat(4, 1fr); }
  .doctor-list-head { align-items: flex-start; flex-direction: column; }
  .doctor-filters { width: 100%; }
  .doctor-filters .search-box { flex: 1; width: auto; }
  .doctor-activity-header { align-items: flex-start; flex-direction: column; }
  .doctor-activity-filters { width: 100%; flex-wrap: wrap; }
  .doctor-activity-filters .search-box { flex: 1 1 100%; width: 100%; }
  .doctor-activity-filters .form-select { flex: 1; width: auto; }
}

@media (max-width: 767.98px) {
  .admin-topbar { height: 72px; }
  .topbar-start small, .topbar-eyebrow { display: none; }
  .topbar-title { font-size: .82rem; }
  .billing-module-intro { align-items: flex-start; flex-direction: column; min-height: 0; padding: 1.2rem; }
  .billing-module-intro__icon { width: 68px; height: 68px; flex-basis: 68px; border-radius: 20px; font-size: 2rem; }
  .billing-module-intro__scope { align-items: stretch; flex-direction: column; }
  .bulk-sync-card .card-body, .hospital-list-header, .hospital-sync-hero { align-items: stretch; flex-direction: column; }
  .bulk-sync-button, .search-box { width: 100%; }
  .hospital-list-tools { align-items: stretch; flex-direction: column; width: 100%; }
  .hospital-connection-filter { width: 100%; min-width: 0; }
  .hospital-table-wrap { overflow-x: auto; }
  .sync-hero-actions .btn { flex: 1; }
  .doctor-filters { align-items: stretch; flex-wrap: wrap; }
  .doctor-filters .search-box { flex-basis: 100%; }
  .doctor-filters .form-select { flex: 1; width: auto; }
  .doctor-activity-filters { align-items: stretch; }
  .doctor-activity-filters .form-select { flex: 1 1 180px; }
  .doctor-activity-filters .btn { flex: 0 0 42px; }
  .doctor-hospital-connection { align-items: stretch; flex-direction: column; }
  .pagination-bar { align-items: flex-start; flex-direction: column; }
  .conflict-panel-head { align-items: flex-start; flex-direction: column; }
  .conflict-panel-actions { width: 100%; justify-content: space-between; }
}

@media (max-width: 575.98px) {
  .container-xxl { padding-inline: .75rem !important; }
  .page-heading h1 { font-size: 1.3rem; }
  .page-heading-actions { flex-direction: column; }
  .stat-card .card-body { padding: .85rem; }
  .bulk-sync-copy { align-items: flex-start; }
  .sync-stat-grid { grid-template-columns: 1fr; }
  .result-stat-row { grid-template-columns: repeat(2, 1fr); }
  .app-modal { padding: .4rem; }
  .app-modal .modal-dialog { min-height: calc(100vh - .8rem); }
  .app-modal .modal-header,
  .app-modal .modal-body { padding: .85rem; }
  .app-modal .modal-footer { padding: .7rem .85rem; }
  .app-modal .modal-footer .btn { flex: 1 1 auto; }
  .history-summary { grid-template-columns: 1fr; }
  .sync-modal .modal-dialog { max-width: calc(100vw - .8rem); }
  .sync-modal .modal-content { max-height: calc(100vh - .8rem); }
  .sync-progress-head { align-items: flex-start; flex-direction: column; }
  .auth-card { padding: 1.35rem; }
  .error-card { padding: 1.35rem; }
  .error-actions { flex-direction: column; }
  .activity-scope-note { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
.ai-model-policy{display:inline-flex;width:max-content;margin-top:.35rem;padding:.18rem .55rem;border-radius:999px;background:#eef2ff;color:#4f46e5;font-size:.72rem;font-weight:700}
.ai-analysis-archive{margin-top:1.25rem;overflow:hidden}
.ai-archive-filters{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr)) minmax(220px,1.5fr) minmax(135px,.8fr) minmax(135px,.8fr) auto;gap:.65rem;padding:1rem 1.25rem;border-bottom:1px solid #edf0f5;background:#fbfcff}
.ai-archive-filters .search-box{min-width:0}
.ai-archive-table{margin:0;min-width:980px;font-size:.78rem;line-height:1.35}
.ai-archive-table th{padding:.55rem .6rem;font-size:.72rem;white-space:nowrap;color:#596176}
.ai-archive-table td{padding:.55rem .6rem;vertical-align:middle}
.ai-archive-table td strong,.ai-archive-table td small{display:block}
.ai-archive-table td small{margin-top:.15rem;color:#7b849a;font-size:.68rem}
.ai-archive-table td:nth-child(2){min-width:155px}
.ai-archive-table .ai-tier,.ai-archive-table .analysis-status{font-size:.68rem;padding:.28rem .48rem;white-space:nowrap}
.archive-actions{display:flex;align-items:center;gap:.35rem;white-space:nowrap}
.archive-actions .btn{display:inline-flex;align-items:center;gap:.25rem;padding:.3rem .45rem;font-size:.7rem}
.archive-actions .btn-label-danger{color:#d6384a;background:#fff0f2;border-color:#ffd7dc}
.archive-actions .btn-label-danger:hover:not(:disabled){color:#fff;background:#d6384a;border-color:#d6384a}
.archive-actions .btn:disabled{opacity:.48}
.ai-tier,.analysis-status{display:inline-flex;padding:.3rem .65rem;border-radius:999px;font-size:.75rem;font-weight:800}
.ai-tier.pro{background:#ede9fe;color:#6d28d9}.ai-tier.flash{background:#e0f2fe;color:#0369a1}.ai-tier.flashlite{background:#dcfce7;color:#15803d}
.analysis-status.completed{background:#dcfce7;color:#15803d}.analysis-status.rejected{background:#fff7ed;color:#c2410c}.analysis-status.failed{background:#fee2e2;color:#b91c1c}.analysis-status.processing{background:#e0f2fe;color:#0369a1}
.ai-analysis-detail-modal .modal-dialog{width:min(1400px,96vw)}
.ai-analysis-detail-body{max-height:78vh;overflow:auto;background:#f7f8fc}
.analysis-meta-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.75rem;margin-bottom:1rem}
.analysis-meta-grid>div{padding:.85rem 1rem;border:1px solid #e6e9f0;border-radius:12px;background:#fff}
.analysis-meta-grid small,.analysis-meta-grid strong{display:block}.analysis-meta-grid small{color:#7b849a;margin-bottom:.25rem}.analysis-meta-grid strong{overflow-wrap:anywhere}
.analysis-payload-section{margin-top:1rem;border:1px solid #e2e6ef;border-radius:14px;background:#fff;overflow:hidden}
.analysis-payload-section h4{margin:0;padding:.85rem 1rem;border-bottom:1px solid #e8ebf2;font-size:.9rem;color:#334155;background:#fafbfe}
.analysis-payload-section pre{margin:0;padding:1rem;max-height:420px;overflow:auto;white-space:pre-wrap;word-break:break-word;font-family:inherit;font-size:.82rem;line-height:1.9;color:#263244;background:#fff}
.analysis-payload-section.response{border-color:#c7d2fe}.analysis-payload-section.response h4{background:#eef2ff;color:#4338ca}
@media(max-width:1200px){.ai-archive-filters{grid-template-columns:repeat(3,1fr)}.analysis-meta-grid{grid-template-columns:repeat(2,1fr)}.archive-actions .btn span{display:none}.archive-actions .btn{font-size:.85rem;padding:.32rem .42rem}}
@media(max-width:720px){.ai-archive-filters{grid-template-columns:1fr}.analysis-meta-grid{grid-template-columns:1fr}}

/* Kavosh modules */
.user-menu-action.neutral { color: #536780; }
.user-menu-action.neutral:hover { color: var(--py-primary); background: #eef4ff; }
.scope-banner { display: flex; align-items: center; gap: .85rem; padding: .9rem 1rem; border: 1px solid #dfe8f6; border-radius: 1rem; background: linear-gradient(135deg, #fff, #f4f8ff); }
.scope-banner-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; color: var(--py-primary); background: #e7efff; font-size: 1.3rem; }
.scope-banner > div { min-width: 0; }
.scope-banner strong, .scope-banner small { display: block; }
.scope-banner strong { color: var(--py-heading); font-size: .82rem; font-weight: 900; }
.scope-banner small { margin-top: .18rem; color: #7f90a7; font-size: .67rem; }
.read-only-badge { display: inline-flex; align-items: center; gap: .3rem; margin-right: auto; padding: .42rem .7rem; border-radius: 999px; color: #1f8257; background: #e5f8ee; font-size: .65rem; font-weight: 900; white-space: nowrap; }
.report-panel, .connection-overview, .hospital-admin-card, .user-admin-card, .report-table-card { overflow: hidden; border: 1px solid rgba(230, 234, 241, .9); box-shadow: 0 4px 16px rgba(42, 57, 100, .04); }
.report-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; border-bottom: 1px solid #edf0f5; }
.report-panel-head > div { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.report-panel-head h2, .report-panel-head small { display: block; }
.report-panel-head h2 { margin: 0; color: var(--py-heading); font-size: .88rem; font-weight: 900; }
.report-panel-head small { margin-top: .18rem; color: #8a98aa; font-size: .61rem; }
.report-table-actions, .report-page-actions { flex: 0 0 auto; flex-wrap: nowrap; }
.report-table-actions .btn, .report-table-actions .form-select, .report-page-actions .btn { flex: 0 0 auto; white-space: nowrap; }
.report-table-actions .btn, .report-table-actions .column-picker-trigger { min-height: 42px; }
.report-table-actions .select2-container { width: 116px !important; flex: 0 0 116px; }
.report-table-actions .select2-container .select2-selection--single { height: 42px; }
.report-table-actions .select2-container .select2-selection--single .select2-selection__rendered { padding-right: .75rem; padding-left: 2.2rem; line-height: 40px; white-space: nowrap; }
.report-table-actions .select2-container .select2-selection--single .select2-selection__arrow { left: .45rem; }
.column-picker { position: relative; flex: 0 0 auto; }
.column-picker > summary { list-style: none; }
.column-picker > summary::-webkit-details-marker { display: none; }
.column-picker-trigger { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .7rem; border: 1px solid #dfe5ee; border-radius: .7rem; color: #627792; background: #f8faff; cursor: pointer; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.column-picker-trigger:hover, .column-picker[open] .column-picker-trigger { color: var(--py-primary); border-color: #b9cef4; background: #eef4ff; }
.column-picker-trigger > i { font-size: 1.05rem; }
.column-picker-trigger > small { margin: 0; padding: .18rem .35rem; border-radius: 999px; color: #6881a7; background: #e8effa; font-size: .5rem; line-height: 1; }
.column-picker-menu { position: absolute; top: calc(100% + .5rem); inset-inline-end: 0; z-index: 1070; width: min(390px, calc(100vw - 2rem)); overflow: hidden; border: 1px solid #dfe6f1; border-radius: .9rem; background: #fff; box-shadow: 0 18px 45px rgba(37, 57, 111, .18); }
.column-picker-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem .85rem; border-bottom: 1px solid #edf1f6; background: #f8faff; }
.column-picker-head > div { display: block; }
.column-picker-head strong, .column-picker-head small { display: block; }
.column-picker-head strong { color: var(--py-heading); font-size: .7rem; }
.column-picker-head small { margin-top: .15rem; color: #8796aa; font-size: .55rem; }
.column-picker-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; max-height: 300px; overflow-y: auto; padding: .7rem; }
.column-picker-option { position: relative; display: flex; align-items: center; gap: .25rem; min-width: 0; padding: .22rem .3rem; border: 1px solid #e7ebf1; border-radius: .65rem; color: #61738d; background: #fff; font-size: .62rem; font-weight: 700; user-select: none; transition: opacity .15s ease, transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.column-picker-option:hover { border-color: #c7d8f6; background: #f5f8ff; }
.column-picker-option label { display: flex; align-items: center; gap: .45rem; min-width: 0; flex: 1; padding: .3rem .28rem; cursor: pointer; }
.column-picker-option input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--py-primary); }
.column-picker-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-drag-handle { display: grid; place-items: center; width: 28px; height: 32px; flex: 0 0 28px; padding: 0; border: 0; border-radius: .45rem; color: #9aa9bd; background: transparent; cursor: grab; touch-action: none; transition: color .15s ease, background .15s ease, transform .15s ease; }
.column-picker-option:hover .column-drag-handle { color: var(--py-primary); background: #e7efff; }
.column-drag-handle:hover { transform: scale(1.06); }
.column-drag-handle:active, .column-picker-options.is-sorting .column-drag-handle { cursor: grabbing; }
.column-drag-handle i { font-size: 1rem; pointer-events: none; }
.column-picker-options.is-sorting { cursor: grabbing; }
.column-sort-chosen, .sortable-chosen { border-color: #9bbbf4; background: #f4f7ff; box-shadow: 0 4px 12px rgba(90, 141, 238, 0.15); }
.column-sort-ghost, .sortable-ghost { opacity: .35 !important; border-color: #5a8dee !important; border-style: dashed !important; background: #eaf2ff !important; box-shadow: inset 0 0 0 1px rgba(90, 141, 238, .2); }
.column-sort-drag, .sortable-drag {
  z-index: 1105 !important;
  opacity: .98 !important;
  border-color: #5a8dee !important;
  background: #ffffff !important;
  box-shadow: 0 8px 24px rgba(90, 141, 238, 0.25) !important;
  transform: scale(1.02) !important;
}
.column-sort-drag .column-drag-handle { color: var(--py-primary); background: #e7efff; cursor: grabbing; }
@media (prefers-reduced-motion: reduce) {
  .column-picker-option,
  .column-drag-handle { transition: none; }
}
.report-icon { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 39px; border-radius: 12px; font-size: 1.15rem; }
.report-icon.primary { color: var(--py-primary); background: #eaf1ff; }
.report-icon.warning { color: #d98320; background: #fff1df; }
.report-icon.info { color: #009db4; background: #e2f8fb; }
.report-icon.purple { color: var(--py-indigo); background: #eeecff; }
.chart-empty-state { display: flex; min-height: 290px; flex-direction: column; align-items: center; justify-content: center; padding: 1.2rem; text-align: center; }
.chart-empty-state strong { margin-top: 1rem; color: #53657e; font-size: .8rem; }
.chart-empty-state small { max-width: 520px; margin-top: .3rem; color: #98a4b3; font-size: .63rem; line-height: 1.8; }
.chart-skeleton { display: flex; align-items: flex-end; gap: .55rem; width: min(460px, 92%); height: 115px; padding: 0 1rem .4rem; border-bottom: 1px dashed #d9e1ed; opacity: .75; }
.chart-skeleton span { flex: 1; min-width: 13px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #8fb1ef, #e0e9f9); }
.donut-placeholder { display: grid; place-items: center; width: 160px; height: 160px; margin: 1.8rem auto 1rem; border: 24px solid #edf2f9; border-top-color: #cbdaf3; border-right-color: #ddd8fa; border-radius: 50%; color: #9aa8ba; text-align: center; }
.donut-placeholder span, .donut-placeholder strong { display: block; }
.donut-placeholder span { font-size: 1.4rem; }
.donut-placeholder strong { font-size: .62rem; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; padding: 0 1rem 1.2rem; color: #75849a; font-size: .6rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.chart-legend i { width: 8px; height: 8px; border-radius: 3px; }
.chart-legend i.cash { background: var(--py-warning); }.chart-legend i.non-cash { background: var(--py-primary); }.chart-legend i.unapproved { background: var(--py-indigo); }
.status-pill.neutral { color: #68798f; background: #edf1f5; }
.status-pill.success { color: #177e49; background: #e5f9ee; border: 1px solid #c2eed4; }
.status-pill.danger { color: #c33d4a; background: #ffe9eb; }
.status-pill.disconnected { border: 1px solid #ffc8ce; box-shadow: 0 0 0 3px rgba(195, 61, 74, .06); font-weight: 900; }
.status-pill.disconnected i { font-size: .85rem; }
.status-pill.warning { color: #b66a14; background: #fff0dd; }
.connection-check-button { transition: transform .15s ease, box-shadow .15s ease; }
.connection-check-button.connection-check-disconnected { color: #c33d4a; background: #ffe9eb; border-color: #ffc8ce; box-shadow: 0 0 0 3px rgba(195, 61, 74, .06); }
.connection-check-button.connection-check-disconnected:hover:not(:disabled) { color: #fff; background: #c33d4a; border-color: #c33d4a; transform: translateY(-1px); }
.status-message { display: block; max-width: 170px; margin-top: .35rem; overflow: hidden; color: #8b98aa; font-size: .55rem; text-overflow: ellipsis; white-space: nowrap; }
.api-address, .api-cell code { direction: ltr; color: #52647e; font-family: Consolas, monospace; font-size: .6rem; text-align: left; unicode-bidi: plaintext; }
.connection-overview .table th, .admin-table th { padding: .75rem 1rem; color: #718099; background: #fbfcfe; font-size: .61rem; font-weight: 800; white-space: nowrap; }
.connection-overview .table td, .admin-table td { padding: .8rem 1rem; color: #65758d; font-size: .64rem; }
.empty-state.compact { min-height: 210px; }
.deduction-tabs { display: flex; gap: .35rem; overflow-x: auto; padding: .35rem; border: 1px solid #e5e9f0; border-radius: .9rem; background: #fff; }
.deduction-tabs a { padding: .58rem .85rem; border-radius: .65rem; color: #6f7e93; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.deduction-tabs a.active { color: #fff; background: linear-gradient(118deg, var(--py-primary), var(--py-indigo)); box-shadow: 0 4px 12px rgba(90, 141, 238, .2); }
.filter-card { padding: 1rem; border: 1px solid #e7ebf1; }
.filter-card .form-control-sm { min-height: 46px; padding-block: .55rem; }
.filter-card .report-filter-submit { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; min-height: 46px; padding-block: .55rem; white-space: nowrap; }
.report-filter-card { --report-filter-control-height: 46px; overflow: visible; border: 1px solid #e3e9f3; background: linear-gradient(145deg, #fff 0%, #fbfcff 100%); }
.report-filter-card__body { padding: .85rem; }
.report-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: .65rem; }
.report-filter-grid.has-grouping { grid-template-columns: minmax(240px, 1.05fr) minmax(140px, .55fr) minmax(190px, .82fr) minmax(190px, .82fr) minmax(285px, 1.15fr); }
.report-filter-grid.is-comparison { grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) minmax(200px, .72fr); margin-top: .7rem; }
.report-filter-field { min-width: 0; }
.report-filter-field > .form-label { display: block; min-height: 18px; margin: 0 0 .32rem; color: #667a96; font-size: .62rem; font-weight: 850; }
.report-filter-field .form-control-sm,
.report-filter-field .form-select-sm,
.report-filter-field .select2-container .select2-selection,
.report-filter-field .jalali-date-input,
.report-filter-submit { min-height: var(--report-filter-control-height); height: var(--report-filter-control-height); }
.report-filter-field--action .form-label { visibility: hidden; }
.report-filter-action-buttons { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; }
.report-filter-action-buttons .report-filter-submit { width: 100%; min-width: 0; white-space: nowrap; }
.report-filter-action-buttons .report-filter-reset { display: inline-flex; min-height: var(--report-filter-control-height); align-items: center; justify-content: center; gap: .25rem; white-space: nowrap; }
.report-filter-readonly { display: flex; min-height: 46px; align-items: center; gap: .4rem; border-color: #e3e8f0; color: #61738c; background: #f2f5f9; cursor: default; }
.report-filter-readonly i { color: var(--py-primary); font-size: 1rem; }
.filter-action-group > .btn { height: 46px; padding-block: 0; white-space: nowrap; }
.filter-action-group .filter-more-button i { transition: transform 0.3s ease; }
.filter-action-group .filter-more-button[aria-expanded="true"] i { transform: rotate(180deg); }

/* ── Smooth Animated Advanced Filters Panel ── */
.advanced-filters-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease,
              margin-top 0.35s ease,
              padding-top 0.35s ease,
              visibility 0.35s;
  overflow: hidden;
  border-top: 1px solid transparent;
}

.advanced-filters-panel.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top-color: #e2e8f0;
}

.advanced-filters-inner {
  min-height: 0;
  overflow: visible;
}
.advanced-filters-inner > .embedded-filter-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.advanced-filters-inner > .embedded-filter-panel .billing-filter-panel__header {
  padding-inline: .25rem;
  border-bottom-color: #edf1f6;
  background: transparent;
}
.advanced-filters-inner > .embedded-filter-panel .billing-filter-tabs {
  padding-inline: 0;
}
.advanced-filters-inner > .embedded-filter-panel .billing-filter-panel__body {
  padding-inline: .25rem;
}
.advanced-filters-inner > .embedded-filter-panel .billing-filter-panel__footer {
  padding-inline: .25rem;
  background: transparent;
}
.filter-options-loading {
  display: flex;
  min-height: 118px;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  color: #718099;
  font-size: .68rem;
}
.filter-options-loading i {
  color: var(--py-primary);
  font-size: 1.2rem;
}
.his-advanced-filters { margin-top: .15rem; padding: .9rem; border-color: #e3e9f3; background: linear-gradient(145deg, #fff, #fbfcff); }
.his-advanced-filters__title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .8rem; color: #718099; font-size: .64rem; }
.his-advanced-filters__title > div { display: inline-flex; align-items: center; gap: .38rem; color: #526b8f; font-size: .72rem; }
.his-advanced-filters__title i { color: var(--py-primary); font-size: 1.05rem; }
.his-advanced-filters .form-label { display: block; margin: 0 0 .28rem; color: #667a96; font-size: .61rem; font-weight: 800; }
.his-advanced-filters .form-control-sm, .his-advanced-filters .form-select-sm { min-height: 40px; font-size: .68rem; }
.his-filter-checks { display: flex; flex-wrap: wrap; gap: .55rem 1rem; margin-top: .8rem; padding-top: .72rem; border-top: 1px dashed #e1e8f2; }
.his-filter-checks .form-check { min-height: auto; margin: 0; padding-right: 2.2em; font-size: .64rem; color: #65758d; }
.his-filter-checks .form-check-input { float: right; margin-right: -2.2em; }
/* ── Delivered Services Advanced Filters Panel Animation & Popup Overflow ── */
.delivered-advanced-filters-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.35s ease;
  opacity: 0;
  margin-bottom: 0;
  overflow: visible;
}
.delivered-advanced-filters-panel.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-bottom: 1rem;
}
.delivered-advanced-filters-panel__inner {
  min-height: 0;
  overflow: visible;
}

.delivered-filter-panel {
  overflow: visible !important;
}
.delivered-filter-panel .billing-filter-panel__body {
  overflow: visible !important;
  max-height: none !important;
}
.delivered-filter-panel .billing-advanced-grid {
  overflow: visible !important;
}

.pdp-container,
.pdp-box,
.pdp-picker,
.persian-datepicker-container,
.datepicker-container,
.flatpickr-calendar,
.select2-dropdown {
  z-index: 10050 !important;
}

.delivered-filter-panel .billing-filter-tabs { margin-inline: -.15rem; overflow-x: auto; }
.delivered-filter-panel .billing-filter-tabs button { white-space: nowrap; }
.delivered-filter-panel .form-control-time { direction: ltr; text-align: center; letter-spacing: .04em; }
/* ── Skeleton Loading Animation ── */
.skeleton-pulse {
  background: linear-gradient(90deg, #edf1f7 25%, #e2e8f0 37%, #edf1f7 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 0.5rem;
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ── Delivered Services Analysis Cards & Donut Chart ── */
.ds-stat-card {
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ds-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(37, 57, 111, 0.12) !important;
}
.ds-stat-card--primary { background: linear-gradient(135deg, #5a8dee 0%, #477bbd 100%); }
.ds-stat-card--success { background: linear-gradient(135deg, #28c76f 0%, #1f9d57 100%); }
.ds-stat-card--info { background: linear-gradient(135deg, #00bad1 0%, #0093a6 100%); }
.ds-stat-card--warning { background: linear-gradient(135deg, #ff9f43 0%, #e08328 100%); }

.ds-stat-label { color: rgba(255, 255, 255, 0.88); font-size: 0.72rem; font-weight: 700; }
.ds-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 1.35rem;
  backdrop-filter: blur(4px);
}

/* Donut Chart SVG & Center Info */
.ds-donut-wrapper {
  position: relative;
  width: min(100%, 230px);
  height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ds-donut-svg {
  width: 100%;
  height: 100%;
}
.ds-donut-bg {
  fill: none;
  stroke: #f1f5fb;
  stroke-width: 22;
}
.ds-donut-segment {
  fill: none;
  stroke-width: 22;
  stroke-linecap: round;
  transition: stroke-dasharray 0.8s ease, stroke-dashoffset 0.8s ease;
}
.ds-donut-segment--insurer { stroke: #00bad1; }
.ds-donut-segment--insured { stroke: #ff9f43; }

.ds-donut-center-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 1rem;
}
.ds-donut-center-label {
  font-size: 0.65rem;
  color: #8492a6;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.ds-donut-center-value {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--py-heading);
  line-height: 1.25;
}

.ds-donut-legend { width: 100%; }
.ds-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  color: #516377;
}
.ds-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
}
.ds-legend-dot--insurer { background: #00bad1; }
.ds-legend-dot--insured { background: #ff9f43; }
.ds-legend-pct { color: var(--py-heading); font-size: 0.75rem; margin-right: 0.2rem; }

/* Breakdown Box Cards */
.ds-breakdown-box {
  border: 1px solid #edf1f7;
  transition: background 0.15s ease;
}
.ds-breakdown-box--insurer { background: #f4fcfe; border-color: #d1f4fa; }
.ds-breakdown-box--insured { background: #fffcf8; border-color: #ffe8d1; }

.ds-breakdown-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.filter-action-group .filter-apply-button i { font-size: 1.15rem; }
.filter-apply-button,
.report-filter-submit { position: relative; overflow: hidden; isolation: isolate; }
.filter-apply-button.is-loading:disabled,
.report-filter-submit.is-loading:disabled {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(115deg, #4f86ee 0%, #6f72ef 52%, #5b90f1 100%);
  opacity: 1;
  cursor: progress;
  box-shadow: 0 6px 16px rgba(79, 134, 238, .22);
}
.filter-apply-button.is-loading::before,
.report-filter-submit.is-loading::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  content: "";
  background: linear-gradient(105deg, transparent 24%, rgba(255,255,255,.18) 43%, rgba(255,255,255,.3) 50%, rgba(255,255,255,.18) 57%, transparent 76%);
  transform: translateX(120%);
  animation: filter-loading-sheen 1.8s ease-in-out infinite;
}
.filter-button-loading {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: .48rem;
  white-space: nowrap;
}
.filter-button-loading__label { font-size: .72rem; font-weight: 850; letter-spacing: -.01em; }
.filter-button-loading__dots { display: inline-flex; align-items: center; gap: 3px; direction: ltr; }
.filter-button-loading__dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  animation: filter-loading-dot 1.05s ease-in-out infinite;
}
.filter-button-loading__dots i:nth-child(2) { animation-delay: .14s; }
.filter-button-loading__dots i:nth-child(3) { animation-delay: .28s; }
.filter-button-loading.compact { min-width: 34px; justify-content: center; }
.number-ltr { display: inline-block; direction: ltr; unicode-bidi: isolate; }
@keyframes filter-loading-dot {
  0%, 60%, 100% { opacity: .38; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
@keyframes filter-loading-sheen {
  0% { transform: translateX(120%); }
  55%, 100% { transform: translateX(-120%); }
}
@media (prefers-reduced-motion: reduce) {
  .filter-apply-button.is-loading::before,
  .report-filter-submit.is-loading::before,
  .filter-button-loading__dots i { animation-duration: 2.8s; }
}
.filter-guidance { display: flex; align-items: center; gap: .35rem; margin-top: .55rem; color: #7a8da8; font-size: .62rem; }
.filter-guidance i { color: var(--py-primary); font-size: .9rem; }
.filter-guidance.danger { color: #c64b52; }
.filter-guidance.danger i { color: var(--py-danger); }
.required-indicator { color: var(--py-danger); font-size: .72rem; font-weight: 900; }
.mini-stat { display: flex; height: 100%; flex-direction: row; align-items: center; gap: .8rem; padding: .9rem 1rem; border: 1px solid #e8ebf1; }
.mini-stat > div small, .mini-stat > div strong { display: block; }
.mini-stat small { color: #8795a8; font-size: .66rem; }
.mini-stat strong { margin-top: .08rem; color: var(--py-heading); font-size: 1.15rem; }
.report-empty { min-height: 280px; border-radius: 0; border-width: 0; border-top: 1px solid #edf0f5; box-shadow: none; }
.report-option { display: flex; min-height: 108px; flex-direction: row; align-items: center; gap: .8rem; padding: 1rem; border: 1px solid #e7ebf2; color: inherit; transition: transform .16s ease, box-shadow .16s ease; }
.report-option:hover { transform: translateY(-2px); color: inherit; box-shadow: 0 9px 24px rgba(42, 57, 100, .09); }
.report-option.disabled { opacity: .78; cursor: default; }
.report-option > div { flex: 1; min-width: 0; }
.report-option strong, .report-option small { display: block; }
.report-option strong { color: var(--py-heading); font-size: .75rem; }
.report-option small { margin-top: .25rem; color: #8b98aa; font-size: .6rem; line-height: 1.7; }
.report-option > .bx-left-arrow-alt { color: #a5b1c1; font-size: 1.1rem; }
.report-sort-controls { display: flex; min-height: 38px; align-items: center; gap: .35rem; padding: .18rem .25rem; border: 1px solid #dfe6f0; border-radius: .65rem; background: #f9fbfe; }
.report-sort-controls > .bx { flex: 0 0 auto; margin: 0 .25rem; color: var(--py-primary); font-size: 1rem; }
.report-sort-controls > .form-select { width: 158px; min-height: 32px; border: 0; background-color: transparent; color: #526985; font-size: .6rem; font-weight: 800; box-shadow: none; }
.report-table-actions .report-sort-controls > .select2-container { width: 190px !important; flex: 0 0 190px; }
.sort-direction-toggle { display: flex; align-items: center; gap: .18rem; padding-right: .25rem; border-right: 1px solid #e2e8f1; }
.sort-direction-toggle button { display: inline-flex; min-height: 30px; align-items: center; gap: .2rem; padding: .28rem .45rem; border: 0; border-radius: .45rem; color: #8291a5; background: transparent; font: inherit; font-size: .56rem; font-weight: 800; white-space: nowrap; transition: color .15s ease, background .15s ease, box-shadow .15s ease; }
.sort-direction-toggle button:hover:not(:disabled) { color: var(--py-primary); background: #eef4ff; }
.sort-direction-toggle button.active { color: #fff; background: var(--py-primary); box-shadow: 0 3px 8px rgba(90, 141, 238, .22); }
.sort-direction-toggle button:disabled { opacity: .55; cursor: not-allowed; }
.deduction-data-table th > span { display: inline-flex; align-items: center; gap: .25rem; }
.deduction-data-table th.is-sorted { color: var(--py-primary); background: #eef4ff; }
.deduction-data-table th.is-sorted i { font-size: .85rem; }
.deduction-sort-header { display: inline-flex; width: 100%; min-height: 34px; align-items: center; justify-content: center; gap: .35rem; padding: .25rem .35rem; border: 0; border-radius: .45rem; color: inherit; background: transparent; font: inherit; font-weight: inherit; white-space: nowrap; cursor: pointer; }
.deduction-sort-header:hover:not(:disabled), .deduction-sort-header:focus-visible { color: var(--py-primary); background: #e9f1ff; outline: 0; }
.deduction-sort-header:disabled { cursor: wait; opacity: .65; }
.deduction-data-table tbody tr { cursor: pointer; transition: background-color .12s ease, box-shadow .12s ease; }
.deduction-data-table tbody tr.is-selected td { background: #edf4ff !important; box-shadow: inset 0 1px 0 #c7dafb, inset 0 -1px 0 #c7dafb; }
.deduction-data-table tbody tr:focus-visible { outline: 2px solid rgba(90,141,238,.55); outline-offset: -2px; }
.report-table-scroll-top { height: 15px; overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid #edf1f6; scrollbar-color: #b9c9df transparent; scrollbar-width: thin; }
.report-table-scroll-top .report-table-scroll-spacer { height: 1px; }
.report-table-scroll { max-height: min(70dvh, 760px); overflow: auto; overscroll-behavior: contain; scrollbar-color: #b9c9df transparent; scrollbar-width: thin; }
.report-table-scroll thead th { position: sticky; z-index: 3; top: 0; background: #f6f8fb; box-shadow: 0 3px 7px rgba(37,57,91,.08); }
.report-table-scroll .deduction-data-table thead th { position: sticky; z-index: 3; top: 0; background: #f6f8fb; box-shadow: 0 3px 7px rgba(37,57,91,.08); }
.report-table-scroll .deduction-data-table thead th:first-child { z-index: 5; }
.export-note { display: flex; align-items: flex-start; gap: .8rem; padding: 1rem; border: 1px solid #dfe9f8; background: #f7faff; }
.export-note > i { color: var(--py-primary); font-size: 1.35rem; }.export-note strong, .export-note span { display: block; }.export-note strong { color: #4d6382; font-size: .73rem; }.export-note span { margin-top: .2rem; color: #8391a4; font-size: .63rem; }
.api-cell strong, .api-cell small, .source-identity strong, .source-identity small { display: block; }
.api-cell small, .source-identity small { margin-top: .25rem; color: #919daf; font-size: .55rem; }
.source-identity strong { color: #52647e; font-size: .64rem; }
.table-actions { display: flex; align-items: center; gap: .3rem; white-space: nowrap; }
.app-modal { display: grid !important; place-items: center; }
.app-modal-backdrop { position: absolute; inset: 0; z-index: 0; border: 0; background: transparent; cursor: default; }
.app-modal-dialog { position: relative; z-index: 1; width: min(100%, 700px); max-height: calc(100vh - 2rem); overflow: auto; border: 1px solid rgba(224, 231, 241, .95); border-radius: 1.15rem; background: #fff; box-shadow: 0 28px 80px rgba(13, 25, 48, .32); }
.app-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid #e5ebf3; background: linear-gradient(135deg, #fff, #f7faff); }
.app-modal-body { padding: 1.15rem; }.app-modal-footer { display: flex; justify-content: flex-start; gap: .5rem; padding: .8rem 1.15rem; border-top: 1px solid #e5ebf3; background: #f7f9fc; }
.ltr-input { direction: ltr; text-align: left; unicode-bidi: plaintext; }
.validation-message { display: block; margin-top: .25rem; color: var(--py-danger); font-size: .58rem; }
.form-hint { display: flex; align-items: flex-start; gap: .3rem; margin-top: .35rem; color: #8c99ab; font-size: .56rem; line-height: 1.7; }
.user-identity { display: flex; align-items: center; gap: .65rem; min-width: 155px; }
.user-identity > span { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; color: var(--py-primary); background: #eaf1ff; font-size: .65rem; font-weight: 900; }
.user-identity strong, .user-identity small { display: block; }.user-identity strong { color: #53657e; font-size: .68rem; }.user-identity small { margin-top: .16rem; direction: ltr; color: #929fb0; font-size: .55rem; text-align: right; }
.role-badge, .all-access { display: inline-flex; align-items: center; gap: .3rem; padding: .32rem .55rem; border-radius: 999px; font-size: .58rem; font-weight: 900; white-space: nowrap; }
.role-badge.admin { color: #6a55d8; background: #efecff; }.role-badge.supervisor { color: #1978a0; background: #e5f6fb; }.role-badge.hospital-user { color: #2b8259; background: #e7f8ef; }.all-access { color: #6a55d8; background: #f2efff; }
.access-list { display: flex; flex-wrap: wrap; gap: .25rem; min-width: 150px; }.access-list span { padding: .24rem .4rem; border-radius: 999px; color: #627797; background: #eef4fc; font-size: .54rem; font-weight: 700; }
.date-cell { direction: ltr; white-space: nowrap; }
.phone-cell { display: inline-block; direction: ltr; color: #60738f; font-size: .62rem; white-space: nowrap; unicode-bidi: isolate; }
.hospital-access-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .65rem; }
.hospital-access-heading > div { min-width: 0; }
.hospital-access-heading small { display: block; margin-top: .18rem; color: #8796aa; font-size: .56rem; }
.hospital-select-all { flex: 0 0 auto; min-height: 36px; white-space: nowrap; }
.hospital-access-search { position: relative; margin-bottom: .65rem; }
.hospital-access-search > .bx-search { position: absolute; top: 50%; right: .85rem; z-index: 1; transform: translateY(-50%); color: #8fa0b6; font-size: 1rem; pointer-events: none; }
.hospital-access-search .form-control { height: 44px; padding-right: 2.5rem; padding-left: 2.7rem; border-color: #e0e7f1; background: #fbfcff; }
.hospital-access-search .btn-icon { position: absolute; top: 50%; left: .42rem; width: 32px; height: 32px; min-width: 32px; transform: translateY(-50%); border: 0; color: #8d9caf; background: transparent; }
.hospital-access-search .btn-icon:hover { color: var(--py-danger); background: #fff0f1; }
.hospital-access-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; max-height: 260px; overflow: auto; padding: .15rem .15rem .15rem .35rem; scrollbar-width: thin; scrollbar-color: #c8d5e8 transparent; }
.access-option { position: relative; margin: 0; cursor: pointer; }
.access-option > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.access-option > span { display: flex; min-height: 62px; align-items: center; gap: .6rem; padding: .65rem .7rem; border: 1px solid #e2e8f1; border-radius: .8rem; background: #fbfcff; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease; }
.access-option:hover > span { border-color: #bfd0ed; background: #f7faff; transform: translateY(-1px); }
.access-option > input:focus-visible + span { outline: 3px solid rgba(90, 141, 238, .2); outline-offset: 1px; }
.access-option > input:checked + span { border-color: #7ea4ec; background: #eef4ff; box-shadow: 0 0 0 2px rgba(90, 141, 238, .08); }
.access-option > span > .bx-building-house { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; color: var(--py-primary); background: #edf3ff; font-size: 1.05rem; }
.access-option-text { flex: 1; min-width: 0; }
.access-option strong, .access-option small { display: block; }
.access-option strong { overflow: hidden; color: #53657e; font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.access-option small { display: flex; align-items: center; gap: .2rem; margin-top: .18rem; color: #929faf; font-size: .54rem; }
.access-option small i { font-size: .7rem; }
.access-option-check { display: grid; width: 23px; height: 23px; flex: 0 0 23px; place-items: center; border: 1px solid #d9e2ef; border-radius: 50%; color: transparent; background: #fff; font-size: .85rem; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.access-option > input:checked + span .access-option-check { border-color: var(--py-primary); color: #fff; background: var(--py-primary); }
.hospital-access-empty { grid-column: 1 / -1; display: grid; min-height: 120px; place-items: center; align-content: center; gap: .2rem; border: 1px dashed #dce5f1; border-radius: .8rem; color: #8c9bb0; background: #fbfcfe; text-align: center; }
.hospital-access-empty > i { color: #9bb1d1; font-size: 1.55rem; }
.hospital-access-empty strong { color: #657b99; font-size: .65rem; }
.hospital-access-empty small { font-size: .55rem; }
.auth-kicker { display: inline-flex; margin-bottom: .4rem; color: var(--py-primary); font-size: .62rem; font-weight: 900; }
.auth-security-note { display: flex; align-items: flex-start; gap: .45rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid #edf0f5; color: #8492a6; font-size: .59rem; line-height: 1.8; }.auth-security-note i { color: var(--py-success); font-size: 1rem; }
.auth-locked-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto .6rem; border-radius: 20px; color: var(--py-primary); background: #eaf1ff; font-size: 1.8rem; }

/* ── Clickable stat cards ── */
.stat-card.clickable, .mini-stat.clickable { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.stat-card.clickable:hover, .mini-stat.clickable:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(42, 57, 100, .1); }
.stat-card.clickable:focus-visible, .mini-stat.clickable:focus-visible { outline: 3px solid rgba(90, 141, 238, .25); outline-offset: 2px; }
.stat-count { display: block; margin-top: .1rem; color: #8795a8; font-size: .6rem; font-weight: 400; }

/* Wide deduction table: adapt to the user's selected columns. */
.deduction-data-table { width: max-content; min-width: 100%; font-size: .76rem; }
.deduction-data-table th { color: #687b96; font-size: .64rem; white-space: nowrap; }
.deduction-data-table td { max-width: 190px; color: #566b87; white-space: nowrap; }
.deduction-data-table td.col-truncate { overflow: hidden; text-overflow: ellipsis; }
.deduction-data-table th:first-child,
.deduction-data-table td:first-child { position: sticky; right: 0; z-index: 2; background: #fff; box-shadow: -1px 0 #edf0f5; }
.deduction-data-table thead th:first-child { z-index: 4; background: #f8f9fb; }
.deduction-data-table th:last-child,
.deduction-data-table td:last-child { position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: 1px 0 #edf0f5; }
.deduction-data-table thead th:last-child { z-index: 4; background: #f8f9fb; }
.deduction-data-table tbody tr:hover td:first-child,
.deduction-data-table tbody tr:hover td:last-child { background: #f8faff; }

/* ── Stat icon variants ── */
.stat-icon.danger, .mini-stat > .stat-icon.danger { color: var(--py-danger); background: #ffe9eb; }
.stat-icon.purple, .mini-stat > .stat-icon.purple { color: var(--py-indigo); background: #eeecff; }
.stat-icon.secondary, .mini-stat > .stat-icon.secondary { color: #8795a8; background: #f0f2f5; }

/* ── Compact deduction details ── */
.deduction-detail-dialog { width: min(96vw, 1400px); max-height: calc(100vh - 1.5rem); overflow: hidden; }
.deduction-detail-modal-body { max-height: calc(100vh - 145px); overflow-y: auto; background: #f6f8fc; }
.deduction-detail-overview { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; padding: .8rem 1rem; border: 1px solid #dfe7f4; border-radius: .85rem; background: linear-gradient(135deg, #fff, #f4f8ff); }
.deduction-detail-overview > div { min-width: 0; }
.deduction-detail-overview p { margin: .3rem 0 0; color: #7d8da3; font-size: .61rem; }
.deduction-detail-overview > strong { flex: 0 0 auto; color: var(--py-heading); font-size: 1.25rem; }
.deduction-amount-inline { display: inline-flex; direction: rtl; align-items: baseline; gap: .32rem; white-space: nowrap; }
.deduction-amount-inline > span { direction: ltr; unicode-bidi: isolate; }
.deduction-detail-overview > strong small { color: #8796aa; font-size: .58rem; font-weight: 700; }
.deduction-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.deduction-detail-card { min-width: 0; padding: .75rem .85rem; border: 1px solid #e3e8f0; border-radius: .8rem; background: #fff; box-shadow: 0 2px 8px rgba(42, 57, 100, .03); }
.deduction-detail-card h3 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .55rem; padding-bottom: .48rem; border-bottom: 1px solid #edf1f5; color: var(--py-heading); font-size: .68rem; font-weight: 900; }
.deduction-detail-card h3 i { color: var(--py-primary); font-size: 1rem; }
.compact-detail-list { margin: 0; }
.compact-detail-list > div { display: grid; grid-template-columns: minmax(82px, .8fr) minmax(0, 1.2fr); align-items: start; gap: .5rem; padding: .34rem 0; border-bottom: 1px dashed #edf0f4; }
.compact-detail-list > div:last-child { border-bottom: 0; }
.compact-detail-list dt { color: #8a98aa; font-size: .57rem; font-weight: 700; }
.compact-detail-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: #52657f; font-size: .61rem; font-weight: 700; }

/* ── Pagination ── */
.pagination { direction: ltr; }
.pagination .page-link { min-width: 32px; padding: .3rem .5rem; border-color: #e5ebf3; color: var(--py-primary); font-size: .7rem; text-align: center; }
.pagination .page-item.active .page-link { background: var(--py-primary); border-color: var(--py-primary); color: #fff; }
.pagination .page-item.disabled .page-link { color: #c4cdd8; }

/* ── Deduction Chart Component Styles ── */
.deduction-chart-container { padding: 1rem; }
.bar-chart-wrapper {
  max-height: 400px;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding-left: 0.35rem;
  padding-bottom: 0.5rem;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #c2cfdf #f1f4f9;
}
.bar-chart-wrapper::-webkit-scrollbar { width: 6px; }
.bar-chart-wrapper::-webkit-scrollbar-track { background: #f1f4f9; border-radius: 4px; }
.bar-chart-wrapper::-webkit-scrollbar-thumb { background: #c2cfdf; border-radius: 4px; }
.bar-chart-wrapper::-webkit-scrollbar-thumb:hover { background: #94a6be; }

.bar-chart-items { display: flex; flex-direction: column; gap: .75rem; margin: 0; padding: 0; }
.bar-chart-row { display: grid; grid-template-columns: minmax(190px, 1.7fr) minmax(110px, .72fr) minmax(135px, .9fr); align-items: center; gap: .7rem; font-size: .7rem; }
.bar-chart-row.clickable { cursor: pointer; border-radius: .4rem; padding: .2rem .4rem; transition: background .15s ease; }
.bar-chart-row.clickable:hover { background: #f0f4fd; }
.bar-label { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--py-heading); font-weight: 700; line-height: 1.65; overflow-wrap: anywhere; }
.bar-track { width: 100%; height: 16px; overflow: hidden; border-radius: 8px; background: #eef2f9; }
.bar-fill { display: flex; min-width: 42px; height: 100%; align-items: center; justify-content: center; border-radius: 8px; color: #fff; background: linear-gradient(90deg, var(--py-primary), var(--py-indigo)); box-shadow: 0 2px 5px rgba(90, 141, 238, .22); transition: width .4s ease; }
.bar-fill span { padding-inline: .3rem; font-size: .53rem; font-weight: 900; line-height: 1; white-space: nowrap; text-shadow: 0 1px 2px rgba(35, 52, 92, .28); }
.bar-value { min-width: 0; color: #526784; text-align: left; direction: ltr; white-space: nowrap; }
.bar-value strong { color: var(--py-heading); }

.donut-legend-list { display: flex; flex-direction: column; gap: .6rem; }
.donut-legend-item { display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; border-radius: .6rem; border: 1px solid #edf1f7; background: #fbfcfe; transition: background .15s ease, border-color .15s ease; }
.donut-legend-item.clickable { cursor: pointer; }
.donut-legend-item.clickable:hover { background: #f4f8ff; border-color: #c8dafc; }
.legend-color-dot { width: 12px; height: 12px; border-radius: 4px; flex: 0 0 12px; }
.legend-info { flex: 1; min-width: 0; }
.legend-title { display: block; font-weight: 700; color: var(--py-heading); font-size: .72rem; }
.legend-sub { display: block; color: #8795a8; font-size: .6rem; }
.legend-amount { color: var(--py-heading); font-size: .78rem; font-weight: 900; }
.report-ring-chart { display: flex; min-height: 300px; flex-direction: column; align-items: center; justify-content: center; gap: .65rem; }
.report-ring-chart__canvas { position: relative; width: min(100%, 340px); height: 248px; }
.report-ring-chart__canvas canvas { width: 100% !important; height: 100% !important; }
.report-ring-chart__legend { display: flex; max-width: 100%; align-items: center; justify-content: center; gap: .35rem .75rem; flex-wrap: wrap; padding-inline: .45rem; }
.report-ring-chart__legend-item { display: inline-flex; min-width: 0; max-width: 190px; align-items: flex-start; gap: .35rem; color: #71819a; font-size: .57rem; font-weight: 700; line-height: 1.55; }
.report-ring-chart__legend-item i { width: 8px; height: 8px; margin-top: .2rem; flex: 0 0 8px; border-radius: 50%; }
.report-ring-chart__legend-item span { display: -webkit-box; min-width: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.report-line-chart-card { overflow: hidden; }
.report-line-chart-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; }
.report-line-chart-header > div:first-child { min-width: 0; }
.report-line-chart-header strong { color: var(--py-heading); font-size: .85rem; font-weight: 900; }
.report-line-chart-header small { display: block; margin-top: .25rem; color: #8d9aad; font-size: .62rem; }
.report-line-chart-header-actions { display: flex; align-items: center; gap: .65rem; flex: 0 0 auto; }
.report-line-chart-total { flex: 0 0 auto; padding: .55rem .75rem; border-radius: .7rem; background: #f1f5fb; text-align: left; }
.report-line-chart-total span { display: block; color: #8b98aa; font-size: .56rem; }
.report-line-chart-total strong { display: block; margin-top: .12rem; color: #506583; font-size: .72rem; white-space: nowrap; }
.report-line-chart-total bdi { color: var(--py-primary); }
.report-chart-export { display: inline-flex; align-items: stretch; gap: .35rem; }
.report-chart-export .btn { display: inline-flex; align-items: center; justify-content: center; gap: .28rem; min-width: 66px; min-height: 38px; white-space: nowrap; }
.report-chart-export .btn i { font-size: 1rem; }
.report-line-chart { position: relative; width: 100%; height: 420px; }
.report-line-chart canvas { width: 100% !important; height: 100% !important; }

.report-grouping-selector { display: grid; min-height: 46px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: .35rem; padding: .3rem; border: 1px solid #e1e7f0; border-radius: .7rem; background: #f4f7fb; }
.report-grouping-selector .btn { min-width: 0; min-height: 38px; overflow: hidden; padding-inline: .55rem; text-overflow: ellipsis; white-space: nowrap; }
.report-filter-grid.has-grouping .report-grouping-selector { height: 46px; min-height: 46px; grid-template-columns: 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: .16rem; padding: .18rem; }
.report-filter-grid.has-grouping .report-grouping-selector .btn { min-height: 0; padding: 0 .4rem; border-radius: .42rem; font-size: .56rem; line-height: 1; }
.comparison-hospital-picker { padding: .75rem; border: 1px solid #e3e9f3; border-radius: .8rem; background: #fbfcff; }
.comparison-hospital-picker__header, .report-aggregate-table-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.comparison-hospital-picker__header label, .report-aggregate-table-header strong { color: var(--py-heading); font-weight: 900; }
.comparison-hospital-picker__header small, .report-aggregate-table-header small { display: block; margin-top: .15rem; color: #8c99ab; font-size: .59rem; }
.comparison-hospital-picker__actions { display: flex; gap: .4rem; flex: 0 0 auto; }
.comparison-hospital-picker__search { position: relative; margin-top: .65rem; }
.comparison-hospital-picker__search > i { position: absolute; z-index: 1; top: 50%; right: .8rem; color: #90a0b5; transform: translateY(-50%); }
.comparison-hospital-picker__search .form-control { padding-right: 2.2rem; }
.comparison-hospital-picker__items { display: grid; max-height: 215px; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .45rem; margin-top: .65rem; overflow-y: auto; }
.comparison-hospital-option { display: flex; align-items: center; gap: .45rem; min-width: 0; padding: .5rem .55rem; border: 1px solid #e4e9f2; border-radius: .7rem; background: #fff; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.comparison-hospital-option:hover { border-color: #b9cdf8; }
.comparison-hospital-option.selected { border-color: #6b9af4; background: #eef4ff; box-shadow: 0 0 0 2px rgba(90, 141, 238, .08); }
.comparison-hospital-option > input { position: absolute; opacity: 0; pointer-events: none; }
.comparison-hospital-option__check { display: inline-flex; width: 22px; height: 22px; flex: 0 0 22px; align-items: center; justify-content: center; border: 1px solid #d5deeb; border-radius: 50%; color: transparent; background: #fff; font-size: .8rem; }
.comparison-hospital-option.selected .comparison-hospital-option__check { border-color: var(--py-primary); color: #fff; background: var(--py-primary); }
.comparison-hospital-option > span:last-child { min-width: 0; }
.comparison-hospital-option strong, .comparison-hospital-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comparison-hospital-option strong { color: var(--py-heading); font-size: .67rem; }
.comparison-hospital-option small { margin-top: .1rem; color: #93a0b2; font-size: .56rem; }
.comparison-hospital-picker__hint { display: block; margin-top: .55rem; color: #8493a8; font-size: .58rem; }
.comparison-hospital-picker__empty { grid-column: 1 / -1; padding: 1rem; color: #8f9daf; text-align: center; font-size: .64rem; }
.report-aggregate-table-card { overflow: hidden; }
.report-aggregate-table-header { padding: .85rem 1rem; }
.report-aggregate-table-header__actions { display: flex; align-items: center; gap: .65rem; flex: 0 0 auto; }
.report-aggregate-export-actions { display: inline-flex; align-items: stretch; gap: .4rem; }
.report-aggregate-export-actions .btn { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: .3rem; white-space: nowrap; }
.report-aggregate-export-actions .btn i { font-size: 1rem; }
.report-aggregate-table { min-width: 860px; }
.report-aggregate-table th { color: #63758f; background: #f5f7fb; font-size: .61rem; white-space: nowrap; }
.report-aggregate-table thead th { position: sticky; z-index: 3; top: 0; box-shadow: 0 3px 7px rgba(37,57,91,.08); }
.report-aggregate-table th.is-sorted { color: var(--py-primary); background: #eef4ff; }
.report-sort-header { display: inline-flex; width: 100%; min-height: 34px; align-items: center; justify-content: center; gap: .35rem; padding: .25rem .35rem; border: 0; border-radius: .45rem; color: inherit; background: transparent; font: inherit; font-weight: inherit; white-space: nowrap; cursor: pointer; }
.report-sort-header:hover:not(:disabled), .report-sort-header:focus-visible { color: var(--py-primary); background: #e9f1ff; outline: 0; }
.report-aggregate-table tbody tr { cursor: pointer; transition: background-color .12s ease; }
.report-aggregate-table tbody tr:hover td, .report-aggregate-table tbody tr:focus-visible td { background: #f8faff; }
.report-aggregate-table tbody tr.is-selected td { background: #edf4ff !important; box-shadow: inset 0 1px 0 #c7dafb, inset 0 -1px 0 #c7dafb; }
.billing-table tbody tr { cursor: pointer; transition: background-color .12s ease; }
.billing-table tbody tr.is-selected td { background: #edf4ff !important; box-shadow: inset 0 1px 0 #c7dafb, inset 0 -1px 0 #c7dafb; }
.billing-table tbody tr:focus-visible { outline: 2px solid rgba(90,141,238,.55); outline-offset: -2px; }
#reduction-list .billing-table th:first-child, #reduction-list .billing-table td:first-child { position: sticky; right: 0; z-index: 2; background: #fff; box-shadow: -1px 0 #edf0f5; }
#reduction-list .billing-table thead th:first-child { z-index: 5; background: #f6f8fb; }
.report-aggregate-table td { color: #53657e; font-size: .64rem; vertical-align: middle; }
.report-aggregate-table td strong { color: var(--py-heading); }
.report-share-cell { display: flex; min-width: 155px; align-items: center; gap: .55rem; }
.report-share-cell__bar { display: block; width: 105px; height: 6px; overflow: hidden; border-radius: 99px; background: #e9eef6; }
.report-share-cell__bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5a8dee, #7367f0); }

@media (max-width: 1399.98px) {
  .comparison-hospital-picker__items { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1199.98px) {
  .deduction-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .comparison-hospital-picker__items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-filter-grid,
  .report-filter-grid.has-grouping { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filter-field--action { grid-column: span 2; }
  .report-filter-grid.is-comparison { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
  .deduction-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .scope-banner { align-items: flex-start; flex-wrap: wrap; }.read-only-badge { margin-right: 0; }.report-panel-head { align-items: flex-start; }.hospital-access-picker { grid-template-columns: 1fr; }.app-modal { padding: .4rem; }.app-modal-dialog { max-height: calc(100vh - .8rem); }.app-modal-footer .btn { flex: 1; }
  .report-panel-head { flex-wrap: wrap; }
  .report-panel-head > div:last-child { width: 100%; flex-wrap: wrap; }
  .report-panel-head > div:last-child .btn { flex: 1; }
  .report-panel-head > div.report-table-actions:last-child { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .2rem; }
  .report-panel-head > .report-table-actions .btn { flex: 0 0 auto; }
  .report-sort-controls { flex: 0 0 auto; }
  .report-page-toolbar { align-items: flex-start !important; flex-wrap: wrap; }
  .report-page-actions { width: 100%; overflow-x: auto; padding-bottom: .2rem; }
  .column-picker-options { grid-template-columns: 1fr; }
  .deduction-detail-dialog { width: 100%; max-height: calc(100vh - .8rem); }
  .deduction-detail-modal-body { max-height: calc(100vh - 130px); padding: .7rem; }
  .deduction-detail-overview { align-items: flex-start; flex-direction: column; }
  .deduction-detail-grid { grid-template-columns: 1fr; }
  .report-line-chart-header { align-items: flex-start; flex-direction: column; }
  .report-line-chart-header-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .report-line-chart-total { flex: 1 1 auto; min-width: 150px; text-align: right; }
  .report-chart-export { flex: 0 0 auto; }
  .report-line-chart { height: 340px; }
  .bar-chart-row { grid-template-columns: minmax(130px, 1.35fr) minmax(95px, .7fr) minmax(105px, .8fr); gap: .5rem; }
  .report-ring-chart__canvas { height: 230px; }
  .comparison-hospital-picker__header, .report-aggregate-table-header { align-items: stretch; flex-direction: column; }
  .report-aggregate-table-header__actions { align-items: stretch; justify-content: space-between; flex-wrap: wrap; }
  .report-aggregate-export-actions { flex: 1 1 auto; }
  .report-aggregate-export-actions .btn { flex: 1 1 0; }
  .comparison-hospital-picker__actions { width: 100%; }
  .comparison-hospital-picker__actions .btn { flex: 1 1 0; }
  .comparison-hospital-picker__items { grid-template-columns: 1fr; }
  .report-filter-grid,
  .report-filter-grid.has-grouping,
  .report-filter-grid.is-comparison { grid-template-columns: 1fr; }
  .report-filter-field--action { grid-column: auto; }
  .report-filter-field--action .form-label { display: none; }
}

@media (max-width: 575.98px) {
  .bar-chart-row { grid-template-columns: minmax(0, 1fr) minmax(105px, .65fr); }
  .bar-label { grid-column: 1 / -1; }
  .bar-value { font-size: .62rem; }
  .report-ring-chart { min-height: 270px; }
  .report-ring-chart__canvas { width: min(100%, 285px); height: 215px; }
  .report-ring-chart__legend-item { max-width: 145px; }
}

/* ── Billing Module Styles ── */
.billing-filter-panel {
  border-top: 3px solid var(--py-primary);
  animation: fadeInDown 0.3s ease-out;
}
.billing-filter-tabs .nav-link {
  color: var(--py-text);
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}
.billing-filter-tabs .nav-link.active {
  color: var(--py-primary);
  border-bottom: 2px solid var(--py-primary);
  background-color: transparent;
}
.billing-filter-chip {
  display: inline-flex;
  align-items: center;
  background-color: var(--py-primary);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 50rem;
  font-size: 0.85rem;
}
.billing-filter-chip .btn-close {
  font-size: 0.65rem;
  margin-right: 0.5rem;
  margin-left: -0.25rem;
  filter: invert(1) grayscale(100%) brightness(200%) !important;
  opacity: 0.95 !important;
}
.billing-filter-chip .btn-close:hover {
  opacity: 1 !important;
}
.billing-tabs .nav-link {
  color: var(--py-text);
  border-radius: 0.25rem;
}
.billing-tabs .nav-link.active {
  background-color: var(--py-primary);
  color: #fff;
}

/* Billing workspace */
.billing-page { display: grid; width: 100%; min-width: 0; max-width: 100%; gap: 1rem; }
.billing-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.billing-page-header h1 { margin: .25rem 0 0; color: var(--py-heading); font-size: 1.35rem; font-weight: 950; }
.billing-page-header p { margin: .3rem 0 0; color: #8795aa; font-size: .72rem; }
.billing-view-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; padding: .4rem; border: 1px solid #e3eaf4; border-radius: 1rem; background: #fff; box-shadow: 0 8px 28px rgba(37,57,111,.05); }
.billing-view-tabs a { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: .45rem; border-radius: .72rem; color: #697a93; font-size: .7rem; font-weight: 850; transition: .18s ease; }
.billing-view-tabs a:hover { color: #376fda; background: #f1f5ff; }
.billing-view-tabs a.active { color: #fff; background: linear-gradient(135deg,#5a8dee,#7367f0); box-shadow: 0 8px 18px rgba(90,141,238,.2); }
.billing-view-tabs i { font-size: 1.05rem; }
.billing-main-filter { padding: 1rem; border: 1px solid #e3eaf4; border-radius: 1.15rem; box-shadow: 0 8px 28px rgba(37,57,111,.05); }
.billing-main-filter__grid { display: grid; grid-template-columns: repeat(4,minmax(210px,1fr)); align-items: end; gap: .7rem; }
.billing-filter-field { min-width: 0; }
.billing-filter-field > label { display: block; margin-bottom: .35rem; color: #3f5070; font-size: .63rem; font-weight: 850; }
.billing-filter-field .form-control, .billing-filter-field .form-select, .billing-main-filter .form-control, .billing-main-filter .form-select, .billing-filter-field .select2-container .select2-selection--single { min-height: 46px; border-color: #dbe4f1; border-radius: .75rem; }
.billing-main-filter .select2-container,
.billing-filter-field .select2-container { width: 100% !important; min-width: 0; }
.billing-main-filter .select2-selection__rendered,
.billing-filter-field .select2-selection__rendered { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-filter-field .input-group > :first-child { border-radius: 0 .75rem .75rem 0; }
.billing-filter-field .input-group > :last-child { border-radius: .75rem 0 0 .75rem; }
.billing-readonly-field { display: flex; align-items: center; gap: .45rem; color: #53657f; background: #f3f6fa; }
.billing-filter-actions { display: flex; grid-column: span 2; gap: .55rem; }
.billing-filter-actions .btn { min-height: 46px; flex: 1; border-radius: .75rem; font-size: .68rem; font-weight: 850; white-space: nowrap; }
.billing-filter-actions .filter-more-button { flex: 0 0 52px; min-width: 52px; padding-inline: .65rem; font-size: 1rem; }
.filter-more-button .filter-active-count { display: inline-grid; min-width: 15px; height: 15px; place-items: center; margin-inline-start: .12rem; padding: 0 .18rem; border-radius: .25rem; font-size: .45rem; line-height: 1; }
.billing-apply-button { min-width: 185px; }
.billing-alert { display: flex; align-items: center; gap: .45rem; margin: 0; border: 0; border-radius: .85rem; font-size: .7rem; }
.billing-filter-panel { overflow: hidden; margin: 0; border: 1px solid #dfe7f2; border-radius: 1.15rem; box-shadow: 0 14px 35px rgba(37,57,111,.08); }
.billing-filter-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border-bottom: 1px solid #e7edf5; background: linear-gradient(135deg,#fbfcff,#f5f8ff); }
.billing-filter-panel__header > div { display: flex; align-items: center; gap: .65rem; }
.billing-filter-panel__icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: .75rem; color: #4d7ee3; background: #e8f0ff; font-size: 1.15rem; }
.billing-filter-panel__header h2, .billing-analysis-card h2, .billing-aggregate-table h2, .billing-table-card h2 { margin: 0; color: var(--py-heading); font-size: .82rem; font-weight: 950; }
.billing-filter-panel__header p, .billing-analysis-card header p, .billing-aggregate-table header p, .billing-table-card header p { margin: .2rem 0 0; color: #8a98ac; font-size: .6rem; }
.billing-filter-tabs { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .3rem; padding: .55rem .7rem 0; overflow-x: auto; background: #fff; }
.billing-filter-tab { display: flex; min-height: 42px; align-items: center; justify-content: center; gap: .35rem; border: 0; border-radius: .65rem .65rem 0 0; color: #718099; background: transparent; font-size: .63rem; font-weight: 850; white-space: nowrap; }
.billing-filter-tab:hover { color: #4e7edc; background: #f4f7fd; }
.billing-filter-tab.active { color: #4e7edc; background: #edf3ff; box-shadow: inset 0 -2px #5a8dee; }
.billing-tab-count { display: grid; min-width: 20px; height: 20px; place-items: center; padding: 0 .25rem; border-radius: 99px; color: #fff; background: #5a8dee; font-size: .55rem; }
.billing-filter-panel__body { min-height: 180px; max-height: 390px; padding: 1rem; overflow-y: auto; border-top: 1px solid #edf1f6; background: #fff; }
.billing-advanced-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); align-items: end; gap: .8rem; }
.billing-choice-group { display: flex; flex-wrap: wrap; grid-column: 1 / -1; min-height: 46px; align-items: center; gap: 1rem; padding: .65rem .8rem; border: 1px solid #e2e9f2; border-radius: .75rem; background: #f9fbfd; }
.billing-choice-group .form-check-label { white-space: nowrap; margin-right: 0.5rem; }
.billing-choice-group .form-check { display: flex; align-items: center; margin-bottom: 0; margin-right: 1rem; }
.billing-inline-check { min-height: 46px; align-items: center; padding: .7rem 2.1rem .7rem .7rem; border: 1px solid #e2e9f2; border-radius: .75rem; background: #f9fbfd; }
.billing-filter-panel__footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border-top: 1px solid #e7edf5; background: #fafbfd; }
.billing-filter-panel__footer > div { display: flex; gap: .5rem; }
.billing-filter-panel__footer .btn { min-height: 42px; border-radius: .7rem; font-size: .65rem; font-weight: 850; }
.billing-loading-state, .billing-empty-state { display: flex; min-height: 300px; align-items: center; justify-content: center; flex-direction: column; gap: .55rem; padding: 2rem; border: 1px solid #e4ebf4; border-radius: 1.15rem; color: #76869d; background: #fff; text-align: center; }
.billing-loading-state__icon, .billing-empty-state > span { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 1.2rem; color: #5a8dee; background: #edf3ff; font-size: 1.8rem; }
.billing-empty-state h2, .billing-empty-state h3 { margin: .25rem 0 0; color: var(--py-heading); font-size: .85rem; font-weight: 950; }
.billing-empty-state p { margin: 0; font-size: .65rem; }
.billing-loading-state--inside, .billing-empty-state--inside { min-height: 260px; border: 0; border-radius: 0; box-shadow: none; }
.billing-stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .75rem; }
.billing-stat-card { display: flex; min-width: 0; align-items: center; gap: .75rem; padding: .9rem; border: 1px solid #e4ebf4; border-radius: 1rem; background: #fff; box-shadow: 0 8px 24px rgba(37,57,111,.05); }
.billing-stat-card__icon { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border-radius: .8rem; font-size: 1.15rem; }
.billing-stat-card div { min-width: 0; }
.billing-stat-card small, .billing-stat-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-stat-card small { margin-bottom: .2rem; color: #8a98ab; font-size: .57rem; }
.billing-stat-card strong { color: var(--py-heading); font-size: .78rem; font-weight: 950; }
.billing-stat-card--blue .billing-stat-card__icon { color: #4e7fe6; background: #eaf1ff; }
.billing-stat-card--indigo .billing-stat-card__icon { color: #7367f0; background: #efedff; }
.billing-stat-card--cyan .billing-stat-card__icon { color: #00a7bd; background: #e4f9fc; }
.billing-stat-card--orange .billing-stat-card__icon { color: #f08a35; background: #fff1e5; }
.billing-stat-card--green .billing-stat-card__icon { color: #24a46d; background: #e8f8f0; }
.billing-stat-card--purple .billing-stat-card__icon { color: #9b65d6; background: #f4ebff; }
.billing-stat-card--teal .billing-stat-card__icon { color: #198f88; background: #e6f7f5; }
.billing-stat-card--red .billing-stat-card__icon { color: #e05260; background: #fdecee; }
.billing-analysis-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(320px,.75fr); gap: .9rem; margin-top: .9rem; }
.billing-content { width: 100%; min-width: 0; max-width: 100%; }
.billing-analysis-card, .billing-aggregate-table, .billing-table-card { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; border: 1px solid #e3eaf4; border-radius: 1.15rem; box-shadow: 0 8px 28px rgba(37,57,111,.05); }
.billing-analysis-card > header, .billing-aggregate-table > header, .billing-table-card > header { display: flex; min-width: 0; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: .9rem 1rem; border-bottom: 1px solid #e7edf5; background: #fff; }
.billing-table-card > header > div { min-width: 0; }
.billing-analysis-card h2 i, .billing-aggregate-table h2 i, .billing-table-card h2 i { margin-left: .35rem; color: #5a8dee; font-size: 1rem; }
.billing-total-badge { padding: .4rem .55rem; border-radius: .6rem; color: #4775d2; background: #edf3ff; font-size: .58rem; font-weight: 900; white-space: nowrap; }
.billing-bars { display: grid; gap: .7rem; padding: 1rem; }
.billing-bar-row { display: grid; grid-template-columns: minmax(145px,1.2fr) minmax(120px,1fr) minmax(120px,.75fr); align-items: center; gap: .65rem; font-size: .6rem; }
.billing-bar-label { overflow: hidden; color: #3f5070; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.billing-bar-track { height: 20px; overflow: hidden; border-radius: 99px; background: #edf1f7; }
.billing-bar-fill { display: flex; height: 100%; min-width: 28px; align-items: center; justify-content: center; border-radius: 99px; color: #fff; background: linear-gradient(90deg,#5a8dee,#7367f0); font-size: .52rem; font-weight: 900; }
.billing-bar-value { color: #5d6d85; text-align: left; white-space: nowrap; }
.billing-donut-wrap { display: grid; place-items: center; gap: 1rem; padding: 1.2rem; }
.billing-donut { display: grid; width: 190px; height: 190px; place-items: center; border-radius: 50%; background: conic-gradient(#5a8dee 0 var(--insurer),#ff9f43 var(--insurer) calc(var(--insurer) + var(--patient)),#28c76f calc(var(--insurer) + var(--patient)) 360deg); }
.billing-donut > div { display: grid; width: 116px; height: 116px; place-items: center; align-content: center; border-radius: 50%; background: #fff; text-align: center; }
.billing-donut small { color: #8795a8; font-size: .55rem; }
.billing-donut strong { max-width: 95px; margin-top: .2rem; color: var(--py-heading); font-size: .7rem; }
.billing-donut-legend { display: grid; width: 100%; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.billing-donut-legend li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: .45rem; color: #66768d; font-size: .6rem; }
.billing-donut-legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend-insurer { background: #5a8dee; } .legend-patient { background: #ff9f43; } .legend-subsidy { background: #28c76f; }
.billing-aggregate-table { margin-top: .9rem; background: #fff; }
.billing-aggregate-table th, .billing-table th { color: #475873; background: #f6f8fb; font-size: .58rem; font-weight: 900; white-space: nowrap; }
.billing-aggregate-table td, .billing-table td { color: #586a83; font-size: .6rem; vertical-align: middle; white-space: nowrap; }
.billing-table-summary { display: flex; flex-wrap: wrap; gap: .5rem; }
.billing-table-summary span { padding: .35rem .5rem; border-radius: .55rem; color: #65758d; background: #f2f5f9; font-size: .57rem; }
.billing-table-toolbar { display: flex; max-width: 100%; flex: 1 1 520px; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .45rem; }
.billing-table-toolbar .btn { display: inline-flex; min-height: 36px; align-items: center; gap: .3rem; border-radius: .65rem; font-size: .6rem; font-weight: 850; white-space: nowrap; }
.billing-list-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; padding: .7rem 1rem; border-bottom: 1px solid #e7edf5; background: #fbfcfe; }
.billing-list-controls label { display: grid; gap: .25rem; margin: 0; color: #66768d; font-size: .55rem; font-weight: 800; }
.billing-list-controls .form-select { min-width: 135px; height: 36px; border-radius: .6rem; font-size: .6rem; }
.billing-list-controls .btn-group .btn { min-height: 36px; font-size: .58rem; font-weight: 850; }
.billing-table-card > .table-responsive { display: block; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.billing-table { width: max-content; min-width: 100%; }
.billing-invoice-table th:first-child,
.billing-invoice-table td:first-child { position: sticky; right: 0; z-index: 2; background: #fff; box-shadow: -1px 0 #edf0f5; }
.billing-invoice-table thead th:first-child { z-index: 4; background: #f6f8fb; }
.billing-invoice-table th:last-child,
.billing-invoice-table td:last-child { position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: 1px 0 #edf0f5; }
.billing-invoice-table thead th:last-child { z-index: 4; background: #f6f8fb; }
.billing-invoice-table tbody tr:hover td:first-child,
.billing-invoice-table tbody tr:hover td:last-child { background: #f8faff; }
.delivered-services-table { width: 1320px; min-width: 100%; table-layout: fixed; }
.delivered-services-table th:nth-child(1) { width: 82px; }
.delivered-services-table th:nth-child(2) { width: 260px; }
.delivered-services-table th:nth-child(3) { width: 130px; }
.delivered-services-table th:nth-child(4) { width: 115px; }
.delivered-services-table th:nth-child(5) { width: 150px; }
.delivered-services-table th:nth-child(6) { width: 190px; }
.delivered-services-table th:nth-child(7) { width: 64px; }
.delivered-services-table th:nth-child(8),
.delivered-services-table th:nth-child(9),
.delivered-services-table th:nth-child(10),
.delivered-services-table th:nth-child(11) { width: 110px; }
.delivered-services-table td.delivered-service-name {
  max-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.8;
}
.billing-pagination { display: flex; align-items: center; gap: .5rem; }
.billing-pagination .btn { display: inline-flex; min-height: 34px; align-items: center; gap: .2rem; border-radius: .6rem; font-size: .57rem; font-weight: 850; }
.billing-table-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-top: 1px solid #e7edf5; color: #8694a7; background: #fbfcfe; font-size: .57rem; }
.billing-attention-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .8rem; margin-bottom: .9rem; }
.billing-attention-card { display: flex; gap: .75rem; padding: 1rem; border: 1px solid #e3eaf4; border-radius: 1rem; background: #fff; }
.billing-attention-card__icon { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: .85rem; font-size: 1.2rem; }
.billing-attention-card small, .billing-attention-card strong, .billing-attention-card span { display: block; }
.billing-attention-card small { color: #7d8ca1; font-size: .58rem; }
.billing-attention-card strong { margin-top: .2rem; color: var(--py-heading); font-size: .82rem; }
.billing-attention-card span { margin-top: .15rem; color: #67778f; font-size: .62rem; }
.billing-attention-card p { margin: .4rem 0 0; color: #98a4b4; font-size: .55rem; }
.billing-attention-card--danger .billing-attention-card__icon { color: #e05260; background: #fdecee; }
.billing-attention-card--info .billing-attention-card__icon { color: #168ca8; background: #e6f6fa; }
.billing-attention-card--warning .billing-attention-card__icon { color: #e58b2a; background: #fff1df; }
@media (max-width:1399.98px) { .billing-main-filter__grid { grid-template-columns: repeat(4,minmax(180px,1fr)); } .billing-filter-actions { grid-column: span 2; } }
@media (max-width:991.98px) { .billing-view-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); } .billing-main-filter__grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .billing-filter-actions { grid-column: span 2; } .billing-advanced-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .billing-filter-tabs { grid-template-columns: repeat(5,minmax(145px,1fr)); } .billing-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .billing-analysis-grid { grid-template-columns: 1fr; } }
@media (max-width:575.98px) { .billing-page-header { flex-direction: column; } .billing-view-tabs,.billing-main-filter__grid,.billing-advanced-grid,.billing-stat-grid,.billing-attention-grid { grid-template-columns: 1fr; } .billing-filter-actions,.billing-choice-group { grid-column: span 1; } .billing-filter-actions { flex-direction: column; } .billing-filter-panel__footer { align-items: stretch; flex-direction: column; } .billing-filter-panel__footer > div { display: grid; grid-template-columns: 1fr 1fr; } .billing-bar-row { grid-template-columns: minmax(110px,1fr) minmax(90px,1fr); } .billing-bar-value { display: none; } .billing-table-footer { align-items: flex-start; flex-direction: column; } }

/* ── Print Media Styles ── */
@media print {
  @page { size: A4 landscape; margin: 9mm; }
  .admin-sidebar,
  .layout-navbar,
  .deduction-tabs,
  .filter-card,
  .pagination,
  .read-only-badge,
  button,
  .btn { display: none !important; }
  
  .layout-page { padding-right: 0 !important; margin: 0 !important; }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  .card { border: 1px solid #ccc !important; box-shadow: none !important; margin-bottom: 1rem !important; }
  .table { width: 100% !important; border-collapse: collapse !important; }
  .table th, .table td { border: 1px solid #ddd !important; padding: 6px 8px !important; font-size: 9pt !important; }
  .table th { background-color: #f5f5f5 !important; color: #000 !important; }
  a { text-decoration: none !important; color: #000 !important; }

  body.kavosh-print-section main > .container-xxl > *:not(.kavosh-print-target),
  body.kavosh-print-section .content-footer { display: none !important; }
  body.kavosh-print-section main > .container-xxl { width: 100% !important; max-width: none !important; padding: 0 !important; }
  body.kavosh-print-section .kavosh-print-target { display: block !important; width: 100% !important; overflow: visible !important; border: 0 !important; }
  body.kavosh-print-section .kavosh-print-target .report-table-actions,
  body.kavosh-print-section .kavosh-print-target .report-aggregate-export-actions,
  body.kavosh-print-section .kavosh-print-target .pagination { display: none !important; }
  body.kavosh-print-section .kavosh-print-target .report-panel-head { padding: 0 0 8px !important; }
  body.kavosh-print-section .kavosh-print-target .table-responsive { overflow: visible !important; }
  body.kavosh-print-section .kavosh-print-target .deduction-data-table { width: 100% !important; min-width: 0 !important; table-layout: auto !important; }
  body.kavosh-print-section .kavosh-print-target .deduction-data-table th,
  body.kavosh-print-section .kavosh-print-target .deduction-data-table td { position: static !important; max-width: none !important; overflow: visible !important; padding: 4px 5px !important; box-shadow: none !important; font-size: 7pt !important; white-space: normal !important; }
  body.kavosh-print-section .kavosh-print-target .deduction-data-table thead { display: table-header-group; }
  body.kavosh-print-section .kavosh-print-target .deduction-data-table tr { break-inside: avoid; }
  body.kavosh-print-section #report-aggregate-table-area .report-aggregate-table { width: 100% !important; min-width: 0 !important; table-layout: auto !important; }
  body.kavosh-print-section #report-aggregate-table-area .report-aggregate-table thead { display: table-header-group; }
  body.kavosh-print-section #report-aggregate-table-area .report-aggregate-table tr { break-inside: avoid; }
}

/* ── Modern Sidebar Navigation Color Palette & UI ── */
.custom-nav-menu .menu-item {
    margin: 3px 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-nav-menu .menu-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
    font-size: 1.15rem !important;
    margin-left: 0.65rem !important;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease !important;
}

/* Icon Distinct Colors */
.custom-nav-menu .menu-icon.icon-dashboard { color: #5a8dee !important; background: rgba(90, 141, 238, 0.12) !important; }
.custom-nav-menu .menu-icon.icon-deductions { color: #ff5b5c !important; background: rgba(255, 91, 92, 0.12) !important; }
.custom-nav-menu .menu-icon.icon-drugs { color: #7367f0 !important; background: rgba(115, 103, 240, 0.12) !important; }
.custom-nav-menu .menu-icon.icon-billing { color: #39da8a !important; background: rgba(57, 218, 138, 0.12) !important; }
.custom-nav-menu .menu-icon.icon-ds { color: #696cff !important; background: rgba(105, 108, 255, 0.12) !important; }
.custom-nav-menu .menu-icon.icon-reductions { color: #fdac41 !important; background: rgba(253, 172, 65, 0.14) !important; }
.custom-nav-menu .menu-icon.icon-payments { color: #00cfdd !important; background: rgba(0, 207, 221, 0.12) !important; }
.custom-nav-menu .menu-icon.icon-admin { color: #475f7b !important; background: rgba(71, 95, 123, 0.12) !important; }

/* Menu Link Hover Effects (Non-Active) */
.custom-nav-menu .menu-item:not(.active) > .menu-link:hover {
    background: rgba(90, 141, 238, 0.08) !important;
    border-radius: 10px !important;
    transform: translateX(-3px);
}

.custom-nav-menu .menu-item:not(.active) > .menu-link:hover div {
    color: #1e293b !important;
    font-weight: 700 !important;
}

.custom-nav-menu .menu-item:not(.active) > .menu-link:hover .menu-icon {
    transform: scale(1.12);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* Active Menu Item Styling & UX Color Psychology Lock */
.custom-nav-menu .menu-item.active > .menu-link,
.custom-nav-menu .menu-item.active > .menu-link:focus {
    background: linear-gradient(270deg, rgba(90, 141, 238, 0.16) 0%, rgba(90, 141, 238, 0.04) 100%) !important;
    border-radius: 10px !important;
    border-right: 4px solid #5a8dee !important;
    color: #1e293b !important;
    font-weight: 800 !important;
    transform: none !important;
}

.custom-nav-menu .menu-item.active > .menu-link:hover {
    background: linear-gradient(270deg, rgba(90, 141, 238, 0.24) 0%, rgba(90, 141, 238, 0.08) 100%) !important;
    border-radius: 10px !important;
    border-right: 4px solid #487ee8 !important;
    color: #0f172a !important;
    font-weight: 800 !important;
    transform: none !important;
}

.custom-nav-menu .menu-item.active > .menu-link div,
.custom-nav-menu .menu-item.active > .menu-link:hover div,
.custom-nav-menu .menu-item.active > .menu-link:focus div {
    color: #1e293b !important;
    font-weight: 800 !important;
}

.custom-nav-menu .menu-item.active > .menu-link .menu-icon,
.custom-nav-menu .menu-item.active > .menu-link:hover .menu-icon,
.custom-nav-menu .menu-item.active > .menu-link:focus .menu-icon {
    transform: scale(1.08) !important;
}

.custom-nav-menu .menu-item.active > .menu-link .menu-icon,
.custom-nav-menu .menu-item.active > .menu-link:hover .menu-icon,
.custom-nav-menu .menu-item.active > .menu-link .menu-icon::before,
.custom-nav-menu .menu-item.active > .menu-link:hover .menu-icon::before,
.custom-nav-menu .menu-item.active > .menu-link i,
.custom-nav-menu .menu-item.active > .menu-link i::before,
.custom-nav-menu .menu-item.active > .menu-link .icon-dashboard,
.custom-nav-menu .menu-item.active > .menu-link:hover .icon-dashboard,
.custom-nav-menu .menu-item.active > .menu-link .icon-dashboard::before,
.custom-nav-menu .menu-item.active > .menu-link .icon-deductions,
.custom-nav-menu .menu-item.active > .menu-link .icon-drugs,
.custom-nav-menu .menu-item.active > .menu-link .icon-billing,
.custom-nav-menu .menu-item.active > .menu-link .icon-ds,
.custom-nav-menu .menu-item.active > .menu-link .icon-reductions,
.custom-nav-menu .menu-item.active > .menu-link .icon-payments,
.custom-nav-menu .menu-item.active > .menu-link .icon-admin {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}



/* Submenu styling refinement */
.custom-nav-menu .menu-sub .menu-link {
    padding-right: 2.8rem !important;
    transition: all 0.18s ease;
    border-radius: 8px;
}

.custom-nav-menu .menu-sub .menu-item.active > .menu-link {
    color: #696cff !important;
    background: rgba(105, 108, 255, 0.08) !important;
    font-weight: 700 !important;
}

/* Header Text accent dot */
.custom-nav-menu .menu-header {
    position: relative;
    padding-right: 1.25rem !important;
}
.custom-nav-menu .menu-header::before {
    content: '';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #696cff;
}

/* ── Sidebar Layout & Internal Scrollbar Fix ── */
.admin-sidebar {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    z-index: 1080 !important;
}

.admin-sidebar .app-brand {
    flex: 0 0 auto !important;
}

.admin-sidebar .menu-divider,
.admin-sidebar .menu-inner-shadow {
    flex: 0 0 auto !important;
}

/* Scrollable Menu Items Container */
.admin-sidebar .menu-inner.custom-nav-menu {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 2rem !important;
    scroll-behavior: smooth;
}

/* Custom Slim Scrollbar */
.admin-sidebar .menu-inner.custom-nav-menu::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar .menu-inner.custom-nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar .menu-inner.custom-nav-menu::-webkit-scrollbar-thumb {
    background: rgba(160, 175, 200, 0.35);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.admin-sidebar .menu-inner.custom-nav-menu::-webkit-scrollbar-thumb:hover {
    background: #696cff;
}

/* Firefox Scrollbar */
.admin-sidebar .menu-inner.custom-nav-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(160, 175, 200, 0.35) transparent;
}

/* ── Premium Invoice Detail Modal Styling (Light Theme) ── */
.billing-custom-modal .modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.billing-custom-modal .modal-header h2,
.billing-custom-modal .modal-header .modal-title {
    color: #0f172a !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
}

.billing-custom-modal .modal-header-avatar.light {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    display: grid;
    place-items: center;
    border: 1px solid #bfdbfe;
}

.billing-custom-modal .btn-close {
    background-color: transparent !important;
    opacity: 0.65 !important;
    transition: opacity 0.15s ease, background-color 0.15s ease !important;
    border-radius: 8px !important;
    padding: 0.5rem !important;
    filter: none !important;
}

.billing-custom-modal .modal-header .badge {
    color: #0284c7 !important;
    background-color: #e0f2fe !important;
    border-color: #bae6fd !important;
}

.billing-custom-modal .modal-header .text-dark {
    color: #1e293b !important;
}

.billing-custom-modal .btn-close:hover {
    opacity: 1 !important;
    background-color: #f1f5f9 !important;
}

/* Modal Dedicated Print Styling */
@media print {
    /* Hide all app wrappers and navigation elements */
    .layout-menu,
    .layout-navbar,
    .billing-page-header,
    .billing-view-tabs,
    .billing-main-filter,
    .billing-page,
    .modal-backdrop,
    .app-brand,
    .content-footer,
    .user-menu,
    .layout-footer {
        display: none !important;
    }

    /* Force all parent containers to not clip content and be fully visible */
    body, html, 
    .layout-wrapper, 
    .layout-container, 
    .layout-page, 
    .content-wrapper, 
    .container-xxl {
        overflow: visible !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

  
    .billing-custom-modal {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
        background: #ffffff !important;
    }

    .billing-custom-modal .modal-dialog {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: none !important;
        box-shadow: none !important;
    }

    .billing-custom-modal .modal-content {
        border: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: #ffffff !important;
    }

    .billing-custom-modal .modal-footer,
    .billing-custom-modal .btn-close {
        display: none !important;
    }

    .billing-custom-modal .modal-body {
        overflow: visible !important;
        max-height: none !important;
        padding: 10px !important;
        background: #ffffff !important;
    }

    .billing-custom-modal .kpi-detail-card,
    .billing-custom-modal .detail-section-card {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        break-inside: avoid;
    }
}


.billing-custom-modal .modal-header-subtitle {
    color: #64748b !important;
    font-size: 0.85rem;
}


/* Financial KPI Highlight Cards in Modal */
.kpi-detail-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-detail-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
}

.kpi-detail-card .kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.kpi-detail-card.kpi-total .kpi-icon { color: #5a8dee; background: #eaf1ff; }
.kpi-detail-card.kpi-insurer .kpi-icon { color: #00cfdd; background: #e0fbfd; }
.kpi-detail-card.kpi-insured .kpi-icon { color: #fdac41; background: #fff5e6; }
.kpi-detail-card.kpi-rest-danger .kpi-icon { color: #ff5b5c; background: #ffebeb; }
.kpi-detail-card.kpi-rest-success .kpi-icon { color: #39da8a; background: #e5f9ee; }

.kpi-detail-card .kpi-content small {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.kpi-detail-card .kpi-content strong {
    display: block;
    font-size: 1.05rem;
    color: #0f172a;
}

.kpi-detail-card .kpi-content .currency {
    font-size: 0.72rem;
    font-weight: 400;
    color: #94a3b8;
}

/* Detail Section Cards */
.detail-section-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    height: 100%;
}

.detail-section-card .section-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.1rem;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.detail-section-card .section-card-header h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.detail-section-card .header-icon {
    font-size: 1.3rem;
}

.detail-section-card .section-card-body {
    padding: 1.1rem;
}

/* Information Grid Items */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.info-grid .info-item.full-width {
    grid-column: span 2;
}

.info-grid .info-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.info-grid .info-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #64748b;
    font-size: 0.78rem;
}

.info-grid .info-label i {
    font-size: 0.95rem;
    color: #94a3b8;
}

.info-grid .info-value {
    color: #334155;
    font-size: 0.88rem;
}

.info-grid .text-mono {
    font-family: monospace, Tahoma, sans-serif;
    letter-spacing: 0.5px;
}

.status-badge {
    padding: 0.3rem 0.65rem;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* Detail Table */
.detail-table td {
    padding: 0.75rem 1.1rem;
    font-size: 0.84rem;
    color: #475569;
    border-color: #f1f5f9;
}

.detail-table .table-summary-row {
    background: #f8fafc;
    font-weight: 700;
}

/* Clinical Box */
.clinical-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.clinical-box small {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #64748b;
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
}

.clinical-box strong {
    display: block;
    color: #1e293b;
    font-size: 0.88rem;
}

/* ═════════════════════════════════════════════════════════════════
   Smart Active Filter Bar
   ═════════════════════════════════════════════════════════════════ */
.active-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  padding: .5rem .85rem;
  border: 1px solid #e5edfb;
  border-radius: 12px;
  background: linear-gradient(180deg, #f9fbfe 0%, #f4f8fe 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 6px rgba(90, 141, 238, 0.04);
}

.active-filter-bar__header {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--py-primary);
  font-size: .72rem;
  font-weight: 800;
  user-select: none;
  padding-left: .4rem;
  border-left: 1px solid #e1e9f7;
}

.active-filter-bar__icon {
  font-size: .95rem;
}

.active-filter-bar__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--py-primary);
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
}

.active-filter-bar__chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  flex: 1;
  min-width: 0;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .28rem .55rem .28rem .4rem;
  border: 1px solid #d8e4f8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(35, 61, 116, 0.05);
  font-size: .67rem;
  color: #4b5e77;
  transition: all .18s ease;
}

.active-filter-chip:hover {
  border-color: #b9d1f8;
  box-shadow: 0 2px 8px rgba(90, 141, 238, 0.12);
}

.active-filter-chip__icon {
  color: var(--py-primary);
  font-size: .88rem;
  flex-shrink: 0;
}

.active-filter-chip__label {
  color: #7b8ea7;
  font-weight: 500;
}

.active-filter-chip__value {
  color: #27374d;
  font-weight: 700;
}

.active-filter-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-right: .1rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #8c9cb2;
  background: #f0f4fa;
  cursor: pointer;
  transition: all .15s ease;
}

.active-filter-chip__remove:hover {
  background: #ffeded;
  color: #ea5455;
  transform: scale(1.12);
}

.active-filter-bar__clear {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .6rem;
  border: 1px dashed #f0b4b4;
  border-radius: 8px;
  background: #fff8f8;
  color: #dc3545;
  font-size: .65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s ease;
  margin-right: auto;
}

.active-filter-bar__clear:hover {
  background: #dc3545;
  color: #ffffff;
  border-color: #dc3545;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
}

/* Revenue analysis formulas use a light Bootstrap tooltip so long numbers stay readable. */
.revenue-calculation-tooltip {
  --bs-tooltip-bg: #fff;
  --bs-tooltip-color: #42536a;
  --bs-tooltip-max-width: 430px;
  --bs-tooltip-opacity: 1;
}

.revenue-calculation-tooltip .tooltip-inner {
  min-width: 330px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d9e3f1;
  border-radius: .85rem;
  background: #fff;
  color: #42536a;
  box-shadow: 0 14px 34px rgba(43, 64, 98, .18);
  direction: rtl;
  font-family: inherit;
  font-size: .8rem;
  line-height: 1.65;
  text-align: right;
}

.revenue-tooltip-card { padding: .75rem .8rem .8rem; }
.revenue-tooltip-title { margin: -.75rem -.8rem .65rem; padding: .58rem .8rem; color: #315f9f; background: #eef4ff; font-size: .8rem; font-weight: 950; }
.revenue-tooltip-row { display: grid; grid-template-columns: minmax(88px, auto) 14px minmax(0, 1fr); align-items: baseline; gap: .3rem; padding: .24rem .1rem; }
.revenue-tooltip-row b { color: #2f5f9f; font-size: .82rem; font-weight: 950; text-align: left; unicode-bidi: plaintext; white-space: nowrap; }
.revenue-tooltip-row > span { color: #a2adbb; text-align: center; }
.revenue-tooltip-row small { color: #5f7188; font-size: .75rem; font-weight: 800; line-height: 1.75; }
.revenue-tooltip-divider { height: 1px; margin: .58rem 0 .48rem; background: linear-gradient(90deg, transparent, #cad7e8 12%, #cad7e8 88%, transparent); }
.revenue-tooltip-formula-label { margin-bottom: .28rem; color: #8997a8; font-size: .68rem; font-weight: 900; }
.revenue-tooltip-equation { padding: .48rem .55rem; border: 1px solid #cfe0f6; border-radius: .55rem; color: #234f8b; background: #f4f8ff; font-size: .84rem; font-weight: 950; text-align: center; unicode-bidi: plaintext; }
.revenue-tooltip-note { padding: .3rem .1rem 0; color: #687b92; font-size: .73rem; font-weight: 750; line-height: 1.8; }

@media (max-width: 575.98px) {
  .revenue-calculation-tooltip { --bs-tooltip-max-width: calc(100vw - 24px); }
  .revenue-calculation-tooltip .tooltip-inner { min-width: min(310px, calc(100vw - 24px)); }
}

.revenue-help-tooltip {
  --bs-tooltip-bg: #fff9e8;
  --bs-tooltip-color: #62471f;
  --bs-tooltip-max-width: 430px;
  --bs-tooltip-opacity: 1;
}

.revenue-help-tooltip .tooltip-inner {
  padding: .7rem .9rem;
  border: 1px solid #edcf91;
  border-radius: .65rem;
  background: #fff9e8;
  color: #62471f;
  box-shadow: 0 8px 24px rgba(118, 81, 26, .15);
  direction: rtl;
  unicode-bidi: plaintext;
  font-size: .84rem;
  font-weight: 750;
  line-height: 1.9;
  text-align: right;
  white-space: pre-line;
}

.bed-utilization-tooltip {
  --bs-tooltip-bg: #fff;
  --bs-tooltip-color: #42536a;
  --bs-tooltip-max-width: 620px;
  --bs-tooltip-opacity: 1;
  pointer-events: auto;
}

.bed-utilization-tooltip .tooltip-inner {
  min-width: 300px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d9e3f1;
  border-radius: .85rem;
  background: #fff;
  color: #42536a;
  box-shadow: 0 14px 34px rgba(43, 64, 98, .18);
  direction: rtl;
  font-family: inherit;
  font-size: .8rem;
  line-height: 1.65;
  text-align: right;
}

.bed-tooltip-card { max-height: calc(100vh - 32px); padding: .75rem .8rem .8rem; overflow-y: auto; }
.bed-tooltip-title { margin: -.75rem -.8rem .65rem; padding: .58rem .8rem; color: #315f9f; background: #eef4ff; font-size: .78rem; font-weight: 950; }
.bed-tooltip-row { display: grid; grid-template-columns: minmax(60px, auto) 14px minmax(0, 1fr); align-items: baseline; gap: .28rem; padding: .22rem .1rem; }
.bed-tooltip-row b { color: #2f5f9f; font-size: .82rem; font-weight: 950; text-align: left; unicode-bidi: plaintext; }
.bed-tooltip-row > span { color: #a2adbb; text-align: center; }
.bed-tooltip-row small { color: #5f7188; font-size: .75rem; font-weight: 800; }
.bed-tooltip-divider { height: 1px; margin: .58rem 0 .48rem; background: linear-gradient(90deg, transparent, #cad7e8 12%, #cad7e8 88%, transparent); }
.bed-tooltip-formula-label { margin-bottom: .28rem; color: #8997a8; font-size: .68rem; font-weight: 900; }
.bed-tooltip-equation { padding: .48rem .55rem; border: 1px solid #cfe0f6; border-radius: .55rem; color: #234f8b; background: #f4f8ff; font-size: .84rem; font-weight: 950; line-height: 1.9; text-align: right; unicode-bidi: plaintext; white-space: pre-line; }
.bed-tooltip-note { padding: .28rem .1rem; color: #687b92; font-size: .75rem; font-weight: 750; line-height: 1.8; white-space: pre-line; }

@media (max-width: 575.98px) {
  .bed-utilization-tooltip { --bs-tooltip-max-width: calc(100vw - 24px); }
  .bed-utilization-tooltip .tooltip-inner { min-width: min(300px, calc(100vw - 24px)); }
  .bed-tooltip-row { grid-template-columns: minmax(54px, auto) 12px minmax(0, 1fr); }
}
body:has(.revenue-service-detail-modal) {
    overflow: hidden;
}

/* Deductions table: local analysis controls and compact, readable pagination. */
.deduction-table-search { width: min(220px, 22vw); min-width: 150px; }
.deduction-filter-menu { position: relative; z-index: 30; }
.deduction-filter-menu > summary { list-style: none; cursor: pointer; white-space: nowrap; }
.deduction-filter-menu > summary::-webkit-details-marker { display: none; }
.deduction-filter-trigger { display: inline-flex; align-items: center; gap: .35rem; min-height: 42px; padding-inline: .85rem; border: 1px solid #b9d1f6; border-radius: .72rem; color: #315f9f; background: linear-gradient(135deg, #f3f7ff, #e7f0ff); box-shadow: 0 3px 10px rgba(90,141,238,.12); font-weight: 850; }
.deduction-filter-trigger:hover, .deduction-filter-menu[open] .deduction-filter-trigger { color: #fff; border-color: #5a8dee; background: linear-gradient(135deg, #6c9bf0, #4e7fdf); box-shadow: 0 6px 16px rgba(90,141,238,.25); }
.deduction-filter-trigger > i { color: inherit; font-size: 1.05rem; }
.deduction-filter-popover { position: absolute; z-index: 1080; top: calc(100% + .55rem); right: 0; width: min(520px, calc(100vw - 1.5rem)); min-width: min(320px, calc(100vw - 1.5rem)); box-sizing: border-box; padding: .9rem; border: 1px solid #cdddf3; border-radius: .9rem; background: #fff; box-shadow: 0 18px 42px rgba(37,57,111,.22); }
.deduction-filter-popover .form-select, .deduction-filter-popover .form-control, .deduction-filter-popover #deduction-filter-column { display: block; box-sizing: border-box; width: 100% !important; min-width: 100% !important; inline-size: 100% !important; min-inline-size: 100% !important; min-height: 42px; }
.deduction-filter-popover .select2-container { width: 100% !important; min-width: 100% !important; flex: 0 0 100% !important; margin-bottom: .6rem; }
.deduction-filter-popover > .form-control { border-color: #d6e2f3; background: linear-gradient(135deg, #fbfdff 0%, #f5f8ff 100%); box-shadow: 0 3px 10px rgba(71, 111, 175, .08); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.deduction-filter-popover > .form-control:focus { border-color: #83aaf0; background: #fff; box-shadow: 0 0 0 .16rem rgba(90, 141, 238, .13), 0 7px 16px rgba(71, 111, 175, .12); }
.deduction-filter-popover .form-select { padding-right: .8rem; padding-left: 2.1rem; white-space: nowrap; }
.deduction-filter-values { min-height: 150px; max-height: 392px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; border: 1px solid #dfe8f5; border-radius: .55rem; padding: .35rem .5rem; }
.deduction-filter-value { display: flex; align-items: center; gap: .55rem; min-height: 38px; padding: .35rem .2rem; color: #566b87; font-size: .75rem; cursor: pointer; white-space: nowrap; }
.deduction-filter-value span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.deduction-filter-value:hover { background: #f4f8ff; }
.deduction-filter-value input { accent-color: var(--py-primary); }
.deduction-filter-actions { align-items: center; }
.deduction-filter-action { display: inline-flex; min-height: 32px; align-items: center; gap: .25rem; padding: .3rem .65rem; border: 1px solid transparent; border-radius: .55rem; font-size: .68rem; font-weight: 850; line-height: 1; transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.deduction-filter-action i { font-size: .9rem; }
.deduction-filter-action-all { color: #4e7edc; border-color: #c7d9fb; background: #eef4ff; }
.deduction-filter-action-all:hover { color: #fff; border-color: #5a8dee; background: #5a8dee; box-shadow: 0 4px 10px rgba(90,141,238,.2); transform: translateY(-1px); }
.deduction-filter-action-clear { color: #df555d; border-color: #ffc8cc; background: #fff1f2; }
.deduction-filter-action-clear:hover { color: #fff; border-color: #e45b62; background: #e45b62; box-shadow: 0 4px 10px rgba(228,91,98,.18); transform: translateY(-1px); }
.deduction-table-scroll { height: auto; max-height: none; overflow-x: auto; overflow-y: clip; overscroll-behavior-x: contain; }
#deductions-print-area { overflow: visible; }
#deductions-print-area:has(.deduction-filter-menu[open]) .report-panel-head { position: relative; z-index: 40; }
.deduction-pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem .9rem; border-top: 1px solid #edf1f6; background: #fbfcfe; }
.deduction-pagination-info { color: #71829a; font-size: .72rem; white-space: nowrap; }
.deduction-pagination .pagination { gap: .2rem; }
.deduction-pagination .pagination { direction: rtl; }
.deduction-pagination .page-link { min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: .45rem; color: #53709a; background: transparent; font-size: .72rem; }
.deduction-pagination .page-link:hover:not(:disabled) { background: #eaf1ff; color: var(--py-primary); }
.deduction-pagination .page-item.active .page-link { color: #fff; background: var(--py-primary); box-shadow: 0 4px 10px rgba(90,141,238,.24); }
.deduction-pagination .page-link:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 767.98px) {
  .deduction-table-search { width: 100%; min-width: 0; }
  .deduction-filter-popover { position: fixed; top: 4.8rem; right: .75rem; left: .75rem; width: auto; max-height: calc(100dvh - 6rem); overflow-y: auto; }
  .deduction-pagination { align-items: stretch; flex-direction: column; }
  .deduction-pagination-info { text-align: center; }
  .deduction-pagination nav { display: flex; justify-content: center; }
}
