.modal-backdrop {
  z-index: 1600;
}

.modal {
  z-index: 1610;
  padding: 0 !important;
}

.modal-backdrop.show,
.modal-backdrop.in {
  opacity: 0.62;
}

body.modal-open {
  overflow: hidden;
  padding-right: 0 !important;
}

.modal-open .modal {
  overflow-x: hidden;
  overflow-y: auto;
}

.modal-dialog,
.modal-dialog-centered {
  margin: 2.25rem auto;
  max-height: calc(100vh - 4.5rem);
  width: calc(100% - 2rem);
  max-width: min(860px, calc(100% - 2rem));
  display: flex;
  align-items: flex-start;
}

.modal-content {
  width: 100%;
  border-radius: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #0d1023;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.45);
  max-height: calc(100vh - 4.5rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header,
.modal-footer {
  border-color: rgba(255, 255, 255, 0.12);
}

.modal-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-xl,
.modal-lg {
  max-width: min(1040px, calc(100% - 2rem));
}

.modal-sm {
  max-width: min(420px, calc(100% - 2rem));
}

.modal-dialog-scrollable {
  max-height: calc(100vh - 4.5rem);
}

.modal-dialog-scrollable .modal-content {
  max-height: calc(100vh - 4.5rem);
}

.modal-dialog-scrollable .modal-body {
  overflow-y: auto;
}

.modal-wrapper {
  z-index: 1;
}

.modal-wrapper .modal {
  z-index: 1700;
}

.modal-wrapper .modal-backdrop {
  z-index: 1690;
}

.ts-modal-stack .modal {
  z-index: 1800;
}

.ts-modal-stack .modal-backdrop {
  z-index: 1790;
}

.ts-table-shell {
  border-radius: 1rem;
  border: 1px solid var(--ts-border);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.ts-table-shell__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--ts-border);
}

.ts-table-shell__title {
  margin: 0;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ts-muted);
}

.ts-table-shell__meta {
  margin: 0.25rem 0 0;
  font-size: 0.76rem;
  color: rgba(229, 232, 255, 0.65);
}

.ts-table-shell__toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ts-table-shell__body {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ts-table-shell .table {
  margin-bottom: 0;
  min-width: 680px;
}

.ts-table-shell .table thead th {
  background: rgba(255, 255, 255, 0.03);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  color: var(--ts-muted);
}

.ts-table-shell .table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.01);
}

.ts-table-shell .table tbody tr:hover {
  background: rgba(125, 91, 255, 0.09);
}

.ts-table-shell--compact .table {
  min-width: 560px;
}

.ts-table-shell--static .ts-table-shell__body {
  overflow-x: visible;
}

.ts-table-shell--responsive .table {
  min-width: 760px;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  color: var(--ts-muted);
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--ts-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ts-text);
  padding: 0.35rem 0.85rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 999px;
  border: 1px solid var(--ts-border) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--ts-text) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: rgba(125, 91, 255, 0.25) !important;
  border-color: rgba(125, 91, 255, 0.45) !important;
}

/* DT toolbar buttons — override btn-secondary to restore colorful backgrounds */
.dt-buttons .btn {
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-weight: 600;
  font-size: 0.82rem;
  border: 0 !important;
  color: #fff !important;
}

.dt-buttons .buttons-pdf {
  background: #ff5c88 !important;
}

.dt-buttons .buttons-csv {
  background: #ff9f43 !important;
}

.dt-buttons .buttons-print {
  background: #2196f3 !important;
}

.dt-buttons .buttons-delete {
  background: #dc3545 !important;
}

.dt-buttons .buttons-collection {
  background: rgba(125, 91, 255, 0.65) !important;
}

/* DT Column Visibility dropdown panel */
ul.dt-button-collection.dropdown-menu {
  position: fixed !important;
  background: #0f1632 !important;
  border: 1px solid var(--ts-border) !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.5) !important;
  padding: 0.5rem 0 !important;
  z-index: 2100 !important;
  max-height: 360px;
  overflow-y: auto;
}

ul.dt-button-collection.dropdown-menu li {
  padding: 0;
  background: transparent !important;
}

body.ts-theme .dt-button-collection.dropdown-menu a,
ul.dt-button-collection.dropdown-menu li a.dt-button,
ul.dt-button-collection.dropdown-menu li a.dropdown-item {
  color: var(--ts-text) !important;
  background: transparent !important;
  padding: 0.45rem 1rem !important;
  font-size: 0.85rem;
  border: 0 !important;
  border-radius: 0 !important;
  white-space: nowrap;
  display: block;
  text-decoration: none;
}

body.ts-theme .dt-button-collection.dropdown-menu a:hover,
body.ts-theme .dt-button-collection.dropdown-menu a:focus,
ul.dt-button-collection.dropdown-menu li a.dt-button:hover,
ul.dt-button-collection.dropdown-menu li a.dropdown-item:hover,
ul.dt-button-collection.dropdown-menu li a.dt-button:focus,
ul.dt-button-collection.dropdown-menu li a.dropdown-item:focus {
  background: rgba(125, 91, 255, 0.2) !important;
  color: #fff !important;
}

body.ts-theme .dt-button-collection.dropdown-menu a.active,
ul.dt-button-collection.dropdown-menu li a.dt-button.active,
ul.dt-button-collection.dropdown-menu li a.dropdown-item.active {
  background: rgba(125, 91, 255, 0.35) !important;
  color: #fff !important;
}

/* DT backdrop behind collection dropdown */
div.dt-button-background {
  background: rgba(0, 0, 0, 0.3) !important;
  z-index: 2050 !important;
}

/* DT layout fixes — override Bootstrap grid & float-based layout */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dt-buttons {
  float: none !important;
  width: auto !important;
  max-width: none !important;
  flex: none !important;
  text-align: left !important;
}

.dataTables_wrapper .row:first-child {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dataTables_wrapper .row:first-child > [class*="col"] {
  flex: none !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
}

/* Length control (records per page) */
.dataTables_wrapper .dataTables_length {
  white-space: nowrap;
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
}

.dataTables_wrapper .dataTables_length label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  white-space: nowrap;
}

.dataTables_wrapper .dataTables_length select {
  width: auto !important;
  min-width: 60px;
  display: inline-block;
}

/* Filter / Search control */
.dataTables_wrapper .dataTables_filter {
  white-space: nowrap;
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
}

.dataTables_wrapper .dataTables_filter label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  white-space: nowrap;
}

.dataTables_wrapper .dataTables_filter input {
  min-width: 160px;
  width: auto !important;
  display: inline-block;
}

/* DT export buttons push right */
.dataTables_wrapper .dt-buttons {
  margin-left: auto !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Bottom row (info + pagination) */
.dataTables_wrapper .row:last-child {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dataTables_wrapper .row:last-child > [class*="col"] {
  flex: none !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
}

/* Table base fixes */
.table thead th {
  background: rgba(255, 255, 255, 0.04) !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ts-muted) !important;
  white-space: nowrap;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08) !important;
}

.table tbody td {
  vertical-align: middle;
  color: var(--ts-text);
}

/* Footer overlap fix: override base theme's absolute footer */
footer.main-footer {
  position: static !important;
  width: 100% !important;
}

/* Ensure date/time pickers render above modals */
.daterangepicker,
.ui-timepicker-container,
.ui-datepicker,
.datepicker,
.bootstrap-datetimepicker-widget {
  z-index: 2100 !important; /* higher than .modal (1610–1800 stack) */
}

/* Ensure room for footer across pages */
.page.ts-page {
  padding-bottom: 3rem;
}

.table tbody tr:hover {
  background: rgba(125, 91, 255, 0.06);
}

.table tfoot td,
.table tfoot th {
  border-top: 2px solid rgba(255, 255, 255, 0.08) !important;
  font-weight: 600;
  color: var(--ts-text);
}

.dropdown-menu {
  background: #0f1632;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
}

.dropdown-item {
  color: var(--ts-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(125, 91, 255, 0.25);
  color: #fff;
}

/* Make selectpicker + input-group append align nicely */
.input-group > .bootstrap-select:not(.bs-container) {
  flex: 1 1 auto;
  width: 1% !important; /* keep on one line like .form-control */
}
.input-group > .bootstrap-select:not(.bs-container) > .dropdown-toggle {
  width: 100% !important;
}
/* Seamless corners between select and addon */
.input-group > .bootstrap-select:not(:last-child) > .dropdown-toggle {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group .ts-input-addon {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.ts-input-addon {
  padding: 0.375rem 0.6rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ─── Dropzone beautify ─────────────────────────────────────────────── */
#imageUpload.dropzone {
  border: 2px dashed var(--ts-border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 1rem;
  min-height: 170px;
  padding: 1rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
#imageUpload.dropzone.dz-drag-hover {
  border-color: rgba(125, 91, 255, 0.6);
  background: rgba(125, 91, 255, 0.08);
}
#imageUpload .dz-message {
  margin: 0;
}
#imageUpload .ts-dz-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--ts-muted);
  font-weight: 600;
}
#imageUpload .ts-dz-message i {
  font-size: 28px;
  color: rgba(229, 232, 255, 0.6);
}
#imageUpload.dz-started .dz-message { display: none; }

#imageUpload .dz-preview {
  position: relative;
  display: inline-block;
  margin: 0.5rem;
}
#imageUpload .dz-image {
  width: 120px;
  height: 120px;
  border-radius: 0.85rem;
  overflow: hidden;
}
#imageUpload .dz-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#imageUpload .dz-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff !important;
  border: 0;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  line-height: 22px;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
}
#imageUpload .dz-progress,
#imageUpload .dz-details { display: none; }

/* ─── DataTable layout fixes for product list ───────────────────────── */
.ts-table-fix {
  overflow-x: auto;
  overflow-y: visible; /* let dropdowns render outside table */
}
#product-data-table {
  width: 100% !important;
}
/* Keep row action dropdowns above scroll areas */
.ts-table-fix .dropdown-menu {
  z-index: 2050;
}

@media (max-width: 991px) {
  .modal-dialog,
  .modal-dialog-centered,
  .modal-xl,
  .modal-lg,
  .modal-sm {
    width: calc(100% - 1.5rem);
    max-width: calc(100% - 1.5rem);
    margin: 1.25rem auto;
  }

  .modal-content,
  .modal-dialog-scrollable,
  .modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 2.5rem);
  }
}

@media (max-width: 767px) {
  .ts-table-shell {
    border-radius: 0.85rem;
  }

  .ts-table-shell__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ts-table-shell__toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .ts-table-shell .table,
  .ts-table-shell--compact .table,
  .ts-table-shell--responsive .table {
    min-width: 620px;
  }

  .table-responsive {
    border: 0;
  }

  .modal-dialog,
  .modal-dialog-centered,
  .modal-xl,
  .modal-lg,
  .modal-sm {
    width: calc(100% - 1rem);
    max-width: calc(100% - 1rem);
    margin: 0.5rem auto;
  }

  .modal-content,
  .modal-dialog-scrollable,
  .modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 1rem);
    border-radius: 0.9rem;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
 }

@media (max-height: 700px) {
  .modal-dialog,
  .modal-dialog-centered,
  .modal-xl,
  .modal-lg,
  .modal-sm {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .modal-content,
  .modal-dialog-scrollable,
  .modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 1rem);
  }
}

/* ══════════════════════════════════════════════════
   Dark-theme overrides for legacy light elements
   ══════════════════════════════════════════════════ */

/* --- Dashboard --- */
.dashboard-header {
  background: transparent !important;
}

.dashboard-header .card {
  background: rgba(255, 255, 255, 0.02) !important;
}

.dashboard-counts,
.dashboard-counts strong,
.dashboard-counts span {
  color: var(--ts-text) !important;
}

.statistics .income .number,
.statistics .user-activity .number,
.statistics strong {
  color: var(--ts-text) !important;
}

.updates strong,
.updates a,
.updates a:hover,
.updates a:focus {
  color: var(--ts-text) !important;
}

/* --- Breadcrumb --- */
.breadcrumb-holder {
  background: transparent !important;
  border-bottom: 1px solid var(--ts-border);
}

.breadcrumb {
  background: transparent;
}

.breadcrumb-item,
.breadcrumb-item a {
  color: var(--ts-muted);
}

.breadcrumb-item.active {
  color: var(--ts-text);
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--ts-muted);
}

/* --- Input group addons --- */
.input-group-text {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--ts-muted) !important;
  border-color: var(--ts-border) !important;
}

/* --- Tabs --- */
.nav-tabs {
  border-bottom-color: var(--ts-border);
}

.nav-tabs .nav-link {
  color: var(--ts-muted);
  border-color: transparent;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
  border-color: var(--ts-border) var(--ts-border) transparent;
  color: var(--ts-text);
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--ts-text) !important;
  border-color: var(--ts-border) var(--ts-border) transparent !important;
}

/* --- Pagination (non-DataTables) --- */
.page-link {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--ts-border);
  color: var(--ts-text);
}

.page-link:hover {
  background: rgba(125, 91, 255, 0.18);
  border-color: rgba(125, 91, 255, 0.35);
  color: #fff;
}

.page-item.active .page-link {
  background: var(--ts-primary);
  border-color: var(--ts-primary);
  color: #fff;
}

.page-item.disabled .page-link {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: var(--ts-border);
  color: var(--ts-muted);
}

/* --- Alerts --- */
.alert {
  border-radius: 0.85rem;
  border: 1px solid;
}

.alert-success {
  background: rgba(50, 213, 131, 0.12);
  border-color: rgba(50, 213, 131, 0.25);
  color: #6cf2a9;
}

.alert-danger {
  background: rgba(255, 92, 136, 0.12);
  border-color: rgba(255, 92, 136, 0.25);
  color: #ff9db9;
}

.alert-warning {
  background: rgba(255, 175, 64, 0.12);
  border-color: rgba(255, 175, 64, 0.25);
  color: #ffba76;
}

.alert-info {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.25);
  color: #5ef0d8;
}

/* --- Badges --- */
.badge-primary { background: var(--ts-primary); color: #fff; }
.badge-success { background: var(--ts-success); color: #fff; }
.badge-danger { background: var(--ts-danger); color: #fff; }
.badge-warning { background: var(--ts-accent); color: #1b1b1b; }
.badge-info { background: #14b8a6; color: #fff; }
.badge-secondary { background: rgba(255, 255, 255, 0.12); color: var(--ts-text); }
.badge-dark { background: rgba(255, 255, 255, 0.08); color: var(--ts-text); }

/* --- Custom selects --- */
.custom-select {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: var(--ts-border);
  color: var(--ts-text);
}

select option {
  background: #0d1023;
  color: var(--ts-text);
}

/* --- Select2 --- */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--ts-border);
  color: var(--ts-text);
  border-radius: 0.85rem;


/* Header / logo responsiveness (Phase 0 foundation) */
.ts-toolbar-brand img.ts-logo-mark,
.ts-auth-logo img.ts-logo-mark,
.ts-brand-icon img,
.ts-brand-panel img {
  max-height: 56px;
  width: auto;
  height: auto;
  display: block;
}

@media (max-width: 575.98px) {
  .ts-toolbar-brand img.ts-logo-mark,
  .ts-auth-logo img.ts-logo-mark {
    max-height: 42px;
  }
  .ts-brand-copy { display: none; }
}

/* Phase 1 - POS page responsive overrides (safe, non-invasive)
   - Neutralize small helper fixed-width utility
   - Make POS two-column stack at small screens
   - Reduce fixed-size toasts/badges for mobile
*/
.ts-w-100px {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

.lot-badge, .lot-badge-container .lot-badge, .lot-badge-container .badge {
  font-size: .65rem !important;
  white-space: normal !important;
  display: inline-block !important;
  margin-bottom: 2px !important;
}

@media (max-width: 575.98px) {
  /* Stack the POS columns on small screens */
  .pos-section .col-md-6,
  .forms .col-md-6 {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  /* Override fixed-width inline toasts inserted by POS JS templates */
  .alert[style*="position:fixed"] {
    min-width: 0 !important;
    max-width: 92% !important;
    left: 4% !important;
    right: 4% !important;
    top: 10px !important;
    font-size: 0.95rem !important;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08) !important;
  }
}
/* ─── Global Responsiveness Foundation ───────────────────────── */
:root {
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
}

/* Responsive media defaults (applies across content areas)
   Use `img-fluid` class in templates where possible. */
.content img,
img,
figure img,
.table img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Make embeds and media fluid */
iframe,
video,
embed,
object {
  max-width: 100%;
  height: auto;
}

/* Table responsiveness helpers */
.table-responsive,
.ts-table-shell__body,
.ts-table-shell .table,
.ts-table-shell--responsive .table {
  width: 100%;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Lightweight responsive image helper */
.img-fluid {
  max-width: 100%;
  height: auto;
}

/* Try to mitigate common inline fixed-width anti-patterns without
   changing markup: clamp excessive min-width/width inline styles */
[style*="min-width:"] {
  max-width: 100% !important;
}

/* Small-screen table min-width fallback to avoid extreme horizontal scroll */
@media (max-width: 575.98px) {
  .ts-table-shell .table,
  .ts-table-shell--compact .table,
  .ts-table-shell--responsive .table {
    min-width: 480px;
  }
}
  min-height: 38px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--ts-text);
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--ts-muted);
}

.select2-dropdown {
  background: #0f1632;
  border-color: var(--ts-border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--ts-border);
  color: var(--ts-text);
}

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

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: rgba(125, 91, 255, 0.25);
  color: #fff;
}

.select2-container--default .select2-results__option[aria-selected=true] {
  background: rgba(125, 91, 255, 0.15);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: rgba(125, 91, 255, 0.2);
  border-color: rgba(125, 91, 255, 0.4);
  color: var(--ts-text);
  border-radius: 999px;
}

/* --- Bootstrap-select --- */
.bootstrap-select .dropdown-toggle {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--ts-border) !important;
  color: var(--ts-text) !important;
}

.bootstrap-select .dropdown-menu.inner {
  background: #0f1632;
}

.bootstrap-select .dropdown-menu li a {
  color: var(--ts-text);
}

.bootstrap-select .dropdown-menu li a:hover,
.bootstrap-select .dropdown-menu li.selected a {
  background: rgba(125, 91, 255, 0.25);
  color: #fff;
}

/* --- Daterangepicker --- */
.daterangepicker {
  background: #0f1632;
  border-color: var(--ts-border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  color: var(--ts-text);
}

.daterangepicker .calendar-table {
  background: transparent;
  border-color: var(--ts-border);
}

.daterangepicker td,
.daterangepicker th {
  color: var(--ts-text);
}

.daterangepicker td.off {
  color: var(--ts-muted);
}

.daterangepicker td.active,
.daterangepicker td.active:hover {
  background: var(--ts-primary) !important;
  color: #fff !important;
}

.daterangepicker td.in-range {
  background: rgba(125, 91, 255, 0.15);
  color: var(--ts-text);
}

.daterangepicker td:hover {
  background: rgba(125, 91, 255, 0.25);
  color: #fff;
}

.daterangepicker .drp-buttons {
  border-top-color: var(--ts-border);
}

.daterangepicker select.monthselect,
.daterangepicker select.yearselect {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--ts-border);
  color: var(--ts-text);
}

/* --- Summernote --- */
.note-editor.note-frame {
  border-color: var(--ts-border);
}

.note-editor .note-toolbar {
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: var(--ts-border);
}

.note-editor .note-toolbar .btn {
  color: var(--ts-text) !important;
  background: transparent;
}

.note-editor .note-toolbar .btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.note-editor .note-editing-area .note-editable {
  background: rgba(255, 255, 255, 0.02);
  color: var(--ts-text);
}

.note-editor .note-statusbar {
  background: rgba(255, 255, 255, 0.02);
  border-top-color: var(--ts-border);
}

/* ═══════════════════════════════════════════════════════════════
   Enhanced User Profile Dropdown Menu
   ═══════════════════════════════════════════════════════════════ */

.ts-user-menu-trigger {
  position: relative;
  transition: all 0.3s ease;
}

.ts-user-menu-trigger:hover {
  opacity: 0.8;
}

.ts-user-dropdown-menu {
  min-width: 280px !important;
  border: 1px solid rgba(125, 91, 255, 0.3) !important;
  border-radius: 0.95rem !important;
  background: linear-gradient(135deg, #0f1632 0%, #0d1023 100%) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(125, 91, 255, 0.1) !important;
  padding: 0.75rem 0 !important;
  backdrop-filter: blur(10px);
}

.ts-user-dropdown-menu .ts-dropdown-header {
  padding: 1rem !important;
  background: rgba(125, 91, 255, 0.08);
  border-bottom: 1px solid rgba(125, 91, 255, 0.15);
  border-radius: 0.85rem 0.85rem 0 0;
  margin-bottom: 0.5rem;
}

.ts-user-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ts-user-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(125, 91, 255, 0.3), rgba(125, 91, 255, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: rgba(125, 91, 255, 0.9);
  flex-shrink: 0;
}

.ts-user-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.ts-user-fullname {
  display: block;
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-user-email {
  display: block;
  font-size: 0.75rem;
  color: rgba(229, 232, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-dropdown-divider {
  height: 1px;
  background: rgba(125, 91, 255, 0.2);
  margin: 0.5rem 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.ts-dropdown-item {
  padding: 0 !important;
  margin: 0 0.5rem !important;
  list-style: none;
}

.ts-dropdown-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem !important;
  color: rgba(229, 232, 255, 0.85) !important;
  text-decoration: none !important;
  border-radius: 0.65rem;
  transition: all 0.25s ease;
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
}

.ts-dropdown-item a i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  font-size: 0.95rem;
  color: rgba(125, 91, 255, 0.8);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.ts-dropdown-item a span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-dropdown-item a:hover {
  background: rgba(125, 91, 255, 0.18) !important;
  color: #fff !important;
}

.ts-dropdown-item a:hover i {
  color: rgba(125, 91, 255, 1);
  transform: translateX(2px);
}

.ts-dropdown-logout a {
  color: rgba(255, 92, 136, 0.85) !important;
}

.ts-dropdown-logout a i {
  color: rgba(255, 92, 136, 0.7) !important;
}

.ts-dropdown-logout a:hover {
  background: rgba(255, 92, 136, 0.12) !important;
  color: #ff9db9 !important;
}

.ts-dropdown-logout a:hover i {
  color: #ff5c88 !important;
}

/* Animation when menu appears */
.ts-user-dropdown-menu {
  animation: ts-dropdown-fadeIn 0.25s ease-out;
}

@keyframes ts-dropdown-fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═════════════════════════════════════════════════════════════════════
   Phase 2 - Medium-Risk Pages: Image & Grid Responsiveness
   ═════════════════════════════════════════════════════════════════════ */

/* Make table images responsive despite fixed height/width attributes */
table img[height][width],
.table img[height][width],
.biller-image img[height][width],
tbody img[height][width] {
  max-width: 100% !important;
  height: auto !important;
  width: auto !important;
  display: block;
}

/* Stack modal/form grid columns on mobile without changing blade markup */
@media (max-width: 767.98px) {
  .col-md-6 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Ensure modals remain stacked */
  .modal-body .col-md-6 {
    margin-bottom: 0.5rem;
  }

  /* Adjust form layouts for small screens */
  .form-group {
    margin-bottom: 0.875rem;
  }

  /* Make selects full-width on mobile */
  .form-control[class*="col-"],
  .bootstrap-select[class*="col-"] {
    width: 100% !important;
  }
}

/* Reduce excessive table column width requirements on mobile */
@media (max-width: 575.98px) {
  .table thead,
  .table tbody,
  .table th,
  .table td {
    display: block;
    width: 100%;
  }

  /* Alternative: keep table structure but enable horizontal scroll */
  .table-responsive .table {
    min-width: 550px;
  }

  /* Responsive image sizing for list pages */
  table img,
  .table img {
    max-height: 60px;
    max-width: 60px;
    width: auto;
    height: auto;
  }
}

/* ═════════════════════════════════════════════════════════════════════
   Phase 3 - Low-Risk Pages: Grid & Image Responsiveness
   ═════════════════════════════════════════════════════════════════════ */

/* Make fixed-size images fluid outside tables (e.g., cards, forms) */
img[height][width]:not(.ts-no-resize) {
  max-width: 100% !important;
  height: auto !important;
  width: auto !important;
}

/* Stack common grid columns for low-risk forms and reports */
@media (max-width: 767.98px) {
  .col-md-3,
  .col-md-4,
  .col-md-5,
  .col-md-7,
  .col-md-8,
  .col-md-9 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .form-inline .form-group,
  .form-inline .input-group {
    width: 100% !important;
  }

  .form-inline .form-group + .form-group {
    margin-top: 0.5rem;
  }
}

/* Allow long action toolbars to wrap on smaller screens */
@media (max-width: 575.98px) {
  .btn-group,
  .input-group,
  .form-inline {
    flex-wrap: wrap;
  }
}
