/* YCW Portal RC44 | Final interface consistency
 * Targets: client services, domains, DataTables pagination and context navigation.
 * Preserves native WHMCS links, form actions, filtering, sorting and registration.
 * The orderform /cart.php?a=add&domain=register remains the design reference.
 */

/* Single pagination outline: Bootstrap/legacy li wrappers are not buttons. */
body.ycw-portal .dataTables_wrapper .dataTables_paginate :is(.pagination,.pagination > li),
body.ycw-portal .dataTables_wrapper .dataTables_paginate :is(.pagination,.pagination > li)::before,
body.ycw-portal .dataTables_wrapper .dataTables_paginate :is(.pagination,.pagination > li)::after {
  border:0!important;
  outline:0!important;
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}
body.ycw-portal .dataTables_wrapper .dataTables_paginate .pagination {
  display:flex!important;
  flex-wrap:wrap;
  align-items:center;
  gap:8px!important;
  padding:0!important;
  margin:0!important;
  border-radius:0!important;
  list-style:none!important;
}
body.ycw-portal .dataTables_wrapper .dataTables_paginate .pagination > li {
  display:block!important;
  flex:0 0 auto!important;
  min-width:0!important;
  width:auto!important;
  height:auto!important;
  padding:0!important;
  margin:0!important;
  border-radius:0!important;
  overflow:visible!important;
}
body.ycw-portal .dataTables_wrapper .dataTables_paginate .pagination > li > :is(a,span) {
  box-sizing:border-box!important;
  position:relative;
  display:inline-flex!important;
  min-width:40px;
  min-height:40px;
  width:auto!important;
  height:auto!important;
  align-items:center;
  justify-content:center;
  padding:9px 13px!important;
  margin:0!important;
  border:1px solid var(--ycw-line,#dce5ef)!important;
  border-radius:11px!important;
  box-shadow:none!important;
  outline:0!important;
  line-height:1.35!important;
  white-space:nowrap;
  text-decoration:none!important;
}
body.ycw-portal .dataTables_wrapper .dataTables_paginate .pagination > li > :is(a,span)::before,
body.ycw-portal .dataTables_wrapper .dataTables_paginate .pagination > li > :is(a,span)::after {
  border:0!important;
  box-shadow:none!important;
}
body.ycw-portal .dataTables_wrapper .dataTables_paginate .pagination > li > a:focus-visible {
  outline:2px solid #ff5900!important;
  outline-offset:3px!important;
}
body.ycw-portal .dataTables_wrapper .dataTables_paginate .pagination > li.active > :is(a,span),
body.ycw-portal .dataTables_wrapper .dataTables_paginate .pagination > li > a:hover:not(.disabled) {
  color:#fff!important;
  background:#ff5900!important;
  border-color:#ff5900!important;
}
html[data-ycw-theme='dark'] body.ycw-portal .dataTables_wrapper .dataTables_paginate .pagination > li > :is(a,span) {
  background:#24364d!important;
  color:#dfeafa!important;
  border-color:#435975!important;
}
html[data-ycw-theme='dark'] body.ycw-portal .dataTables_wrapper .dataTables_paginate .pagination > li.active > :is(a,span),
html[data-ycw-theme='dark'] body.ycw-portal .dataTables_wrapper .dataTables_paginate .pagination > li > a:hover:not(.disabled) {
  background:#ff5900!important;
  border-color:#ff5900!important;
  color:#fff!important;
}

/* Only the containing list surface gets the outer edge.
 * Do not give DataTables itself, its grid rows or pagination wrappers another ring. */
body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) .dataTables_wrapper,
body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) .dataTables_wrapper > .row,
body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) .dataTables_wrapper > .listtable {
  border-left:0!important;
  border-right:0!important;
  box-shadow:none!important;
}
body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) .dataTables_wrapper > .dataTables_paginate {
  border-left:0!important;
  border-right:0!important;
  box-shadow:none!important;
}
@media (max-width:767px) {
  body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) .dataTables_wrapper table.table-list,
  body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) .dataTables_wrapper > .listtable table.table-list {
    border:0!important;
    box-shadow:none!important;
  }
  body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) .dataTables_wrapper .dataTables_filter input {
    box-sizing:border-box!important;
    max-width:100%!important;
    min-width:0!important;
  }
  body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) .dataTables_wrapper .dataTables_paginate .pagination {
    justify-content:flex-start!important;
  }
}

/* RC43 mobile service and domain cards had an unconditional white !important
 * background in each Smarty template. Override at the theme state, not with JS. */
@media (max-width:767px) {
  html[data-ycw-theme='dark'] body.ycw-portal #ycw-services-view table#tableServicesList > tbody > tr,
  html[data-ycw-theme='dark'] body.ycw-portal #ycw-domains-view table#tableDomainsList > tbody > tr {
    background:#1f2f46!important;
    background-color:#1f2f46!important;
    background-image:none!important;
    border:1px solid #405674!important;
    color:#eaf2fd!important;
    box-shadow:none!important;
  }
  html[data-ycw-theme='dark'] body.ycw-portal #ycw-services-view table#tableServicesList > tbody > tr > td,
  html[data-ycw-theme='dark'] body.ycw-portal #ycw-domains-view table#tableDomainsList > tbody > tr > td {
    background:transparent!important;
    border:0!important;
    color:#dce7f6!important;
    box-shadow:none!important;
  }
  html[data-ycw-theme='dark'] body.ycw-portal #ycw-services-view :is(.ycw-service-title,.ycw-service-title strong),
  html[data-ycw-theme='dark'] body.ycw-portal #ycw-domains-view .ycw-domain-name-cell .ycw-domain-name {
    color:#f0f5ff!important;
  }
  html[data-ycw-theme='dark'] body.ycw-portal #ycw-services-view .ycw-service-domain,
  html[data-ycw-theme='dark'] body.ycw-portal #ycw-domains-view .ycw-domain-name-cell .ycw-domain-subtitle {
    color:#b6c8de!important;
  }
  html[data-ycw-theme='dark'] body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) .dataTables_wrapper,
  html[data-ycw-theme='dark'] body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) .dataTables_wrapper > .listtable,
  html[data-ycw-theme='dark'] body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) .dataTables_wrapper > .row {
    background:transparent!important;
    background-image:none!important;
  }
  html[data-ycw-theme='dark'] body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) table.table-list > tbody {
    background:transparent!important;
  }
  /* No native responsive + marker or secondary ring on a card's first cell. */
  body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) table.table-list.dtr-inline.collapsed > tbody > tr > :first-child::before {
    content:none!important;
    display:none!important;
    border:0!important;
  }
}

/* Desktop dark rows stay opaque without adding a second surrounding table line. */
html[data-ycw-theme='dark'] body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) table.table-list > tbody > tr > td {
  background-color:#1b293c!important;
  color:#e2eafa!important;
}
html[data-ycw-theme='dark'] body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) table.table-list > tbody > tr:hover > td {
  background-color:#24364e!important;
}
@media(max-width:767px){
  html[data-ycw-theme='dark'] body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) table.table-list > tbody > tr > td,
  html[data-ycw-theme='dark'] body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) table.table-list > tbody > tr:hover > td {
    background:transparent!important;
  }
}

/* Context navigation: preserve the neat appearance used by domain registration.
 * One panel border, one divider between rows, readable left-to-right alignment.
 * The badge is emitted before the label by WHMCS: display order corrects that. */
body.ycw-portal #ycw-context-sidebar .panel-sidebar {
  box-sizing:border-box!important;
  box-shadow:none!important;
}
body.ycw-portal #ycw-context-sidebar .panel-sidebar > .panel-heading {
  border-top:0!important;
  border-right:0!important;
  border-left:0!important;
  box-shadow:none!important;
}
body.ycw-portal #ycw-context-sidebar .panel-sidebar > .panel-heading .panel-title {
  display:flex!important;
  width:100%!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  margin:0!important;
  text-align:left!important;
}
body.ycw-portal #ycw-context-sidebar .panel-sidebar > .panel-heading .ycw-context-heading-main {
  display:inline-flex!important;
  flex:1 1 auto!important;
  min-width:0!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  text-align:left!important;
}
body.ycw-portal #ycw-context-sidebar .panel-sidebar .list-group {
  border:0!important;
  border-radius:0!important;
  margin:0!important;
  padding:0!important;
  box-shadow:none!important;
}
body.ycw-portal #ycw-context-sidebar .panel-sidebar .list-group > .list-group-item {
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-height:48px!important;
  margin:0!important;
  padding:13px 15px!important;
  border:0!important;
  border-bottom:1px solid #e8edf5!important;
  border-radius:0!important;
  box-shadow:none!important;
  background-image:none!important;
  text-align:left!important;
  text-indent:0!important;
  white-space:normal!important;
}
body.ycw-portal #ycw-context-sidebar .panel-sidebar .list-group > .list-group-item:last-child {
  border-bottom:0!important;
}
body.ycw-portal #ycw-context-sidebar .panel-sidebar .list-group > .list-group-item > .badge {
  order:3!important;
  flex:0 0 auto!important;
  margin:0 0 0 auto!important;
  float:none!important;
  line-height:1.4!important;
}
body.ycw-portal #ycw-context-sidebar .panel-sidebar .list-group > .list-group-item > :is(.sidebar-menu-item-icon,.wdes-sidebar-icon) {
  order:0!important;
  flex:0 0 18px!important;
  width:18px!important;
  margin:0!important;
  text-align:center!important;
}
body.ycw-portal #ycw-context-sidebar .panel-sidebar .panel-title .panel-minimise {
  flex:0 0 26px!important;
  float:none!important;
  margin:0 0 0 auto!important;
}
html[data-ycw-theme='dark'] body.ycw-portal #ycw-context-sidebar .panel-sidebar {
  border:1px solid #3c506a!important;
  background:#1c2a3e!important;
}
html[data-ycw-theme='dark'] body.ycw-portal #ycw-context-sidebar .panel-sidebar > .panel-heading {
  border-bottom:1px solid #344760!important;
  background:#23334b!important;
}
html[data-ycw-theme='dark'] body.ycw-portal #ycw-context-sidebar .panel-sidebar .list-group > .list-group-item {
  border-bottom:1px solid #364a64!important;
  background:transparent!important;
  color:#e5eefb!important;
}
html[data-ycw-theme='dark'] body.ycw-portal #ycw-context-sidebar .panel-sidebar .list-group > .list-group-item:last-child {
  border-bottom:0!important;
}
html[data-ycw-theme='dark'] body.ycw-portal #ycw-context-sidebar .panel-sidebar .list-group > .list-group-item:is(:hover,:focus-visible) {
  background:#2a3b52!important;
  color:#fff!important;
}
html[data-ycw-theme='dark'] body.ycw-portal #ycw-context-sidebar .panel-sidebar .list-group > .list-group-item.active {
  background:#332d30!important;
  color:#ff9b67!important;
  box-shadow:inset 3px 0 0 #ff5900!important;
}

/* Opaque dark dialog panels and text remain readable when opened from a card. */
html[data-ycw-theme='dark'] body.ycw-portal :is(.ycw-service-dialog-surface,.ycw-domain-dialog-surface) {
  background:#1b293e!important;
  border-color:#405471!important;
  color:#eaf2ff!important;
}
html[data-ycw-theme='dark'] body.ycw-portal :is(.ycw-service-dialog-surface,.ycw-domain-dialog-surface) :is(h2,h3,.ycw-service-dialog-content h3,.ycw-domain-dialog-section-title,.ycw-service-dialog-stats strong,.ycw-domain-dialog-stat strong) {
  color:#eff5ff!important;
}
html[data-ycw-theme='dark'] body.ycw-portal :is(.ycw-service-dialog-stats > div,.ycw-domain-dialog-stat,.ycw-service-dialog-actions a,.ycw-domain-dialog-actions a) {
  background:#23364d!important;
  border-color:#3c5370!important;
  color:#e4edfa!important;
}
html[data-ycw-theme='dark'] body.ycw-portal :is(.ycw-service-dialog-subtitle,.ycw-domain-dialog-domain,.ycw-service-dialog-stats span,.ycw-domain-dialog-stat > span) {
  color:#b6c8df!important;
}
html[data-ycw-theme='dark'] body.ycw-portal :is(.ycw-service-dialog-close,.ycw-domain-dialog-close,.ycw-service-dialog-done,.ycw-domain-dialog-done) {
  background:#2a3b53!important;
  border-color:#465e7c!important;
  color:#eaf2fe!important;
}

/* Print remains white even if a saved theme preference is dark. */
@media print {
  html[data-ycw-theme='dark'] body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) table.table-list > tbody > tr,
  html[data-ycw-theme='dark'] body.ycw-portal :is(#ycw-services-view,#ycw-domains-view) table.table-list > tbody > tr > td {
    background:#fff!important;
    color:#172b4b!important;
    box-shadow:none!important;
  }
}
