/* ═══════════════════════════════════════════════════════════════
   BiswasHost Client Portal — Design Enhancement v2.0
   Drop-in CSS override — paste into Blesta Theme > Custom CSS
   or save as custom-enhancements.css and link in structure.pdt
   ═══════════════════════════════════════════════════════════════ */

/* ── 0. CSS Variables (easy to tweak) ────────────────────────── */
:root {
  --bh-primary: #0d6efd;
  --bh-primary-soft: #e8f0fe;
  --bh-accent: #0a58ca;
  --bh-success: #198754;
  --bh-success-soft: #d1f5e0;
  --bh-danger: #dc3545;
  --bh-danger-soft: #fce4e6;
  --bh-warning: #ffc107;
  --bh-warning-soft: #fff8e1;
  --bh-text: #1e293b;
  --bh-text-muted: #64748b;
  --bh-bg: #f0f2f5;
  --bh-card-bg: #ffffff;
  --bh-border: #e2e8f0;
  --bh-radius: 10px;
  --bh-radius-sm: 6px;
  --bh-shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --bh-shadow: 0 4px 16px rgba(15, 23, 42, .07), 0 1px 3px rgba(15, 23, 42, .05);
  --bh-shadow-lg: 0 10px 40px rgba(15, 23, 42, .1), 0 2px 6px rgba(15, 23, 42, .04);
  --bh-transition: .2s cubic-bezier(.4, 0, .2, 1);
}

/* ── 1. Base Body & Typography ───────────────────────────────── */
body {
  background-color: var(--bh-bg) !important;
  color: var(--bh-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ── 2. Main Content Area ────────────────────────────────────── */
.container-md {
  padding-top: 28px !important;
  padding-bottom: 20px !important;
}

.main {
  min-height: calc(100vh - 320px);
}

/* ── 3. Card System — Unified Elevated Cards ─────────────────── */
.card,
.card-blesta,
.panel-blesta {
  background: var(--bh-card-bg);
  border: 1px solid var(--bh-border);
  border-radius: var(--bh-radius) !important;
  box-shadow: var(--bh-shadow-sm);
  transition: box-shadow var(--bh-transition);
}

.card:hover,
.card-blesta:hover {
  box-shadow: var(--bh-shadow);
}

.card-header,
.card-blesta > .card-header {
  font-weight: 600;
  font-size: .875rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bh-border);
  border-radius: var(--bh-radius) var(--bh-radius) 0 0 !important;
}

.card-body {
  padding: 18px;
}

.card-footer {
  padding: 12px 18px;
  background: #fafbfc;
  border-top: 1px solid var(--bh-border);
}

/* ── 4. Sidebar (My Info Panel) ──────────────────────────────── */
#my-info .card-blesta {
  margin-bottom: 16px;
}

#my-info address {
  font-size: .9rem;
  line-height: 1.7;
  color: var(--bh-text-muted);
  margin-bottom: 0;
}

#my-info address strong {
  color: var(--bh-text);
  font-size: .95rem;
}

#my-info address hr {
  margin: 10px 0;
  border-color: var(--bh-border);
}

#my-info address a {
  word-break: break-all;
}

/* Sidebar settings list */
.list-group.list-options .list-group-item {
  border: 1px solid var(--bh-border);
  border-radius: var(--bh-radius-sm) !important;
  margin-bottom: 8px;
  padding: 12px 14px;
  font-size: .875rem;
  transition: all var(--bh-transition);
}

.list-group.list-options .list-group-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--bh-shadow-sm);
}

/* Currency amounts card */
.list-group.list-options .credits {
  background: var(--bh-primary-soft) !important;
  border-color: rgba(13, 110, 253, .15) !important;
  font-weight: 500;
}

.list-group.list-options .credits .currency_value {
  font-weight: 700;
  font-size: 1.05em;
}

/* ── 5. Dashboard Stat Cards ─────────────────────────────────── */
.right_content .cards .card {
  border-radius: var(--bh-radius) !important;
  border: none;
  box-shadow: var(--bh-shadow);
  transition: all .25s ease;
  overflow: hidden;
  position: relative;
}

.right_content .cards .card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--bh-primary), var(--bh-accent));
  opacity: 0;
  transition: opacity var(--bh-transition);
}

.right_content .cards .card:hover {
  transform: translateY(-3px);
  box-shadow: var(--bh-shadow-lg);
}

.right_content .cards .card:hover::after {
  opacity: 1;
}

.right_content .cards .card .card-content {
  padding: 20px;
}

.right_content .cards .card .card-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.right_content .cards .card .card-label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .75;
  margin-top: 4px;
  font-weight: 500;
}

/* ── 6. Tables — Clean & Readable ────────────────────────────── */
.table {
  font-size: .9rem;
}

.table thead th {
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--bh-text-muted);
  border-bottom: 2px solid var(--bh-border);
  padding: 12px 14px;
  white-space: nowrap;
}

.table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--bh-border);
  color: var(--bh-text);
}

.table-striped-alt tbody tr:nth-child(4n+1),
.table-striped-alt tbody tr:nth-child(4n+2) {
  background-color: transparent;
}

.table-striped-alt tbody tr:nth-child(4n+3),
.table-striped-alt tbody tr:nth-child(4n+4) {
  background-color: #f8fafc;
}

.table-hover tbody tr:hover td {
  background-color: var(--bh-primary-soft) !important;
}

/* Expandable row indicator */
.table tr.expand {
  cursor: pointer;
}

.table tr.expand:hover td:first-child {
  position: relative;
}

.table tr.expand:hover td:first-child::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--bh-primary);
  border-radius: 0 2px 2px 0;
}

/* ── 7. Buttons — Refined & Consistent ───────────────────────── */
.btn {
  font-weight: 500;
  font-size: .875rem;
  border-radius: var(--bh-radius-sm) !important;
  transition: all var(--bh-transition);
  letter-spacing: .01em;
  line-height: 1.5;
}

.btn:active {
  transform: scale(.97);
}

.btn-light {
  border: 1px solid var(--bh-border) !important;
}

.btn-light:hover {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

.btn-xs {
  padding: 5px 12px !important;
  font-size: .8rem;
}

.btn-sm {
  padding: 6px 14px !important;
}

.btn-block {
  border-radius: var(--bh-radius-sm) !important;
}

/* Service manage action buttons */
.service-info + div .btn-med,
.btn-med {
  padding: 10px 16px !important;
  font-size: .85rem;
  border-radius: var(--bh-radius-sm) !important;
}

/* ── 8. Widget Headers (WidgetClient) ────────────────────────── */
.content_section .widget_header,
.widget_content_section > div:first-child {
  border-radius: var(--bh-radius) var(--bh-radius) 0 0;
}

/* Widget tabs */
.nav-link {
  font-size: .875rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--bh-radius-sm) var(--bh-radius-sm) 0 0 !important;
  transition: all var(--bh-transition);
}

/* ── 9. Alerts — Soft & Readable ─────────────────────────────── */
.alert {
  border-radius: var(--bh-radius-sm);
  border-left-width: 4px;
  font-size: .9rem;
  padding: 14px 18px;
}

.alert-success {
  background-color: var(--bh-success-soft) !important;
  border-color: var(--bh-success) !important;
  color: #065f46 !important;
}

.alert-danger {
  background-color: var(--bh-danger-soft) !important;
  border-color: var(--bh-danger) !important;
  color: #991b1b !important;
}

.alert-warning {
  background-color: var(--bh-warning-soft) !important;
  border-color: var(--bh-warning) !important;
  color: #92400e !important;
}

.alert-info {
  background-color: var(--bh-primary-soft) !important;
  border-color: var(--bh-primary) !important;
  color: #1e40af !important;
}

/* ── 10. Forms — Polished Inputs ─────────────────────────────── */
.form-control {
  border: 1.5px solid var(--bh-border);
  border-radius: var(--bh-radius-sm) !important;
  padding: 8px 14px;
  font-size: .9rem !important;
  transition: border-color var(--bh-transition), box-shadow var(--bh-transition);
  color: var(--bh-text) !important;
  background-color: #fff;
}

.form-control:focus {
  border-color: var(--bh-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, .12);
  outline: none;
}

.form-control::placeholder {
  color: #94a3b8;
}

label {
  font-weight: 500;
  font-size: .875rem !important;
  color: var(--bh-text-muted);
  margin-bottom: 4px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 34px;
}

/* ── 11. Badges — Status Indicators ──────────────────────────── */
.badge {
  font-weight: 600;
  font-size: .75rem;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: .03em;
}

.badge-success {
  background-color: var(--bh-success-soft) !important;
  color: #065f46 !important;
}

.badge-danger {
  background-color: var(--bh-danger-soft) !important;
  color: #991b1b !important;
}

.badge-warning {
  background-color: var(--bh-warning-soft) !important;
  color: #92400e !important;
}

.badge-info {
  background-color: var(--bh-primary-soft) !important;
  color: #1e40af !important;
}

/* ── 12. Invoice View — Professional Layout ──────────────────── */
.col-md-12 .card h4 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--bh-text-muted);
  margin-bottom: 8px;
}

/* ── 13. Service Info Box — Cleaner Grid ─────────────────────── */
.panel-pad {
  padding: 20px;
}

.panel-pad .service-info label {
  font-size: .75rem !important;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--bh-text-muted);
  margin-bottom: 2px;
  display: block;
}

.panel-pad .service-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bh-text);
  margin-bottom: 14px;
  margin-top: 0;
}

.col-border {
  border-right: 1px solid var(--bh-border);
}

/* ── 14. Left Sidebar Navigation ─────────────────────────────── */
.col-md-3 .list-group .list-group-item-action {
  border-radius: 0;
  border-left: 3px solid transparent;
  font-size: .875rem;
  font-weight: 500;
  padding: 10px 16px;
  color: var(--bh-text-muted);
  transition: all var(--bh-transition);
}

.col-md-3 .list-group .list-group-item-action:hover {
  background-color: var(--bh-primary-soft) !important;
  color: var(--bh-primary);
  border-left-color: var(--bh-primary);
}

.col-md-3 .list-group .list-group-item-action.active {
  background-color: var(--bh-primary-soft) !important;
  color: var(--bh-primary) !important;
  border-left-color: var(--bh-primary) !important;
  font-weight: 600;
}

.col-md-3 .list-group .list-group-item-action i {
  width: 20px;
  text-align: center;
  margin-right: 6px;
}

/* ── 15. Secondary Content Area ──────────────────────────────── */
.col-md-3 {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* ── 16. Dropdown Menus ──────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--bh-border);
  border-radius: var(--bh-radius-sm);
  box-shadow: var(--bh-shadow-lg);
  padding: 6px;
  animation: dropdownFadeIn .15s ease;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item,
.dropdown-menu a,
.dropdown-menu li a {
  border-radius: var(--bh-radius-sm);
  padding: 8px 12px;
  font-size: .875rem;
  color: var(--bh-text);
  transition: background var(--bh-transition);
}

.dropdown-item:hover,
.dropdown-menu a:hover,
.dropdown-menu li a:hover {
  background-color: var(--bh-primary-soft);
  color: var(--bh-primary) !important;
}

/* ── 17. Pagination ──────────────────────────────────────────── */
.pagination {
  gap: 4px;
}

.pagination .page-link {
  border-radius: var(--bh-radius-sm) !important;
  border: 1px solid var(--bh-border);
  font-size: .85rem;
  font-weight: 500;
  padding: 6px 12px;
  min-width: 36px;
  text-align: center;
  transition: all var(--bh-transition);
}

.pagination .page-item.active .page-link {
  box-shadow: 0 2px 6px rgba(13, 110, 253, .25);
}

/* ── 18. Modal Improvements ──────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--bh-radius) !important;
  box-shadow: var(--bh-shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--bh-border);
  padding: 16px 20px;
}

.modal-header h5,
.modal-header .global_modal_title {
  font-weight: 600;
  font-size: 1.05rem;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  border-top: 1px solid var(--bh-border);
  padding: 12px 20px;
}

/* ── 19. Tooltip Override ────────────────────────────────────── */
.tooltip-inner {
  font-size: .8rem;
  padding: 6px 10px;
  border-radius: var(--bh-radius-sm);
  max-width: 260px;
}

/* ── 20. Empty State — Friendly ──────────────────────────────── */
.alert-info p:only-child {
  margin-bottom: 0;
}

/* ── 21. Scroll-to-Top Button ────────────────────────────────── */
.scroll-top {
  border-radius: 50% !important;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--bh-shadow);
  transition: all .25s ease;
}

.scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--bh-shadow-lg);
}

/* ── 22. Login Page Enhancements ─────────────────────────────── */
.row.login .panel-blesta {
  box-shadow: var(--bh-shadow-lg);
  border-radius: var(--bh-radius) !important;
  border: none;
}

.row.login .panel-blesta .form-control {
  padding: 10px 14px;
}

.row.login .panel-blesta .btn-success {
  padding: 10px 20px !important;
  font-size: .95rem;
  font-weight: 600;
}

/* ── 23. Print Styles (Invoice PDF) ──────────────────────────── */
@media print {
  .main-header-menu-wrap,
  #header-top-bar,
  .scroll-top,
  footer,
  .footer-bottom {
    display: none !important;
  }

  body {
    background: #fff !important;
  }

  .card, .card-blesta {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* ── 24. Responsive Tweaks ───────────────────────────────────── */
@media (max-width: 767.98px) {
  .container-md {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .table thead th {
    font-size: .73rem;
    padding: 8px 10px;
  }

  .table tbody td {
    padding: 10px;
    font-size: .85rem;
  }

  .right_content .cards .card .card-value {
    font-size: 1.4rem;
  }

  .btn-xs {
    padding: 4px 8px !important;
    font-size: .75rem;
  }

  .col-border {
    border-right: none;
    border-bottom: 1px solid var(--bh-border);
    padding-bottom: 16px;
    margin-bottom: 16px;
  }
}

/* ── 25. Subtle Entry Animation ──────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .card,
  .card-blesta,
  .right_content .cards > div {
    animation: fadeUp .35s ease backwards;
  }

  .right_content .cards > div:nth-child(1) { animation-delay: .05s; }
  .right_content .cards > div:nth-child(2) { animation-delay: .1s; }
  .right_content .cards > div:nth-child(3) { animation-delay: .15s; }
  .right_content .cards > div:nth-child(4) { animation-delay: .2s; }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── 26. Card-Links Status Tabs (Active/Pending/Suspended) ─── */
.card-links,
.panel-links {
  padding: 10px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.card-links > li,
.panel-links > li {
  font-size: .8rem;
  font-weight: 500;
}

.card-links > li + li:before,
.panel-links > li + li:before {
  color: var(--bh-border);
  padding: 0 6px;
}

.card-links > li a,
.panel-links > li a {
  color: var(--bh-text-muted);
  text-decoration: none;
  transition: color var(--bh-transition);
}

.card-links > li a:hover,
.panel-links > li a:hover {
  color: var(--bh-primary);
}

.card-links > .active a,
.panel-links > .active a {
  color: var(--bh-primary) !important;
  font-weight: 600;
}

/* Status count badges */
.card-links .badge,
.panel-links .badge {
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  vertical-align: middle;
  margin-left: 2px;
}

/* Active tab badge — primary color */
.card-links > .active .badge {
  background-color: var(--bh-primary) !important;
  color: #fff !important;
}

/* Inactive tab badge — subtle gray */
.card-links > li:not(.active) .badge {
  background-color: #e2e8f0 !important;
  color: #64748b !important;
}

/* Highlighted/warning tab badge */
.card-links > .highlight .badge {
  background-color: var(--bh-warning-soft) !important;
  color: #92400e !important;
}

/* ── 27. Manage / Pay / Action Buttons ─────────────────────── */
.content_section .btn-group > .btn.btn-xs.btn-light {
  font-weight: 500;
  color: var(--bh-primary);
  border-color: rgba(13, 110, 253, .2);
  background: rgba(13, 110, 253, .04);
  transition: all var(--bh-transition);
}

.content_section .btn-group > .btn.btn-xs.btn-light:hover {
  background: var(--bh-primary) !important;
  color: #fff !important;
  border-color: var(--bh-primary) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(13, 110, 253, .2);
}

.content_section .btn-group > .btn.btn-xs.btn-light i {
  opacity: .7;
  transition: opacity var(--bh-transition);
}

.content_section .btn-group > .btn.btn-xs.btn-light:hover i {
  opacity: 1;
}

/* Pay button — green accent */
.content_section .btn-group > .btn.btn-xs.btn-info,
.content_section .btn-group > a.btn.btn-xs[href*="pay"] {
  font-weight: 500;
  color: var(--bh-success);
  border-color: rgba(25, 135, 84, .2);
  background: rgba(25, 135, 84, .04);
}

.content_section .btn-group > .btn.btn-xs.btn-info:hover,
.content_section .btn-group > a.btn.btn-xs[href*="pay"]:hover {
  background: var(--bh-success) !important;
  color: #fff !important;
  border-color: var(--bh-success) !important;
  box-shadow: 0 2px 6px rgba(25, 135, 84, .2);
}

/* Open Ticket / Make Payment header buttons */
.content_section .pull-right > .btn.btn-light,
.content_section .float-right > .btn.btn-light {
  font-weight: 500;
  font-size: .8rem;
  border: 1px solid var(--bh-border);
  transition: all var(--bh-transition);
}

.content_section .pull-right > .btn.btn-light:hover,
.content_section .float-right > .btn.btn-light:hover {
  border-color: var(--bh-primary);
  color: var(--bh-primary);
  background: var(--bh-primary-soft);
}

/* ── 28. Dashboard Table Hover ─────────────────────────────── */
.content_section .table tbody tr {
  transition: background-color .15s ease;
}

.content_section .table tbody tr:hover td {
  background-color: rgba(13, 110, 253, .03);
}

/* ── 29. Support PIN Widget — Refined Layout ───────────────── */
.content_section:last-child .card-body p {
  font-size: .875rem;
  color: var(--bh-text-muted);
  margin-bottom: 12px;
}

.content_section:last-child .table td {
  padding: 10px 16px;
  font-size: .875rem;
}

.content_section:last-child .table td:first-child {
  font-weight: 600;
  color: var(--bh-text-muted);
  white-space: nowrap;
  width: 140px;
}

.content_section:last-child .table td:last-child {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-weight: 600;
  color: var(--bh-text);
  letter-spacing: .02em;
}

/* ── 30. Widget Section Headers — Accent Border ────────────── */
.content_section > .card-header {
  border-left: 3px solid var(--bh-primary);
  background: linear-gradient(135deg, var(--bh-primary-soft) 0%, transparent 100%);
}

/* BH-V6-FIX — Light mode: force readable text in card headers.
   Higher specificity to override .card-blesta > .card-header { color: rgb(242,242,242); }
   that lives in bryan main.css and washes out card titles like "Ticket #2986686". */
body:not(.bh-dark) .card-blesta > .card-header,
body:not(.bh-dark) .card.card-blesta > .card-header,
body:not(.bh-dark) .content_section.card-blesta > .card-header,
body:not(.bh-dark) .content_section > .card-header,
body:not(.bh-dark) .card-blesta > .card-header *,
body:not(.bh-dark) .content_section > .card-header * {
  color: #1a202c !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Enhancements (sections 26–30)
   ═══════════════════════════════════════════════════════════════ */

/* 26. Card-links tabs */
body.bh-dark .card-links > li a,
body.bh-dark .panel-links > li a {
  color: #a0aec0;
}

body.bh-dark .card-links > li a:hover,
body.bh-dark .panel-links > li a:hover {
  color: #63b3ed;
}

body.bh-dark .card-links > .active a,
body.bh-dark .panel-links > .active a {
  color: #63b3ed !important;
}

body.bh-dark .card-links > li + li:before,
body.bh-dark .panel-links > li + li:before {
  color: rgba(255,255,255,0.12);
}

body.bh-dark .card-links > .active .badge {
  background-color: #4299e1 !important;
  color: #fff !important;
}

body.bh-dark .card-links > li:not(.active) .badge {
  background-color: #2d3748 !important;
  color: #a0aec0 !important;
}

body.bh-dark .card-links > .highlight .badge {
  background-color: rgba(237, 137, 54, .15) !important;
  color: #fbd38d !important;
}

/* 27. Manage / action buttons */
body.bh-dark .content_section .btn-group > .btn.btn-xs.btn-light {
  color: #63b3ed;
  border-color: rgba(66,153,225,0.2);
  background: rgba(66,153,225,0.08);
}

body.bh-dark .content_section .btn-group > .btn.btn-xs.btn-light:hover {
  background: #4299e1 !important;
  color: #fff !important;
  border-color: #4299e1 !important;
  box-shadow: 0 2px 6px rgba(66,153,225,0.3);
}

body.bh-dark .content_section .btn-group > .btn.btn-xs.btn-info,
body.bh-dark .content_section .btn-group > a.btn.btn-xs[href*="pay"] {
  color: #68d391;
  border-color: rgba(104,211,145,0.2);
  background: rgba(104,211,145,0.08);
}

body.bh-dark .content_section .btn-group > .btn.btn-xs.btn-info:hover,
body.bh-dark .content_section .btn-group > a.btn.btn-xs[href*="pay"]:hover {
  background: #48bb78 !important;
  color: #fff !important;
  border-color: #48bb78 !important;
  box-shadow: 0 2px 6px rgba(72,187,120,0.3);
}

body.bh-dark .content_section .pull-right > .btn.btn-light:hover,
body.bh-dark .content_section .float-right > .btn.btn-light:hover {
  border-color: #4299e1;
  color: #63b3ed;
  background: rgba(66,153,225,0.1);
}

/* 28. Table hover */
body.bh-dark .content_section .table tbody tr:hover td {
  background-color: rgba(66,153,225,0.06);
}

/* 29. Support PIN */
body.bh-dark .content_section:last-child .card-body p {
  color: #a0aec0;
}

body.bh-dark .content_section:last-child .table td:first-child {
  color: #a0aec0;
}

body.bh-dark .content_section:last-child .table td:last-child {
  color: #e2e8f0;
}

/* 30. Widget headers */
body.bh-dark .content_section > .card-header {
  border-left-color: #4299e1;
  background: linear-gradient(135deg, rgba(66,153,225,0.1) 0%, transparent 100%);
}

/* ═══════════════════════════════════════════════════════════════
   31. Module Dark Mode — Generic overrides for 3rd-party modules
   Uses [class*="-xxx"] wildcards to catch any module prefix
   (hv-*, ovh-*, vps-*, etc.) without editing module code.
   ═══════════════════════════════════════════════════════════════ */

/* -- Cards & containers ------------------------------------ */
body.bh-dark [class*="-card"]:not(.card):not(.card-blesta):not(.bh-stat-card):not(.bh-summary-card):not(.card-header):not(.card-body):not(.card-footer):not(.card-links) {
  background: #1e2536 !important;
  border-color: rgba(255,255,255,0.08) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
  color: #cbd5e0 !important;
}

body.bh-dark [class*="-card-body"] {
  color: #cbd5e0 !important;
}

/* -- Section titles ---------------------------------------- */
body.bh-dark [class*="-section-title"] {
  color: #a0aec0 !important;
  border-color: rgba(255,255,255,0.08) !important;
}

/* -- Tables inside modules --------------------------------- */
body.bh-dark [class*="-info-table"],
body.bh-dark [class*="-rdns-table"],
body.bh-dark [class*="-data-table"],
body.bh-dark table[class*="-table"]:not(.table) {
  color: #cbd5e0 !important;
}

body.bh-dark [class*="-info-table"] td,
body.bh-dark [class*="-info-table"] th,
body.bh-dark [class*="-rdns-table"] td,
body.bh-dark [class*="-rdns-table"] th,
body.bh-dark table[class*="-table"]:not(.table) td,
body.bh-dark table[class*="-table"]:not(.table) th {
  color: #cbd5e0 !important;
  border-color: rgba(255,255,255,0.06) !important;
}

body.bh-dark [class*="-info-table"] thead th,
body.bh-dark [class*="-rdns-table"] thead th,
body.bh-dark table[class*="-table"]:not(.table) thead th {
  background: #252d42 !important;
  color: #a0aec0 !important;
}

body.bh-dark [class*="-info-table"] td:first-child,
body.bh-dark [class*="-rdns-table"] td:first-child {
  color: #a0aec0 !important;
}

/* Table hover — no flash, instant dark bg */
body.bh-dark [class*="-info-table"] tr,
body.bh-dark [class*="-rdns-table"] tr,
body.bh-dark table[class*="-table"]:not(.table) tr {
  transition: none !important;
}

body.bh-dark [class*="-info-table"] tr:hover,
body.bh-dark [class*="-info-table"] tr:hover td,
body.bh-dark [class*="-rdns-table"] tr:hover,
body.bh-dark [class*="-rdns-table"] tr:hover td,
body.bh-dark table[class*="-table"]:not(.table) tr:hover,
body.bh-dark table[class*="-table"]:not(.table) tr:hover td {
  background: #252d42 !important;
  transition: none !important;
}

/* -- Code blocks & monospace -------------------------------- */
body.bh-dark [class*="-code"]:not(code) {
  background: #2d3748 !important;
  color: #e2e8f0 !important;
  border-color: rgba(255,255,255,0.1) !important;
}

/* -- Badges ------------------------------------------------ */
body.bh-dark [class*="-badge-success"] {
  background: rgba(72,187,120,0.15) !important;
  color: #68d391 !important;
}

body.bh-dark [class*="-badge-info"] {
  background: rgba(66,153,225,0.15) !important;
  color: #63b3ed !important;
}

body.bh-dark [class*="-badge-danger"] {
  background: rgba(245,101,101,0.15) !important;
  color: #fc8181 !important;
}

body.bh-dark [class*="-badge-primary"] {
  background: rgba(102,126,234,0.15) !important;
  color: #a3bffa !important;
}

body.bh-dark [class*="-badge-warning"] {
  background: rgba(237,137,54,0.15) !important;
  color: #fbd38d !important;
}

body.bh-dark [class*="-badge-secondary"] {
  background: #2d3748 !important;
  color: #a0aec0 !important;
}

body.bh-dark [class*="-badge"]:not(.badge) {
  color: #e2e8f0 !important;
}

/* Badges stay readable on row hover — dark mode */
body.bh-dark tr:hover [class*="-badge-success"] {
  background: rgba(72,187,120,0.3) !important;
  color: #68d391 !important;
}

body.bh-dark tr:hover [class*="-badge-info"] {
  background: rgba(66,153,225,0.3) !important;
  color: #63b3ed !important;
}

body.bh-dark tr:hover [class*="-badge-danger"] {
  background: rgba(245,101,101,0.3) !important;
  color: #fc8181 !important;
}

body.bh-dark tr:hover [class*="-badge-primary"] {
  background: rgba(102,126,234,0.3) !important;
  color: #a3bffa !important;
}

body.bh-dark tr:hover [class*="-badge"]:not(.badge) {
  color: #e2e8f0 !important;
}

/* Badges stay readable on row hover — light mode */
body:not(.bh-dark) tr:hover [class*="-badge-success"] {
  background: #c6f6d5 !important;
  color: #22543d !important;
}

body:not(.bh-dark) tr:hover [class*="-badge-info"] {
  background: #bee3f8 !important;
  color: #2a4365 !important;
}

body:not(.bh-dark) tr:hover [class*="-badge-primary"] {
  background: #c3dafe !important;
  color: #3c366b !important;
}

body:not(.bh-dark) tr:hover [class*="-badge-danger"] {
  background: #fed7d7 !important;
  color: #742a2a !important;
}

/* -- How-to / guide / notice boxes ------------------------- */
body.bh-dark [class*="-howto"],
body.bh-dark [class*="-guide"],
body.bh-dark [class*="-notice"]:not(.alert) {
  background: #252d42 !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #cbd5e0 !important;
}

body.bh-dark [class*="-howto"] code,
body.bh-dark [class*="-guide"] code {
  background: #2d3748 !important;
  color: #e2e8f0 !important;
}

/* -- Buttons ----------------------------------------------- */
body.bh-dark [class*="-btn-outline"] {
  background: transparent !important;
  color: #63b3ed !important;
  border-color: rgba(66,153,225,0.3) !important;
}

body.bh-dark [class*="-btn-outline"]:hover {
  background: rgba(66,153,225,0.1) !important;
}

body.bh-dark [class*="-btn-orange"] {
  background: rgba(237,137,54,0.15) !important;
  color: #fbd38d !important;
  border-color: rgba(237,137,54,0.3) !important;
}

/* -- Action buttons (Start/Stop/Restart) ------------------- */
body.bh-dark [class*="-action-btn"] {
  background: #252d42 !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #cbd5e0 !important;
  transition: none !important;
}

body.bh-dark [class*="-action-btn"]:hover,
body.bh-dark [class*="-action-btn"].start:hover,
body.bh-dark [class*="-action-btn"].stop:hover,
body.bh-dark [class*="-action-btn"].reboot:hover {
  background: #2d3748 !important;
  border-color: rgba(255,255,255,0.15) !important;
}

/* -- Resource pills ---------------------------------------- */
body.bh-dark [class*="-res-pill"],
body.bh-dark [class*="-resource-pills"] span,
body.bh-dark [class*="-resource"] span {
  background: rgba(66,153,225,0.1) !important;
  color: #63b3ed !important;
  border-color: rgba(66,153,225,0.2) !important;
}

/* -- Copy button ------------------------------------------- */
body.bh-dark [class*="-copy-btn"] {
  color: #a0aec0 !important;
  background: transparent !important;
  border-color: rgba(255,255,255,0.1) !important;
}

body.bh-dark [class*="-copy-btn"]:hover {
  color: #e2e8f0 !important;
  background: rgba(255,255,255,0.06) !important;
}

/* -- Password row ------------------------------------------ */
body.bh-dark [class*="-pw-row"] input,
body.bh-dark [class*="-pw-row"] [class*="-pw-toggle"] {
  background: #2d3748 !important;
  color: #e2e8f0 !important;
  border-color: rgba(255,255,255,0.1) !important;
}

/* -- Hint / info boxes ------------------------------------- */
body.bh-dark [class*="-hint"] {
  background: #252d42 !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #cbd5e0 !important;
}

body.bh-dark [class*="-hint-title"] {
  color: #e2e8f0 !important;
}

body.bh-dark [class*="-hint"] p,
body.bh-dark [class*="-hint"] strong {
  color: #cbd5e0 !important;
}

/* -- Recovery card ----------------------------------------- */
body.bh-dark [class*="-recovery-card"] {
  background: #252d42 !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #cbd5e0 !important;
}

body.bh-dark [class*="-recovery-card"] strong,
body.bh-dark [class*="-recovery-card"] h4,
body.bh-dark [class*="-recovery-card"] h5 {
  color: #e2e8f0 !important;
}

body.bh-dark [class*="-recovery-card"] p,
body.bh-dark [class*="-recovery-card"] label {
  color: #a0aec0 !important;
}

body.bh-dark [class*="-recovery-card"] input {
  background: #2d3748 !important;
  border-color: rgba(255,255,255,0.1) !important;
  color: #e2e8f0 !important;
}

/* -- Panels (alternative to -card) ------------------------- */
body.bh-dark [class*="-panel"]:not(.panel):not(.panel-blesta):not(.panel-pad) {
  background: #1e2536 !important;
  border-color: rgba(255,255,255,0.08) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
  color: #cbd5e0 !important;
}

/* -- Detail grid items (label/value pairs) ----------------- */
body.bh-dark [class*="-detail-item"] {
  border-color: rgba(255,255,255,0.06) !important;
}

body.bh-dark [class*="-detail-label"] {
  color: #a0aec0 !important;
}

body.bh-dark [class*="-detail-value"] {
  color: #e2e8f0 !important;
}

body.bh-dark [class*="-grid"] {
  color: #cbd5e0 !important;
}

/* -- Power buttons ----------------------------------------- */
body.bh-dark [class*="-btn-power"],
body.bh-dark [class*="-btn-start"],
body.bh-dark [class*="-btn-stop"],
body.bh-dark [class*="-btn-restart"],
body.bh-dark [class*="-btn-shutdown"] {
  background: #252d42 !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #cbd5e0 !important;
  transition: none !important;
}

body.bh-dark [class*="-btn-power"]:hover,
body.bh-dark [class*="-btn-start"]:hover,
body.bh-dark [class*="-btn-stop"]:hover,
body.bh-dark [class*="-btn-restart"]:hover,
body.bh-dark [class*="-btn-shutdown"]:hover {
  background: #2d3748 !important;
  border-color: rgba(255,255,255,0.15) !important;
}

/* -- Power grid / actions row ------------------------------ */
body.bh-dark [class*="-power-grid"],
body.bh-dark [class*="-actions-row"] {
  color: #cbd5e0 !important;
}

/* -- Badge running (module-specific status) ---------------- */
body.bh-dark [class*="-badge-running"] {
  background: rgba(72,187,120,0.15) !important;
  color: #68d391 !important;
}

body.bh-dark [class*="-badge-stopped"],
body.bh-dark [class*="-badge-offline"] {
  background: rgba(245,101,101,0.15) !important;
  color: #fc8181 !important;
}

/* -- Password toggle --------------------------------------- */
body.bh-dark [class*="-pw-toggle"] {
  color: #a0aec0 !important;
}

body.bh-dark [class*="-pw-toggle"]:hover {
  color: #e2e8f0 !important;
}

/* -- Module wraps & containers ----------------------------- */
body.bh-dark [class*="-wrap"]:not(.flex-wrap):not(.text-wrap) {
  color: #cbd5e0 !important;
}

/* -- Credential blocks ------------------------------------- */
body.bh-dark [class*="-cred-block"],
body.bh-dark [class*="-cred-row"] {
  background: #1e2536 !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #cbd5e0 !important;
}

body.bh-dark [class*="-cred-label"] {
  color: #a0aec0 !important;
}

body.bh-dark [class*="-cred-btn"] {
  color: #a0aec0 !important;
  border-color: rgba(255,255,255,0.1) !important;
}

body.bh-dark [class*="-cred-btn"]:hover {
  color: #e2e8f0 !important;
}

body.bh-dark [class*="-cred-note"] {
  color: #718096 !important;
}

/* -- Power buttons (reversed naming: -power-btn) ----------- */
body.bh-dark [class*="-power-btn"] {
  background: #252d42 !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #cbd5e0 !important;
  transition: none !important;
}

body.bh-dark [class*="-power-btn"]:hover {
  background: #2d3748 !important;
  border-color: rgba(255,255,255,0.15) !important;
}

body.bh-dark [class*="-power-label"],
body.bh-dark [class*="-power-desc"] {
  color: #cbd5e0 !important;
}

body.bh-dark [class*="-power-icon"] {
  color: #a0aec0 !important;
}

/* -- Power warning / note box ------------------------------ */
body.bh-dark [class*="-power-warning"],
body.bh-dark [class*="-warning"]:not(.alert-warning):not(.badge-warning) {
  background: rgba(237,137,54,0.08) !important;
  border-color: rgba(237,137,54,0.2) !important;
  color: #fbd38d !important;
}

/* -- Power hint items -------------------------------------- */
body.bh-dark [class*="-power-hint-item"],
body.bh-dark [class*="-power-hints"] {
  background: #252d42 !important;
  border-color: rgba(255,255,255,0.06) !important;
  color: #cbd5e0 !important;
}

body.bh-dark [class*="-power-hint-title"] {
  color: #e2e8f0 !important;
}

/* -- Info grid cards (overview stat tiles) ------------------ */
body.bh-dark [class*="-info-grid"] {
  color: #cbd5e0 !important;
}

body.bh-dark [class*="-info-label"] {
  color: #a0aec0 !important;
}

body.bh-dark [class*="-info-value"] {
  color: #e2e8f0 !important;
}

body.bh-dark [class*="-info-icon"] {
  color: #63b3ed !important;
}

/* -- Status / phi badges ----------------------------------- */
body.bh-dark [class*="-status-badge"] {
  color: #e2e8f0 !important;
}

body.bh-dark [class*="-phi-badge"] {
  color: #e2e8f0 !important;
}

/* -- Password / form boxes --------------------------------- */
body.bh-dark [class*="-password-box"],
body.bh-dark [class*="-pass-box"],
body.bh-dark [class*="-form-box"] {
  background: #252d42 !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #cbd5e0 !important;
}

body.bh-dark [class*="-password-field"] input,
body.bh-dark [class*="-pass-field"] input,
body.bh-dark [class*="-password-form"] input {
  background: #1e2536 !important;
  border-color: rgba(255,255,255,0.1) !important;
  color: #e2e8f0 !important;
}

body.bh-dark [class*="-password-field"] input::placeholder,
body.bh-dark [class*="-password-form"] input::placeholder {
  color: #718096 !important;
}

body.bh-dark [class*="-password-field"] label {
  color: #a0aec0 !important;
}

body.bh-dark [class*="-password-submit"] label {
  color: transparent !important;
}

/* -- Tile grids (Quick Actions, shortcuts) ----------------- */
body.bh-dark [class*="-tile"] {
  background: #1e2536 !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #cbd5e0 !important;
  transition: none !important;
}

body.bh-dark [class*="-tile"]:hover {
  background: #252d42 !important;
  border-color: rgba(255,255,255,0.15) !important;
}

body.bh-dark [class*="-tile-label"] {
  color: #a0aec0 !important;
}

/* -- Generic: catch module inline light text colors -------- */
body.bh-dark .panel-pad [style*="color:#4a5568"],
body.bh-dark .panel-pad [style*="color: #4a5568"],
body.bh-dark .panel-pad [style*="color:#2d3748"],
body.bh-dark .panel-pad [style*="color: #2d3748"],
body.bh-dark .panel-pad [style*="color:#78716c"],
body.bh-dark .panel-pad [style*="color: #78716c"],
body.bh-dark .panel-pad [style*="color:#92400e"],
body.bh-dark .panel-pad [style*="color: #92400e"],
body.bh-dark .panel-pad [style*="color:#6c757d"],
body.bh-dark .panel-pad [style*="color: #6c757d"],
body.bh-dark .panel-pad [style*="color:#718096"],
body.bh-dark .panel-pad [style*="color: #718096"] {
  color: #a0aec0 !important;
}

/* -- Generic: catch inline light backgrounds --------------- */
body.bh-dark .panel-pad [style*="background:#f8f9fa"],
body.bh-dark .panel-pad [style*="background: #f8f9fa"],
body.bh-dark .panel-pad [style*="background:#f7fafc"],
body.bh-dark .panel-pad [style*="background: #f7fafc"],
body.bh-dark .panel-pad [style*="background:#fff"],
body.bh-dark .panel-pad [style*="background: #fff"],
body.bh-dark .panel-pad [style*="background:#ffffff"],
body.bh-dark .panel-pad [style*="background: #ffffff"],
body.bh-dark .panel-pad [style*="background:white"],
body.bh-dark .panel-pad [style*="background: white"],
body.bh-dark .panel-pad [style*="background-color:#fff"],
body.bh-dark .panel-pad [style*="background-color: #fff"],
body.bh-dark .panel-pad [style*="background-color:white"],
body.bh-dark .panel-pad [style*="background-color: white"] {
  background: #1e2536 !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: #cbd5e0 !important;
}

/* -- Generic: catch inline light-blue tinted backgrounds --- */
body.bh-dark .panel-pad [style*="background:#ebf5ff"],
body.bh-dark .panel-pad [style*="background: #ebf5ff"],
body.bh-dark .panel-pad [style*="background:#e8f0fe"],
body.bh-dark .panel-pad [style*="background: #e8f0fe"] {
  background: rgba(66,153,225,0.08) !important;
  border-color: rgba(66,153,225,0.15) !important;
  color: #cbd5e0 !important;
}

/* -- Generic: catch inline badge/pill backgrounds ---------- */
body.bh-dark .panel-pad [style*="background:#e2e3e5"],
body.bh-dark .panel-pad [style*="background: #e2e3e5"] {
  background: #2d3748 !important;
  color: #a0aec0 !important;
}

body.bh-dark .panel-pad [style*="background:#c6f6d5"],
body.bh-dark .panel-pad [style*="background: #c6f6d5"] {
  background: rgba(72,187,120,0.15) !important;
  color: #68d391 !important;
}

body.bh-dark .panel-pad [style*="background:#fed7d7"],
body.bh-dark .panel-pad [style*="background: #fed7d7"] {
  background: rgba(245,101,101,0.15) !important;
  color: #fc8181 !important;
}

body.bh-dark .panel-pad [style*="background:#fefcbf"],
body.bh-dark .panel-pad [style*="background: #fefcbf"],
body.bh-dark .panel-pad [style*="background:#fff8e1"],
body.bh-dark .panel-pad [style*="background: #fff8e1"] {
  background: rgba(237,199,28,0.1) !important;
  color: #fbd38d !important;
}

/* -- Generic: catch inline border colors ------------------- */
body.bh-dark .panel-pad [style*="border"][style*="#e9ecef"],
body.bh-dark .panel-pad [style*="border"][style*="#e2e8f0"],
body.bh-dark .panel-pad [style*="border"][style*="#cbd5e0"] {
  border-color: rgba(255,255,255,0.08) !important;
}

/* -- Generic: inline dark text that needs lightening ------- */
body.bh-dark .panel-pad [style*="color:#2d3748"],
body.bh-dark .panel-pad [style*="color: #2d3748"] {
  color: #e2e8f0 !important;
}

/* -- Affiliate Overview stat cards (bg-success / bg-info / bg-warning) ----
   Bryan theme leaks dark slate color onto <p> + <h2> inside Bootstrap
   colored cards on /order/affiliates/ — force white for readability. */
.card.bg-success,
.card.bg-info,
.card.bg-warning,
.card.bg-success *,
.card.bg-info *,
.card.bg-warning * {
  color: #ffffff !important;
}
.card.bg-success .card-body p,
.card.bg-info .card-body p,
.card.bg-warning .card-body p {
  color: rgba(255,255,255,0.85) !important;
}
.card.bg-success .card-body h2,
.card.bg-info .card-body h2,
.card.bg-warning .card-body h2 {
  color: #ffffff !important;
  font-weight: 700;
}
/* Dark mode keeps the same — colored cards already provide contrast */
body.bh-dark .card.bg-success,
body.bh-dark .card.bg-info,
body.bh-dark .card.bg-warning,
body.bh-dark .card.bg-success *,
body.bh-dark .card.bg-info *,
body.bh-dark .card.bg-warning * {
  color: #ffffff !important;
}
