/* Shared client surfaces. Keep brand colours and illustrations unchanged. */
html[data-bs-theme="dark"] {
  --bs-body-bg:#101722;
  --bs-body-bg-rgb:16,23,34;
  --bs-body-color:#dce4ef;
  --bs-body-color-rgb:220,228,239;
  --bs-emphasis-color:#f1f5f9;
  --bs-secondary-color:#9baac0;
  --bs-secondary-bg:#202c3d;
  --bs-tertiary-bg:#182232;
  --bs-border-color:#304056;
  --default-text-color:#dce4ef;
  --default-background:#182232;
  --default-body-bg-color:#101722;
}
[data-bs-theme="dark"] body {background-color:var(--bs-body-bg);color:var(--bs-body-color)}
[data-bs-theme="dark"] :is(.topbar,.startbar,.card,.modal-content,.dropdown-menu,.offcanvas,.swal2-popup) {
  background-color:#182232;color:var(--bs-body-color);border-color:var(--bs-border-color);
  --bs-card-title-color:#f1f5f9;--bs-card-subtitle-color:#9baac0;
  --bs-card-bg:#182232;--bs-dropdown-bg:#182232;--bs-dropdown-color:#dce4ef;
  --bs-modal-bg:#182232;
}
[data-bs-theme="dark"] :is(.topbar,.startbar,.card) {box-shadow:0 2px 12px rgba(0,0,0,.18)}
[data-bs-theme="dark"] .startbar .startbar-menu .navbar-nav .nav-item .nav-link {color:#cad5e5}
[data-bs-theme="dark"] .startbar .startbar-menu .navbar-nav .nav-item .nav-link:is(.active,:hover) {color:#93b4ff}
[data-bs-theme="dark"] .startbar .menu-label {color:#9baac0}
[data-bs-theme="dark"] :is(.card-title,.modal-title,.swal2-title,.swal2-html-container) {color:var(--bs-emphasis-color)}
[data-bs-theme="dark"] :is(.bg-white,.bg-light) {background-color:#202c3d!important}
[data-bs-theme="dark"] :is(.text-dark,.text-black) {color:#e2e8f0!important}
[data-bs-theme="dark"] :is(.form-control,.form-select,.input-group-text,.select2-container--default .select2-selection--single,.select2-container--default .select2-selection--multiple,.select2-dropdown) {background-color:#121c2a;color:#dce4ef;border-color:#34445b}
[data-bs-theme="dark"] :is(.form-control,.form-select):disabled {background-color:#253144;color:#9baac0;border-color:#34445b}
[data-bs-theme="dark"] .form-control::placeholder {color:#8999ae;opacity:1}
[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {color:#dce4ef}
[data-bs-theme="dark"] .table {--bs-table-color:#dce4ef;--bs-table-bg:transparent;--bs-table-border-color:#304056;--bs-table-striped-bg:rgba(148,163,184,.06);--bs-table-striped-color:#dce4ef;--bs-table-hover-bg:rgba(148,163,184,.1);--bs-table-hover-color:#f1f5f9}
[data-bs-theme="dark"] .table-responsive .action-bar {background:rgba(24,34,50,.96)}
[data-bs-theme="dark"] .footer {background-color:#101722;color:#9baac0}
[data-bs-theme="dark"] .sv-cross .sv-note {background:#182232;border-color:#304056;border-left-color:#60a5fa;color:#cbd5e1}
[data-bs-theme="dark"] .sv-cross .sv-note b {color:#f1f5f9}
[data-bs-theme="dark"] .sv-cross .sv-note.canh-bao {background:#302719;border-left-color:#fbbf24}
[data-bs-theme="dark"] .sv-cross .sv-note.tot {background:#142d27;border-left-color:#34d399}
[data-bs-theme="dark"] .sv-cross .sv-note p.canh,[data-bs-theme="dark"] .sv-cross .sv-note p.canh b {color:#fcd34d}
[data-bs-theme="dark"] #topSearchResults .svc-search-item:hover {background:#25344b}
/* Marketing home hero has its own light palette, separate from Bootstrap cards. */
[data-bs-theme="dark"] .mk.home-hm {color:#e2e8f0;border-color:#304056;background:radial-gradient(560px 300px at 100% 0%,rgba(49,103,243,.16),transparent 62%),linear-gradient(135deg,#182232,#17273e)}
[data-bs-theme="dark"] :is(.home-hm-h,.home-hm-me b,.home-hm-kv b,.home-hm-kpi b) {color:#f1f5f9}
[data-bs-theme="dark"] :is(.home-hm-p,.home-hm-pts,.home-hm-bal small,.home-hm-kv small,.home-hm-kpi small) {color:#a9b9ce}
[data-bs-theme="dark"] :is(.home-hm-acc,.home-hm-win) {background:#1b293d;color:#e2e8f0;border-color:#34445b;box-shadow:0 20px 40px -24px rgba(0,0,0,.6)}
[data-bs-theme="dark"] .home-hm-bal {background:linear-gradient(135deg,#263454,#332c48)}
[data-bs-theme="dark"] .home-hm-bal strong {color:#b8b3ff}
[data-bs-theme="dark"] :is(.home-hm-kv div,.home-hm-kpi,.home-hm-chart,.home-hm-pts,.home-hm-pts span+span) {border-color:#34445b}
[data-bs-theme="dark"] .home-hm-chart {background:linear-gradient(180deg,#152034,#1b293d)}
[data-bs-theme="dark"] .home-hm .mk-btn.ghost,[data-bs-theme="dark"] .home-hm-acts .sec2 {background:#25344b;color:#dce4ef;border-color:#40536d}
[data-bs-theme="dark"] .home-hm .mk-btn.ghost:hover,[data-bs-theme="dark"] .home-hm-acts .sec2:hover {background:#30425e;color:#fff}
[data-bs-theme="dark"] .home-hm .mk-eyebrow,[data-bs-theme="dark"] .home-hm-pts i {background:#25344b;color:#93b4ff;border-color:#40536d}
@media (max-width:575.98px){
  #topbar-custom .nav-link.nav-icon{width:30px;margin-left:2px;margin-right:2px}
}

/* Recharge: explicit colours for headers, amount selection and invoice details. */
[data-bs-theme="dark"] .table > thead {
  background:#25344b;--bs-table-bg:#25344b;--bs-table-color:#e2e8f0;
}
[data-bs-theme="dark"] .table > thead > tr > th {background-color:#25344b;color:#e2e8f0;border-color:#40536d}
[data-bs-theme="dark"] #invoice-form .quick-amount {background-color:#25344b!important;color:#cbd5e1!important;border:1px solid #40536d!important}
[data-bs-theme="dark"] #invoice-form .quick-amount:is(:hover,:focus-visible,.active) {background-color:#263e68!important;color:#bfdbfe!important;border-color:#6098ef!important}
[data-bs-theme="dark"] .bank-select-item:hover {background-color:#25344b}
[data-bs-theme="dark"] .einvoice-summary-card {background:linear-gradient(135deg,#15332c,#193b32);border-color:#2e6552;color:#d1fae5}
[data-bs-theme="dark"] .einvoice-summary-card .text-success {color:#6ee7b7!important}
[data-bs-theme="dark"] .einvoice-form-card {background:linear-gradient(135deg,#1b293d,#20354b);border-color:#40536d}
[data-bs-theme="dark"] .tax-preview-card {background:linear-gradient(135deg,#1b293d,#20354b)}
[data-bs-theme="dark"] :is(.tax-label,.tax-value,.tax-value-total,.tax-total .tax-label) {color:#dce4ef}

.startbar .social-platform-icon{display:inline-flex;align-items:center;justify-content:center;width:25px;height:25px;flex-shrink:0;font-size:20px;color:inherit}

/* ═══ MODERN POPUP & MODAL SYSTEM (SweetAlert2 & AI Studio Modals) ═══ */
.swal2-container {
  z-index: 99999 !important;
}
.swal2-container.swal2-backdrop-show {
  background: rgba(15, 23, 42, 0.55) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}
.swal2-popup {
  border-radius: 24px !important;
  padding: 28px 24px 22px !important;
  box-shadow: 0 25px 70px -15px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.05) !important;
  font-family: inherit !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  background: #ffffff !important;
  max-width: 440px !important;
  width: 90% !important;
}
[data-bs-theme="dark"] .swal2-popup {
  background: #182232 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 25px 70px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}
.swal2-title {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  padding: 0 !important;
  margin-bottom: 6px !important;
  letter-spacing: -0.02em !important;
  line-height: 1.4 !important;
}
[data-bs-theme="dark"] .swal2-title {
  color: #f8fafc !important;
}
.swal2-html-container {
  font-size: 0.92rem !important;
  color: #64748b !important;
  line-height: 1.6 !important;
  margin: 6px 0 0 !important;
  word-break: break-word !important;
}
[data-bs-theme="dark"] .swal2-html-container {
  color: #94a3b8 !important;
}
.swal2-icon {
  width: 60px !important;
  height: 60px !important;
  border-width: 3px !important;
  margin: 4px auto 16px !important;
  transform: scale(0.92);
}
.swal2-icon .swal2-icon-content {
  font-size: 2.2rem !important;
}
.swal2-icon.swal2-warning {
  border-color: #f59e0b !important;
  color: #f59e0b !important;
}
.swal2-icon.swal2-error {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}
.swal2-icon.swal2-success {
  border-color: #10b981 !important;
  color: #10b981 !important;
}
.swal2-icon.swal2-info {
  border-color: #3b82f6 !important;
  color: #3b82f6 !important;
}
.swal2-icon.swal2-question {
  border-color: #8b5cf6 !important;
  color: #8b5cf6 !important;
}
.swal2-actions {
  gap: 10px !important;
  width: 100% !important;
  margin: 22px 0 0 !important;
  display: flex !important;
  justify-content: center !important;
}
.swal2-actions button {
  border-radius: 14px !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  padding: 11px 22px !important;
  min-height: 44px !important;
  border: none !important;
  transition: all 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.2) !important;
  cursor: pointer !important;
  box-shadow: none !important;
}
.swal2-actions button:not([style*="display: none"]):not([style*="display:none"]) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.swal2-actions button[style*="display: none"],
.swal2-actions button[style*="display:none"] {
  display: none !important;
}
.swal2-actions button:hover {
  transform: translateY(-1.5px) !important;
  filter: brightness(1.06) !important;
}
.swal2-actions button:active {
  transform: translateY(1px) scale(0.98) !important;
}
.swal2-confirm {
  background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.5) !important;
  flex: 1 !important;
}
.swal2-confirm.sc-btn-danger, .sc-swal-danger .swal2-confirm {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  box-shadow: 0 8px 20px -6px rgba(220, 38, 38, 0.55) !important;
}
.swal2-cancel {
  background: #f1f5f9 !important;
  color: #475569 !important;
  flex: 1 !important;
}
[data-bs-theme="dark"] .swal2-cancel {
  background: #253346 !important;
  color: #cbd5e1 !important;
}
.swal2-cancel:hover {
  background: #e2e8f0 !important;
}
[data-bs-theme="dark"] .swal2-cancel:hover {
  background: #30425e !important;
}
.swal2-deny {
  background: #ef4444 !important;
  color: #ffffff !important;
  flex: 1 !important;
}

/* AI Studio Custom Modals (.as-modal-bg, .as-modal) */
.as-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.as-modal-bg.show {
  display: flex !important;
  animation: asFadeIn 0.18s ease-out forwards;
}
.as-modal {
  border-radius: 24px !important;
  box-shadow: 0 25px 70px -15px rgba(0, 0, 0, 0.35) !important;
  animation: asZoomIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes asFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes asZoomIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.as-modal-close {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(15, 23, 42, 0.05) !important;
  color: var(--as-muted, #64748b) !important;
  transition: all 0.15s ease !important;
  font-size: 1.25rem !important;
  line-height: 1 !important;
  padding: 0 !important;
  border: none !important;
}
.as-modal-close:hover {
  background: rgba(15, 23, 42, 0.1) !important;
  color: var(--as-text, #0f172a) !important;
  transform: rotate(90deg);
}
[data-bs-theme="dark"] .as-modal-close {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
}
[data-bs-theme="dark"] .as-modal-close:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #f1f5f9 !important;
}

@media (max-width: 576px) {
  .swal2-popup {
    width: calc(100% - 32px) !important;
    padding: 24px 20px 20px !important;
    border-radius: 22px !important;
  }
  .swal2-title { font-size: 1.18rem !important; }
  .swal2-html-container { font-size: 0.88rem !important; }
  .swal2-actions {
    flex-direction: row !important;
    gap: 10px !important;
    margin-top: 20px !important;
  }
  .swal2-actions button {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 11px 12px !important;
    font-size: 0.88rem !important;
    margin: 0 !important;
  }
  .as-modal-bg {
    padding: 14px;
  }
  .as-modal {
    padding: 20px 16px !important;
    border-radius: 20px !important;
  }
}

