@import url("https://fonts.googleapis.com/css2?family=Lato:wght@400;500;700;900&family=Tajawal:wght@400;500;700;800&display=swap");

:root {
  --ui-font-latin: "Lato", "Segoe UI", Tahoma, sans-serif;
  --ui-font-ar: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --ui-brand-primary: #004b87;
  --ui-brand-primary-strong: #003063;
  --ui-brand-primary-soft: #e7f1fb;
  --ui-brand-primary-rgb: 0, 75, 135;
  --ui-brand-accent: #f09a1a;
  --ui-brand-accent-strong: #cf7d00;
  --ui-brand-accent-soft: #fff1dc;
  --ui-brand-accent-rgb: 240, 154, 26;
  --ui-text-main: #19344f;
  --ui-text-muted: #57697d;
  --ui-text-soft: #7d8fa1;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f4f8fc;
  --ui-surface-accent: #edf4fb;
  --ui-border: #d3dfeb;
  --ui-border-strong: #bfd1e2;
  --ui-primary: var(--ui-brand-primary);
  --ui-primary-strong: var(--ui-brand-primary-strong);
  --ui-primary-soft: var(--ui-brand-primary-soft);
  --ui-success: #2e8a67;
  --ui-warning: var(--ui-brand-accent);
  --ui-danger: #c14d57;
  --ui-radius-sm: 10px;
  --ui-radius-md: 14px;
  --ui-radius-lg: 18px;
  --ui-shadow-soft: 0 14px 32px rgba(0, 48, 99, 0.08);
  --ui-shadow-strong: 0 22px 48px rgba(0, 34, 71, 0.16);
  --ui-focus: 0 0 0 3px rgba(var(--ui-brand-primary-rgb), 0.16);
}

html[data-ui-theme="classic"] {
  --ui-surface-soft: #f3f6fb;
  --ui-surface-accent: #e9eff7;
  --ui-border: #cfd9e6;
  --ui-border-strong: #bfcddd;
  --ui-radius-sm: 6px;
  --ui-radius-md: 8px;
  --ui-radius-lg: 10px;
  --ui-shadow-soft: 0 4px 14px rgba(25, 48, 78, 0.08);
  --ui-shadow-strong: 0 10px 24px rgba(15, 35, 62, 0.12);
}

html,
body {
  min-height: 100%;
}

body {
  position: relative;
  font-family: var(--ui-font-latin);
  color: var(--ui-text-main);
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 0% 0%, rgba(var(--ui-brand-accent-rgb), 0.16), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(var(--ui-brand-primary-rgb), 0.14), transparent 30%),
    radial-gradient(circle at 100% 100%, rgba(var(--ui-brand-accent-rgb), 0.08), transparent 22%),
    linear-gradient(165deg, #f7fbff 0%, #edf3f9 52%, #f8fbff 100%);
}

html[data-ui-theme="classic"] body {
  background: linear-gradient(180deg, #f2f5f9 0%, #edf2f8 100%);
}

html[dir="rtl"] body,
html[lang^="ar"] body {
  font-family: var(--ui-font-ar);
}

.tw-font-sans {
  font-family: inherit !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  color: #1a2f4b;
  font-weight: 700;
}

a {
  color: var(--ui-primary);
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover,
a:focus {
  color: var(--ui-primary-strong);
  text-decoration: none;
}

main,
#scrollable-container,
.content-wrapper,
.right-side {
  background: transparent;
}

.side-bar {
  border-inline-end: 1px solid var(--ui-border);
  background: linear-gradient(180deg, var(--ui-surface) 0%, var(--ui-surface-soft) 100%);
  box-shadow: 14px 0 32px rgba(0, 48, 99, 0.08);
}

.side-bar .sidebar-menu,
.side-bar .sidebar-menu > li > .treeview-menu {
  background: transparent;
}

.side-bar .sidebar-menu > li > a {
  margin: 3px 10px;
  border-radius: 12px;
  color: var(--ui-text-main);
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.side-bar .sidebar-menu > li.active > a,
.side-bar .sidebar-menu > li:hover > a {
  background: linear-gradient(90deg, rgba(var(--ui-brand-primary-rgb), 0.16), rgba(var(--ui-brand-accent-rgb), 0.1));
  color: var(--ui-primary-strong);
  box-shadow: inset 3px 0 0 var(--ui-brand-accent);
  transform: translateX(2px);
}

html[dir="rtl"] .side-bar .sidebar-menu > li.active > a,
html[dir="rtl"] .side-bar .sidebar-menu > li:hover > a {
  box-shadow: inset -3px 0 0 var(--ui-brand-accent);
  transform: translateX(-2px);
}

.side-bar .treeview-menu > li > a {
  margin: 2px 10px 2px 20px;
  border-radius: 10px;
  color: var(--ui-text-muted);
}

html[dir="rtl"] .side-bar .treeview-menu > li > a {
  margin: 2px 20px 2px 10px;
}

.side-bar .treeview-menu > li.active > a,
.side-bar .treeview-menu > li > a:hover {
  background: rgba(var(--ui-brand-primary-rgb), 0.1);
  color: var(--ui-primary-strong);
}

.system-header-shell {
  background: linear-gradient(118deg, var(--ui-primary) 0%, var(--ui-primary-strong) 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 18px 38px rgba(0, 24, 50, 0.22) !important;
  animation: ui-header-reveal 420ms ease-out both;
}

.system-header-button,
.system-header-chip {
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px rgba(0, 24, 50, 0.14);
}

.system-header-button:hover,
.system-header-button:focus,
.system-header-button[aria-expanded="true"],
details[open] > .system-header-button,
.system-header-chip:hover {
  background: rgba(var(--ui-brand-accent-rgb), 0.16) !important;
  border-color: rgba(var(--ui-brand-accent-rgb), 0.34) !important;
  color: #ffffff !important;
}

.system-header-button--cta {
  background: linear-gradient(135deg, var(--ui-brand-accent) 0%, #f7b958 100%) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #173150 !important;
  box-shadow: 0 16px 30px rgba(var(--ui-brand-accent-rgb), 0.28) !important;
}

.system-header-button--cta:hover,
.system-header-button--cta:focus {
  color: #102542 !important;
  filter: brightness(0.98);
}

.system-header-menu {
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(var(--ui-brand-primary-rgb), 0.1);
}

.system-header-notification-badge {
  background: linear-gradient(135deg, var(--ui-brand-accent) 0%, var(--ui-brand-accent-strong) 100%) !important;
  border-color: rgba(7, 24, 45, 0.56) !important;
  box-shadow: 0 8px 16px rgba(var(--ui-brand-accent-rgb), 0.28);
}

.ui-theme-toggle {
  min-width: 44px;
  min-height: 44px;
  gap: 8px;
}

.ui-theme-toggle__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ui-brand-accent);
  box-shadow: 0 0 0 4px rgba(var(--ui-brand-accent-rgb), 0.18);
}

.ui-theme-toggle__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-ui-theme="classic"] .ui-theme-toggle__dot {
  background: #f7b958;
  box-shadow: 0 0 0 4px rgba(var(--ui-brand-accent-rgb), 0.16);
}

html[data-ui-theme="classic"] .system-header-shell {
  box-shadow: 0 10px 24px rgba(12, 33, 58, 0.14) !important;
}

html[data-ui-theme="classic"] .box,
html[data-ui-theme="classic"] .panel,
html[data-ui-theme="classic"] .nav-tabs-custom,
html[data-ui-theme="classic"] .info-box {
  animation: none;
}

html[data-ui-theme="classic"] .side-bar .sidebar-menu > li > a {
  border-radius: 8px;
}

.box,
.panel,
.nav-tabs-custom,
.well,
.info-box,
.modal-content,
.dropdown-menu,
.popover {
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-soft);
}

.box,
.panel,
.nav-tabs-custom,
.info-box {
  background: var(--ui-surface);
  animation: ui-rise 280ms ease-out both;
}

.box {
  border-top: 1px solid var(--ui-border);
}

.small-box {
  border-radius: var(--ui-radius-lg);
  overflow: hidden;
  box-shadow: var(--ui-shadow-soft);
}

.box-header,
.panel-heading {
  border-bottom: 1px solid var(--ui-border);
  background: linear-gradient(180deg, rgba(var(--ui-brand-primary-rgb), 0.05) 0%, rgba(var(--ui-brand-accent-rgb), 0.08) 100%);
  border-radius: var(--ui-radius-lg) var(--ui-radius-lg) 0 0;
}

.box-title,
.panel-title {
  font-weight: 700;
  color: #18324f;
}

.box-footer,
.panel-footer {
  background: #fbfdff;
  border-top: 1px solid var(--ui-border);
  border-radius: 0 0 var(--ui-radius-lg) var(--ui-radius-lg);
}

.modal-backdrop.in {
  opacity: 0.46;
}

.modal-content {
  border: 1px solid var(--ui-border-strong);
  box-shadow: var(--ui-shadow-strong);
}

.modal-header {
  background: linear-gradient(180deg, #f9fcff, #f1f6fc);
  border-bottom: 1px solid var(--ui-border);
  border-top-left-radius: var(--ui-radius-lg);
  border-top-right-radius: var(--ui-radius-lg);
}

.modal-footer {
  border-top: 1px solid var(--ui-border);
  background: #fbfdff;
  border-bottom-left-radius: var(--ui-radius-lg);
  border-bottom-right-radius: var(--ui-radius-lg);
}

html[dir="rtl"] .box-footer,
html[dir="rtl"] .panel-footer,
html[dir="rtl"] .modal-footer {
  text-align: right;
}

html[dir="rtl"] .btn.pull-right,
html[dir="rtl"] .tw-dw-btn.pull-right,
html[dir="rtl"] .box-tools.pull-right,
html[dir="rtl"] .btn-group.pull-right,
html[dir="rtl"] .btn-toolbar.pull-right {
  float: right !important;
}

html[dir="rtl"] .btn.pull-left,
html[dir="rtl"] .tw-dw-btn.pull-left,
html[dir="rtl"] .box-tools.pull-left,
html[dir="rtl"] .btn-group.pull-left,
html[dir="rtl"] .btn-toolbar.pull-left {
  float: left !important;
}

html[dir="rtl"] .box-footer .btn + .btn,
html[dir="rtl"] .box-footer .btn + .tw-dw-btn,
html[dir="rtl"] .box-footer .tw-dw-btn + .btn,
html[dir="rtl"] .box-footer .tw-dw-btn + .tw-dw-btn,
html[dir="rtl"] .panel-footer .btn + .btn,
html[dir="rtl"] .panel-footer .btn + .tw-dw-btn,
html[dir="rtl"] .panel-footer .tw-dw-btn + .btn,
html[dir="rtl"] .panel-footer .tw-dw-btn + .tw-dw-btn,
html[dir="rtl"] .modal-footer .btn + .btn,
html[dir="rtl"] .modal-footer .btn + .tw-dw-btn,
html[dir="rtl"] .modal-footer .tw-dw-btn + .btn,
html[dir="rtl"] .modal-footer .tw-dw-btn + .tw-dw-btn {
  margin-right: 8px;
  margin-left: 0;
}

@media (min-width: 992px) {
  html[dir="rtl"] .visa-wizard-nav {
    flex-direction: row-reverse;
  }
}

.btn,
.tw-dw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--ui-radius-sm);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover,
.tw-dw-btn:hover,
.btn:focus,
.tw-dw-btn:focus {
  transform: translateY(-1px);
}

.btn-primary,
.tw-dw-btn-primary {
  background: linear-gradient(180deg, var(--ui-primary) 0%, var(--ui-primary-strong) 100%);
  border-color: var(--ui-primary-strong);
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(var(--ui-brand-primary-rgb), 0.24);
}

.btn-primary .fa,
.btn-primary .fas,
.btn-primary .far,
.btn-primary .glyphicon,
.tw-dw-btn-primary .fa,
.tw-dw-btn-primary .fas,
.tw-dw-btn-primary .far,
.tw-dw-btn-primary .glyphicon {
  color: inherit !important;
}

.btn-primary:hover,
.btn-primary:focus,
.tw-dw-btn-primary:hover,
.tw-dw-btn-primary:focus {
  color: #ffffff !important;
  filter: brightness(0.96);
}

.btn-default,
.tw-dw-btn-outline,
.btn-flat.btn-default {
  border-color: var(--ui-border-strong);
  background: #fff;
  color: var(--ui-text-main);
  box-shadow: 0 4px 14px rgba(18, 38, 62, 0.06);
}

.btn-default:hover,
.btn-default:focus,
.tw-dw-btn-outline:hover,
.tw-dw-btn-outline:focus,
.btn-flat.btn-default:hover,
.btn-flat.btn-default:focus {
  color: var(--ui-primary-strong);
  border-color: rgba(var(--ui-brand-primary-rgb), 0.24);
  background: linear-gradient(180deg, #ffffff 0%, rgba(var(--ui-brand-primary-rgb), 0.05) 100%);
}

.tw-dw-btn-outline.tw-dw-btn-primary {
  border-color: rgba(var(--ui-brand-primary-rgb), 0.28) !important;
  color: var(--ui-primary-strong) !important;
  background: rgba(var(--ui-brand-primary-rgb), 0.04) !important;
}

.tw-dw-btn-outline.tw-dw-btn-primary:hover,
.tw-dw-btn-outline.tw-dw-btn-primary:focus {
  background: linear-gradient(180deg, rgba(var(--ui-brand-primary-rgb), 0.12) 0%, rgba(var(--ui-brand-accent-rgb), 0.12) 100%) !important;
  border-color: rgba(var(--ui-brand-primary-rgb), 0.38) !important;
  color: var(--ui-primary-strong) !important;
}

.btn-success {
  background: linear-gradient(180deg, #3ca87b 0%, #2e8a67 100%);
  border-color: #267354;
  color: #ffffff !important;
}

.btn-success:hover,
.btn-success:focus,
.tw-dw-btn-success:hover,
.tw-dw-btn-success:focus {
  color: #ffffff !important;
}

.btn-warning {
  background: linear-gradient(180deg, #f7b958 0%, var(--ui-brand-accent) 100%);
  border-color: var(--ui-brand-accent-strong);
  color: #102542 !important;
}

.btn-warning:hover,
.btn-warning:focus,
.tw-dw-btn-warning:hover,
.tw-dw-btn-warning:focus {
  color: #102542 !important;
}

.btn-danger {
  background: linear-gradient(180deg, #d66771 0%, #c14d57 100%);
  border-color: #a93d48;
  color: #ffffff !important;
}

.btn-danger:hover,
.btn-danger:focus,
.tw-dw-btn-error:hover,
.tw-dw-btn-error:focus,
.tw-dw-btn-neutral:hover,
.tw-dw-btn-neutral:focus {
  color: #ffffff !important;
}

.tw-dw-btn-success {
  background: linear-gradient(180deg, #3ca87b 0%, #2e8a67 100%) !important;
  border-color: #267354 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(46, 138, 103, 0.22);
}

.tw-dw-btn-error {
  background: linear-gradient(180deg, #d66771 0%, #c14d57 100%) !important;
  border-color: #a93d48 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(193, 77, 87, 0.2);
}

.tw-dw-btn-warning {
  background: linear-gradient(180deg, #f7b958 0%, var(--ui-brand-accent) 100%) !important;
  border-color: var(--ui-brand-accent-strong) !important;
  color: #102542 !important;
  box-shadow: 0 8px 18px rgba(var(--ui-brand-accent-rgb), 0.2);
}

.tw-dw-btn-neutral {
  background: linear-gradient(180deg, #1f3b58 0%, #16314b 100%) !important;
  border-color: #102542 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(16, 37, 66, 0.22);
}

.tw-dw-btn-primary .fa,
.tw-dw-btn-primary .fas,
.tw-dw-btn-primary .far,
.tw-dw-btn-success .fa,
.tw-dw-btn-success .fas,
.tw-dw-btn-success .far,
.tw-dw-btn-error .fa,
.tw-dw-btn-error .fas,
.tw-dw-btn-error .far,
.tw-dw-btn-neutral .fa,
.tw-dw-btn-neutral .fas,
.tw-dw-btn-neutral .far,
.tw-dw-btn-warning .fa,
.tw-dw-btn-warning .fas,
.tw-dw-btn-warning .far {
  color: inherit !important;
}

.modal-title {
  font-weight: 800;
  color: #173150;
}

.form-control,
.input-group-addon,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  border: 1px solid var(--ui-border-strong) !important;
  border-radius: var(--ui-radius-sm) !important;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.form-control {
  min-height: 38px;
  color: var(--ui-text-main);
}

.form-control::placeholder {
  color: var(--ui-text-soft);
}

.form-control:focus,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--multiple:focus {
  border-color: var(--ui-primary) !important;
  box-shadow: var(--ui-focus);
}

.select2-container--default .select2-selection--single {
  height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px !important;
  color: var(--ui-text-main);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px !important;
}

.select2-dropdown {
  border-color: var(--ui-border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(11, 34, 61, 0.14);
  background: #ffffff;
}

.select2-container .select2-search__field,
.select2-dropdown .select2-search__field,
.select2-search--dropdown .select2-search__field,
.select2-search--inline .select2-search__field,
.select2-container--default .select2-search--dropdown .select2-search__field,
.select2-container--default .select2-search--inline .select2-search__field,
.dataTables_wrapper .dataTables_filter input,
.ui-autocomplete-input,
.ts-control input,
.ts-dropdown .dropdown-input,
.bootstrap-select .bs-searchbox .form-control,
.chosen-search input {
  background: #ffffff !important;
  color: var(--ui-text-main) !important;
  caret-color: var(--ui-text-main);
  -webkit-text-fill-color: var(--ui-text-main);
  border: 1px solid var(--ui-border-strong) !important;
  color-scheme: light;
}

.select2-container .select2-search__field:focus,
.select2-dropdown .select2-search__field:focus,
.select2-search--dropdown .select2-search__field:focus,
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--ui-primary) !important;
  box-shadow: var(--ui-focus);
}

.select2-container--default .select2-results__option {
  color: var(--ui-text-main);
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[aria-selected]:hover {
  background: linear-gradient(90deg, rgba(var(--ui-brand-primary-rgb), 0.12), rgba(var(--ui-brand-accent-rgb), 0.14));
  color: var(--ui-primary-strong);
}

.table {
  margin-bottom: 14px;
  border-collapse: separate;
  border-spacing: 0;
}

.table > thead > tr > th {
  color: #213851;
  font-weight: 800;
  background: linear-gradient(180deg, rgba(var(--ui-brand-primary-rgb), 0.06) 0%, rgba(var(--ui-brand-accent-rgb), 0.1) 100%);
  border-top: 1px solid var(--ui-border);
  border-bottom: 1px solid var(--ui-border);
}

.table > thead > tr > th:first-child {
  border-left: 1px solid var(--ui-border);
  border-top-left-radius: 12px;
}

.table > thead > tr > th:last-child {
  border-right: 1px solid var(--ui-border);
  border-top-right-radius: 12px;
}

.table > tbody > tr > td {
  border-top: 1px solid #edf2f8;
  color: var(--ui-text-main);
  vertical-align: middle;
}

.table > tbody > tr:last-child > td:first-child {
  border-bottom-left-radius: 12px;
}

.table > tbody > tr:last-child > td:last-child {
  border-bottom-right-radius: 12px;
}

html[dir="rtl"] .table > thead > tr > th:first-child {
  border-left: 0;
  border-right: 1px solid var(--ui-border);
  border-top-left-radius: 0;
  border-top-right-radius: 12px;
}

html[dir="rtl"] .table > thead > tr > th:last-child {
  border-right: 0;
  border-left: 1px solid var(--ui-border);
  border-top-right-radius: 0;
  border-top-left-radius: 12px;
}

html[dir="rtl"] .table > tbody > tr:last-child > td:first-child {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 12px;
}

html[dir="rtl"] .table > tbody > tr:last-child > td:last-child {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 12px;
}

.table-hover > tbody > tr:hover > td {
  background: #f6faff;
}

.invoice,
.print_section,
#receipt_section {
  background: #fff;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
}

.print_section,
#receipt_section {
  padding: 12px;
  box-shadow: var(--ui-shadow-soft);
}

.invoice .invoice-col {
  border-inline-start: 1px dashed var(--ui-border);
  padding-inline-start: 14px;
}

.invoice .invoice-col:first-child {
  border-inline-start: 0;
  padding-inline-start: 0;
}

.table-pdf {
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  overflow: hidden;
}

.table-pdf thead tr {
  background: linear-gradient(180deg, var(--ui-primary) 0%, var(--ui-primary-strong) 100%) !important;
  color: #fff;
}

.table-pdf thead tr th {
  color: #fff !important;
  border-bottom-color: rgba(255, 255, 255, 0.18) !important;
  font-weight: 700;
}

.table-pdf .odd {
  background: var(--ui-surface-soft);
}

.td-border td,
.td-border th {
  border-bottom: 1px solid #d7e2ef;
}

.layout-table .info-box-print,
.info-box-print {
  border: 1px solid var(--ui-border-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 35, 63, 0.08);
}

.blue-heading {
  background: linear-gradient(180deg, var(--ui-primary) 0%, var(--ui-primary-strong) 100%);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
}

.invoice .table,
.print_section .table,
#receipt_section .table {
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  overflow: hidden;
}

.invoice .table > thead > tr > th,
.print_section .table > thead > tr > th,
#receipt_section .table > thead > tr > th {
  background: var(--ui-surface-accent);
  border-bottom: 1px solid var(--ui-border);
  font-weight: 700;
}

.invoice .table > tbody > tr > td,
.print_section .table > tbody > tr > td,
#receipt_section .table > tbody > tr > td {
  border-top: 1px solid var(--ui-border);
}

.invoice .table > tfoot > tr > th,
.invoice .table > tfoot > tr > td,
.print_section .table > tfoot > tr > th,
.print_section .table > tfoot > tr > td,
#receipt_section .table > tfoot > tr > th,
#receipt_section .table > tfoot > tr > td {
  background: #f1f6fc;
  font-weight: 700;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border-radius: var(--ui-radius-sm);
  border: 1px solid var(--ui-border-strong);
  min-height: 36px;
  background: #ffffff;
  color: var(--ui-text-main, #0f172a);
  -webkit-text-fill-color: var(--ui-text-main, #0f172a);
  caret-color: var(--ui-text-main, #0f172a);
}

.nav-tabs {
  border-bottom: 1px solid var(--ui-border);
}

.nav-tabs > li > a {
  border-radius: 12px 12px 0 0;
  border: 1px solid transparent;
  color: var(--ui-text-muted);
  font-weight: 700;
}

.nav-tabs > li > a:hover {
  border-color: var(--ui-border);
  background: #f6fafe;
  color: var(--ui-primary-strong);
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover {
  color: var(--ui-primary-strong);
  border-color: var(--ui-border);
  border-bottom-color: #fff;
  background: #fff;
}

.pagination > li > a,
.pagination > li > span {
  border: 1px solid var(--ui-border);
  color: var(--ui-primary-strong);
  border-radius: var(--ui-radius-sm) !important;
  margin: 0 3px;
}

.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:focus,
.pagination > .active > span:focus,
.pagination > .active > a:hover,
.pagination > .active > span:hover {
  background: var(--ui-primary);
  border-color: var(--ui-primary);
}

.dropdown-menu {
  padding: 8px;
  min-width: 200px;
}

.dropdown-menu > li > a {
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--ui-text-main);
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  color: var(--ui-primary-strong);
  background: linear-gradient(90deg, var(--ui-primary-soft), rgba(var(--ui-brand-accent-rgb), 0.14));
}

.content-header > h1 {
  font-weight: 800;
  color: #173150;
}

.login-box,
.register-box,
.login-box-body,
.register-box-body {
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-strong);
  border: 1px solid var(--ui-border);
}

.label,
.badge {
  border-radius: 999px;
  font-weight: 700;
}

.fa,
.fas,
.far,
.fab,
.glyphicon,
.ion {
  transition: color 0.2s ease, transform 0.2s ease;
}

a:hover .fa,
a:hover .fas,
button:hover .fa,
button:hover .fas,
a:hover .glyphicon,
button:hover .glyphicon,
a:hover .ion,
button:hover .ion {
  transform: translateY(-1px);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #edf2f8;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: #b9c8da;
  border-radius: 999px;
  border: 2px solid #edf2f8;
}

::-webkit-scrollbar-thumb:hover {
  background: #93aac3;
}

/* Modern notification skin for toastr */
#toast-container {
  z-index: 1000000;
}

#toast-container.toast-top-right {
  top: 16px;
  right: 16px;
}

#toast-container.toast-top-left {
  top: 16px;
  left: 16px;
}

#toast-container > .toast {
  position: relative;
  width: min(390px, calc(100vw - 24px));
  margin: 0 0 10px;
  padding: 12px 14px 12px 54px;
  border-radius: 14px;
  border: 1px solid var(--ui-border-strong);
  box-shadow: 0 16px 32px rgba(8, 34, 64, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  background-image: none !important;
  color: var(--ui-text-main);
  opacity: 1;
  pointer-events: auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

html[dir="rtl"] #toast-container > .toast {
  padding: 12px 54px 12px 14px;
}

#toast-container > .toast::before {
  content: "i";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #1a4b75;
  background: rgba(var(--ui-brand-primary-rgb), 0.14);
}

html[dir="rtl"] #toast-container > .toast::before {
  left: auto;
  right: 16px;
}

#toast-container > .toast-success {
  border-color: rgba(46, 138, 103, 0.35);
  background: linear-gradient(180deg, #ffffff 0%, #f4fbf7 100%) !important;
}

#toast-container > .toast-success::before {
  content: "OK";
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #1b5d44;
  background: rgba(46, 138, 103, 0.16);
}

#toast-container > .toast-error {
  border-color: rgba(193, 77, 87, 0.35);
  background: linear-gradient(180deg, #ffffff 0%, #fff6f7 100%) !important;
}

#toast-container > .toast-error::before {
  content: "x";
  color: #8f2f38;
  background: rgba(193, 77, 87, 0.16);
}

#toast-container > .toast-warning {
  border-color: rgba(var(--ui-brand-accent-rgb), 0.42);
  background: linear-gradient(180deg, #ffffff 0%, #fff8ee 100%) !important;
}

#toast-container > .toast-warning::before {
  content: "!";
  color: #8a5600;
  background: rgba(var(--ui-brand-accent-rgb), 0.2);
}

#toast-container > .toast-info {
  border-color: rgba(var(--ui-brand-primary-rgb), 0.32);
}

#toast-container > .toast:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 34px rgba(7, 27, 52, 0.22);
}

#toast-container .toast-title {
  color: #173150;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 2px;
}

#toast-container .toast-message {
  color: var(--ui-text-main);
  font-size: 13px;
  line-height: 1.5;
}

#toast-container .toast-message a,
#toast-container .toast-message label {
  color: var(--ui-primary-strong);
}

#toast-container .toast-close-button {
  right: 2px;
  top: 2px;
  color: #385575;
  opacity: 0.65;
  text-shadow: none;
}

html[dir="rtl"] #toast-container .toast-close-button {
  right: auto;
  left: 2px;
}

#toast-container .toast-close-button:hover,
#toast-container .toast-close-button:focus {
  color: #152f4d;
  opacity: 1;
}

#toast-container .toast-progress {
  height: 3px;
  opacity: 1;
  background: rgba(var(--ui-brand-primary-rgb), 0.34);
}

#toast-container > .toast-success .toast-progress {
  background: rgba(46, 138, 103, 0.44);
}

#toast-container > .toast-error .toast-progress {
  background: rgba(193, 77, 87, 0.44);
}

#toast-container > .toast-warning .toast-progress {
  background: rgba(var(--ui-brand-accent-rgb), 0.5);
}

@keyframes ui-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ui-header-reveal {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 991px) {
  .side-bar {
    box-shadow: 0 24px 48px rgba(13, 34, 63, 0.28);
    border-inline-end: 0;
  }

  .box,
  .panel,
  .nav-tabs-custom,
  .modal-content,
  .dropdown-menu {
    border-radius: var(--ui-radius-md);
  }

  .system-header-shell {
    border-radius: 0 0 18px 18px;
  }
}

@media (max-width: 767px) {
  #toast-container.toast-top-right,
  #toast-container.toast-top-left {
    left: 8px;
    right: 8px;
    top: 8px;
  }

  #toast-container > .toast {
    width: auto;
    margin: 0 0 8px;
  }

  body {
    background: linear-gradient(180deg, #f6f9ff 0%, #eef4fb 100%);
  }

  .table-responsive {
    border: 0;
    background: transparent;
  }

  .modal-dialog {
    margin: 12px;
  }
}

@media print {
  html,
  body {
    background: #ffffff !important;
  }

  .system-header-shell,
  .side-bar,
  .no-print,
  .scrolltop,
  .overlay {
    display: none !important;
  }

  .invoice,
  .print_section,
  #receipt_section {
    box-shadow: none !important;
    border: 1px solid #cfd9e6 !important;
  }

  .table > thead > tr > th {
    background: #f1f5f9 !important;
    color: #111827 !important;
  }

  .table-pdf thead tr {
    background: var(--ui-primary) !important;
    color: #ffffff !important;
  }

  .table-pdf .odd {
    background: #f8fafc !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Search-like fields: typed text must stay dark on an opaque light field. */
input[type="search"],
.dataTables_wrapper .dataTables_filter input,
.select2-container .select2-search__field,
.select2-search--dropdown .select2-search__field,
.select2-search--inline .select2-search__field,
.account-search-input,
#search_product,
#search_product_for_purchase_return,
#search_product_for_label,
input.search_product,
input[id^="search_product"],
input.ui-autocomplete-input,
.twitter-typeahead .tt-input,
#app_quick_nav_search {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a !important;
  background-color: #ffffff !important;
  font-size: 14px;
  font-weight: 600;
  opacity: 1 !important;
  color-scheme: light;
}

input[type="search"]::placeholder,
.dataTables_wrapper .dataTables_filter input::placeholder,
.select2-container .select2-search__field::placeholder,
.select2-search--dropdown .select2-search__field::placeholder,
.select2-search--inline .select2-search__field::placeholder,
.account-search-input::placeholder,
#search_product::placeholder,
#search_product_for_purchase_return::placeholder,
#search_product_for_label::placeholder,
input.search_product::placeholder,
input[id^="search_product"]::placeholder,
input.ui-autocomplete-input::placeholder,
.twitter-typeahead .tt-input::placeholder,
#app_quick_nav_search::placeholder {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
  opacity: 1 !important;
}

input[type="search"]:-webkit-autofill,
input[type="search"]:-webkit-autofill:hover,
input[type="search"]:-webkit-autofill:focus,
.dataTables_wrapper .dataTables_filter input:-webkit-autofill,
.select2-container .select2-search__field:-webkit-autofill,
#search_product:-webkit-autofill,
input.search_product:-webkit-autofill,
input[id^="search_product"]:-webkit-autofill,
#app_quick_nav_search:-webkit-autofill {
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a;
  box-shadow: 0 0 0 1000px #ffffff inset;
  transition: background-color 9999s ease-out;
}

.system-header-shell .app-quick-search input {
  font-size: 15px;
  font-weight: 700;
}

/* Product create/edit form polish */
.product-form-grid .product-checkbox-field {
  margin-top: 8px;
  min-height: 62px;
}

.product-form-grid .product-checkbox-field .help-block {
  margin-bottom: 0;
}

#product_locations + .select2-container,
#product_locations.select2-hidden-accessible + .select2-container {
  width: 100% !important;
}

.select2-container--default .select2-selection--multiple {
  min-height: 38px;
  max-height: 96px;
  overflow-y: auto;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 6px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0 !important;
}

.product_form .file-input,
.product_form #product_brochure {
  width: 100%;
}

.product_form .selected-brochure-name {
  margin-top: 6px;
  color: #334155;
  font-weight: 600;
}

/* Sell / Purchase invoice create polish */
.sell-create-redesign .invoice-product-toolbar,
.purchase-create-redesign .invoice-product-toolbar {
  margin-bottom: 12px;
}

.sell-create-redesign .invoice-table-wrap,
.purchase-create-redesign .invoice-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sell-create-redesign #pos_table,
.purchase-create-redesign #purchase_entry_table {
  min-width: 860px;
  margin-bottom: 0;
}

.sell-create-redesign #select_location_id,
.sell-create-redesign .select2-container {
  width: 100% !important;
}

.sell-create-redesign .invoice-actions .tw-dw-btn,
.purchase-create-redesign .invoice-actions .tw-dw-btn {
  margin: 0 6px 8px;
}

.purchase-create-redesign .purchase-header-grid > [class*="col-"] {
  margin-bottom: 4px;
}

@media (max-width: 767px) {
  .product-form-grid .product-checkbox-field {
    margin-top: 0;
    min-height: 0;
  }

  .sell-create-redesign #pos_table,
  .purchase-create-redesign #purchase_entry_table {
    min-width: 720px;
  }

  .sell-create-redesign .invoice-actions .tw-dw-btn,
  .purchase-create-redesign .invoice-actions .tw-dw-btn {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* ====================================================================
   P-CORE-OPS-UI-POLISH  Wave 1
   Sell/Purchase edit, sell-return add, expense create, payment modals
   ==================================================================== */

/* --- Sell Edit Redesign (mirrors sell-create-redesign) --- */
.sell-edit-redesign {
  --sell-primary: #0e7481;
  --sell-secondary: #1aa29e;
  --sell-border: #d3e7e4;
  --sell-soft: #f5fcfb;
}

.sell-edit-redesign .box-solid,
.sell-edit-redesign .box-primary {
  border: 1px solid var(--sell-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(10, 82, 92, 0.08);
}

.sell-edit-redesign .box-solid .box-header,
.sell-edit-redesign .box-primary .box-header {
  background: linear-gradient(120deg, #edf8f7 0%, #f6fcff 100%);
  border-bottom: 1px solid #deefed;
}

.sell-edit-redesign .form-control,
.sell-edit-redesign .input-group-addon,
.sell-edit-redesign .select2-selection {
  border-color: #cae2df;
}

.sell-edit-redesign .form-control:focus,
.sell-edit-redesign .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--sell-secondary);
  box-shadow: 0 0 0 3px rgba(26, 162, 158, 0.16);
}

.sell-edit-redesign .table {
  border-color: #d4e7e5;
}

.sell-edit-redesign #pos_table thead th {
  background: #ecf8f6;
  color: #0f4f5b;
  font-weight: 700;
  border-color: #d4e7e5;
}

.sell-edit-redesign .well {
  border: 1px solid #d5e8e6;
  background: var(--sell-soft);
  border-radius: 10px;
}

.sell-edit-redesign #submit-sell {
  min-width: 180px;
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(12, 102, 95, 0.22);
}

.sale-edit-header {
  background: radial-gradient(circle at 7% 12%, #daf5f0 0%, #eaf7fc 38%, #f5fbff 100%);
  border-radius: 14px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #d7e9e7;
}

@media (max-width: 767px) {
  .sale-edit-header {
    padding: 8px 10px;
    border-radius: 10px;
  }

  .sell-edit-redesign .box-solid,
  .sell-edit-redesign .box-primary {
    border-radius: 10px;
  }

  .sell-edit-redesign #submit-sell {
    width: 100%;
    min-width: 0;
  }
}

/* --- Purchase Edit Redesign (mirrors purchase-create-redesign) --- */
.purchase-edit-redesign {
  --purchase-primary: #9b5b1b;
  --purchase-secondary: #c7771f;
  --purchase-border: #ead8bf;
  --purchase-soft: #fffcf7;
}

.purchase-edit-redesign .box-primary,
.purchase-edit-redesign .box-solid {
  border: 1px solid var(--purchase-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(92, 58, 23, 0.08);
}

.purchase-edit-redesign .box-primary .box-header,
.purchase-edit-redesign .box-solid .box-header {
  background: linear-gradient(120deg, #fff4e8 0%, #fffbf5 100%);
  border-bottom: 1px solid #f1dfc8;
}

.purchase-edit-redesign .form-control,
.purchase-edit-redesign .input-group-addon,
.purchase-edit-redesign .select2-selection {
  border-color: #e8d4b8;
}

.purchase-edit-redesign .form-control:focus,
.purchase-edit-redesign .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--purchase-secondary);
  box-shadow: 0 0 0 3px rgba(199, 119, 31, 0.15);
}

.purchase-edit-redesign #purchase_entry_table thead th {
  background: #fff3e4;
  color: #6a451e;
  font-weight: 700;
  border-color: #f0e0cb;
}

.purchase-edit-redesign table,
.purchase-edit-redesign .well {
  border-color: #ecdcc7;
}

.purchase-edit-redesign .well {
  background: var(--purchase-soft);
  border-radius: 10px;
}

.purchase-edit-redesign #submit_purchase_form {
  min-width: 240px;
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(117, 74, 29, 0.2);
}

.purchase-edit-header {
  background: radial-gradient(circle at 8% 12%, #ffeccf 0%, #fff3e2 36%, #fffbf6 100%);
  border-radius: 14px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #f2debf;
}

@media (max-width: 767px) {
  .purchase-edit-header {
    padding: 8px 10px;
    border-radius: 10px;
  }

  .purchase-edit-redesign .box-primary,
  .purchase-edit-redesign .box-solid {
    border-radius: 10px;
  }

  .purchase-edit-redesign #submit_purchase_form {
    width: 100%;
    min-width: 0;
  }
}

/* --- Sell Return Add Redesign --- */
.sell-return-add-redesign {
  --sr-primary: #1e3a5f;
  --sr-secondary: #2563eb;
  --sr-border: #d1dbe8;
  --sr-soft: #f5f8fc;
}

.sell-return-add-redesign .box-solid {
  border: 1px solid var(--sr-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(30, 58, 95, 0.08);
}

.sell-return-add-redesign .box-solid .box-header {
  background: linear-gradient(120deg, #eef3fa 0%, #f6f9ff 100%);
  border-bottom: 1px solid #dde5f0;
}

.sell-return-add-redesign .form-control,
.sell-return-add-redesign .input-group-addon,
.sell-return-add-redesign .select2-selection {
  border-color: #c8d5e3;
}

.sell-return-add-redesign .form-control:focus {
  border-color: var(--sr-secondary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.sell-return-add-redesign #sell_return_table {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--sr-border);
}

.sell-return-add-redesign #sell_return_table thead th {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.1), rgba(30, 58, 95, 0.08));
  color: #1e3a5f;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.03em;
}

.sell-return-add-redesign .tw-dw-btn-primary {
  min-width: 180px;
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.22);
}

.sell-return-add-header {
  background: radial-gradient(circle at 7% 12%, #dce6f5 0%, #e8eefc 38%, #f5f8ff 100%);
  border-radius: 14px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #d1dbe8;
}

@media (max-width: 767px) {
  .sell-return-add-header {
    padding: 8px 10px;
    border-radius: 10px;
  }

  .sell-return-add-redesign .box-solid {
    border-radius: 10px;
  }

  .sell-return-add-redesign .tw-dw-btn-primary {
    width: 100%;
    min-width: 0;
  }
}

/* --- Expense Create Redesign --- */
.expense-create-redesign {
  --exp-primary: #4338ca;
  --exp-secondary: #6366f1;
  --exp-border: #d4d1ef;
  --exp-soft: #f8f7ff;
}

.expense-create-redesign .box-solid {
  border: 1px solid var(--exp-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(67, 56, 202, 0.08);
}

.expense-create-redesign .box-solid .box-header {
  background: linear-gradient(120deg, #f0eef8 0%, #f8f7ff 100%);
  border-bottom: 1px solid #ddd9ef;
}

.expense-create-redesign .form-control,
.expense-create-redesign .input-group-addon,
.expense-create-redesign .select2-selection {
  border-color: #ccc8e2;
}

.expense-create-redesign .form-control:focus,
.expense-create-redesign .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--exp-secondary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.expense-create-redesign .well {
  border: 1px solid var(--exp-border);
  background: var(--exp-soft);
  border-radius: 10px;
}

.expense-create-redesign .tw-dw-btn-primary {
  min-width: 180px;
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(67, 56, 202, 0.22);
}

.expense-create-header {
  background: radial-gradient(circle at 7% 12%, #e0ddf5 0%, #eae8fc 38%, #f5f4ff 100%);
  border-radius: 14px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #d4d1ef;
}

.expense-list-header {
  background: radial-gradient(circle at 7% 12%, #e0ddf5 0%, #eae8fc 38%, #f5f4ff 100%);
  border-radius: 14px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #d4d1ef;
}

@media (max-width: 767px) {
  .expense-create-header,
  .expense-list-header {
    padding: 8px 10px;
    border-radius: 10px;
  }

  .expense-create-redesign .box-solid {
    border-radius: 10px;
  }

  .expense-create-redesign .tw-dw-btn-primary {
    width: 100%;
    min-width: 0;
  }
}

/* --- Payment Modal Polish --- */
.payment-modal-polished .well {
  border-radius: 12px;
  background: #f8fafb;
  border-color: #e2e8f0;
}

.payment-modal-polished .modal-header {
  border-bottom-color: #e2e8f0;
  background: linear-gradient(180deg, #fafcfd 0%, #f5f7f9 100%);
}

.payment-modal-polished .modal-footer {
  border-top-color: #e2e8f0;
  background: #fafcfd;
}

.payment-modal-polished .modal-content {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
}

.payment-modal-polished .form-control,
.payment-modal-polished .input-group-addon,
.payment-modal-polished .select2-selection {
  border-color: #dde3ea;
}

.payment-modal-polished .form-control:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

