/* YCW Portal RC33 | Dark surface & status polish.
   A late-loading, component-scoped layer. No changes to WHMCS handlers,
   status data, AJAX visibility, gateway iframe contents or light mode. */
html[data-ycw-theme='dark'] body.ycw-portal {
  --ycw33-page: #101a2a;
  --ycw33-surface: #1c2a3e;
  --ycw33-surface-raised: #23334a;
  --ycw33-surface-hover: #2a3d56;
  --ycw33-field: #152237;
  --ycw33-line: #3c506b;
  --ycw33-text: #edf3fd;
  --ycw33-muted: #b1c2d6;
  --ycw33-orange: #ff8b46;
}
/* Content shells are page canvas, not additional giant cards. */
html[data-ycw-theme='dark'] body.ycw-portal :is(
  .wdes-content > .container,.wdes-content > .container-fluid,
  #main-body > .container,#main-body > .container-fluid,
  .ycw-content-layout > main,.main-content > .container,
  .ycw-dashboard,.ycw-dashboard-main,.ycw-dashboard-content,
  .ycw-dashboard-sections,.ycw-dashboard-section,
  .ycw-dashboard-stats,.ycw-dashboard-actions,
  .ycw-dashboard .row,.ycw-dashboard .col-sm-6,.ycw-dashboard .col-md-4
) {background-color:transparent!important;}
/* Informational blocks are raised by border/tonal contrast only. */
html[data-ycw-theme='dark'] body.ycw-portal :is(
 .ycw-dashboard .ycw-dashboard-stat,.ycw-dashboard .ycw-dashboard-stat-card,
 .ycw-dashboard .ycw-dashboard-action-card,.ycw-dashboard .ycw-dashboard-quick-card,
 .ycw-dashboard .ycw-dashboard-service-card,.ycw-dashboard .ycw-dashboard-panel,
 .ycw-dashboard .ycw-overview-card,.ycw-dashboard .ycw-dashboard-widget,
 .ycw-dashboard .ycw-dashboard-summary
) {background:var(--ycw33-surface)!important;border-color:var(--ycw33-line)!important;color:var(--ycw33-text)!important;}
html[data-ycw-theme='dark'] body.ycw-portal :is(
 .ycw-dashboard .ycw-dashboard-stat-card,.ycw-dashboard .ycw-dashboard-action-card,
 .ycw-dashboard .ycw-dashboard-panel,.ycw-dashboard .ycw-overview-card
) :is(h1,h2,h3,h4,h5,strong,.number,.value,.count,.title) {color:var(--ycw33-text)!important;}
html[data-ycw-theme='dark'] body.ycw-portal .ycw-dashboard :is(
 .ycw-dashboard-subtitle,.ycw-dashboard-stat-label,.ycw-dashboard-quick-description,
 .ycw-dashboard-action-description,.ycw-dashboard-summary-label,.ycw-dashboard-panel small
) {color:var(--ycw33-muted)!important;}
/* Semantic statuses: tone backgrounds darker, keep readable labels rather
   than the formerly white pills with pale text. */
html[data-ycw-theme='dark'] body.ycw-portal :is(.label.status,.badge.status,span.status.label) {
 display:inline-flex;align-items:center;justify-content:center;
 min-height:30px;max-width:100%;padding:6px 13px;
 background:#293a51!important;color:#e5efff!important;
 border:1px solid #4b5f7c!important;border-radius:999px;
 box-shadow:none!important;text-shadow:none!important;
 font-weight:700;line-height:1.35;
}
html[data-ycw-theme='dark'] body.ycw-portal :is(.label.status,.badge.status):is(
 .status-active,.status-Active,.status-paid,.status-Paid,.status-answered,.status-Answered,
 .status-completed,.status-Completed,.status-success,.status-Success
) {background:#173a31!important;color:#9af0c3!important;border-color:#387763!important;}
html[data-ycw-theme='dark'] body.ycw-portal :is(.label.status,.badge.status):is(
 .status-pending,.status-Pending,.status-unpaid,.status-Unpaid,
 .status-open,.status-Open,.status-inprogress,.status-InProgress,
 .status-in-progress,.status-overdue,.status-Overdue
) {background:#403023!important;color:#ffd39e!important;border-color:#816043!important;}
html[data-ycw-theme='dark'] body.ycw-portal :is(.label.status,.badge.status):is(
 .status-suspended,.status-Suspended,.status-terminated,.status-Terminated,
 .status-fraud,.status-Fraud,.status-rejected,.status-Rejected
) {background:#452a33!important;color:#ffadb9!important;border-color:#89525f!important;}
html[data-ycw-theme='dark'] body.ycw-portal :is(.label.status,.badge.status):is(
 .status-cancelled,.status-Cancelled,.status-canceled,.status-Canceled,
 .status-closed,.status-Closed,.status-inactive,.status-Inactive,
 .status-dead,.status-Dead,.status-lost,.status-Lost
) {background:#2b384b!important;color:#c5d2e3!important;border-color:#526179!important;}
/* Keep the original status text when it is nested in a span rather than the
   label itself; inherit semantic foreground, not stale light-mode colors. */
html[data-ycw-theme='dark'] body.ycw-portal .label.status :is(span,small,strong) {color:inherit!important;}
/* Service/domain list labels can also be rendered without Bootstrap .label. */
html[data-ycw-theme='dark'] body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) .status.status-active:not(.label):not(.badge) {color:#9af0c3!important;}
html[data-ycw-theme='dark'] body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) :is(
 .ycw-service-title,.ycw-service-amount,.ycw-service-cycle,
 .ycw-domain-reg-value,.ycw-domain-due-value
) {color:var(--ycw33-text)!important;}
/* Tables: remove inconsistent bright strips and excessive shadows. */
html[data-ycw-theme='dark'] body.ycw-portal :is(.dataTables_wrapper,.table-container,.wdes-block-table) {
 border-color:var(--ycw33-line)!important;box-shadow:none!important;
}
html[data-ycw-theme='dark'] body.ycw-portal .dataTables_wrapper :is(
 .dataTables_info,.dataTables_filter,.dataTables_length,.dataTables_paginate
) {background:var(--ycw33-surface)!important;color:var(--ycw33-muted)!important;}
html[data-ycw-theme='dark'] body.ycw-portal .dataTables_wrapper .pagination :is(li,li a,li span) {box-shadow:none!important;}
/* Secondary buttons and service tabs should match the same surface palette. */
html[data-ycw-theme='dark'] body.ycw-portal :is(
 .ycw-service-detail-view .wdes-nav-tabs > li > a,
 .ycw-service-detail-view .product-details-tab-container,
 .ycw-service-detail-view .wdes-inner-block,
 .ycw-service-detail-view .product-status,
 .ycw-service-detail-view div.product-details div.product-icon,
 .ycw-service-detail-view .ycw-service-facts > *
) {background:var(--ycw33-surface)!important;border-color:var(--ycw33-line)!important;color:var(--ycw33-text)!important;}
html[data-ycw-theme='dark'] body.ycw-portal .ycw-service-detail-view .wdes-nav-tabs > li.active > a {
 background:#393028!important;border-color:#80543c!important;color:#ffb287!important;
}
html[data-ycw-theme='dark'] body.ycw-portal .ycw-service-detail-view .product-status h3 {color:var(--ycw33-text)!important;}
html[data-ycw-theme='dark'] body.ycw-portal .ycw-service-detail-view .product-status h4 {color:var(--ycw33-muted)!important;}
/* Stop the light mode's pale labels from bleeding through icon/data tabs. */
html[data-ycw-theme='dark'] body.ycw-portal .ycw-service-detail-view .wdes-inner-block h4 {color:var(--ycw33-muted)!important;}
/* Visual hover and focus without introducing global transitions. */
html[data-ycw-theme='dark'] body.ycw-portal :is(.ycw-domain-dialog-actions a,.ycw-service-dialog-actions a):hover {
 background:var(--ycw33-surface-hover)!important;border-color:#7a5b4b!important;
}
/* Accessible keyboard navigation. */
html[data-ycw-theme='dark'] body.ycw-portal :is(a,button,input,select,textarea):focus-visible {
 outline:2px solid #ffab76!important;outline-offset:2px;
}
@media print {
 html[data-ycw-theme='dark'] body.ycw-portal :is(.label.status,.badge.status) {
  background:#f3f6fa!important;color:#162a45!important;border-color:#cdd5e0!important;
 }
}
