/* Xtreme'x ISP Manager v3.0.5 R4
   ISP-Digital-inspired compact typography, list tables, monitoring, settings and purchase UI.
   Loaded last intentionally so it can neutralize legacy min-width rules. */

:root{
  --r4-font: "Outfit", "Segoe UI", Arial, sans-serif;
  --r4-text:#334155;
  --r4-muted:#64748b;
  --r4-border:#e2e8f0;
  --r4-head:#eef4f8;
  --r4-blue:#1d4ed8;
}

html,body,button,input,select,textarea,table{font-family:var(--r4-font)!important}
body{font-size:13px;line-height:1.35;font-weight:500}
.content-area,.main-content,.reference-page-shell{font-size:13px}
.page-title,.reference-page-head h2{font-weight:700;letter-spacing:-.02em}
.text-xs{font-size:11px!important;line-height:1.3}.text-sm{font-size:12px!important}
label,.form-label{font-size:12px;font-weight:600}
.form-control{font-size:12px!important;font-weight:500;min-height:34px;padding:6px 9px}
.btn{font-size:11.5px;font-weight:600;letter-spacing:0;padding:7px 10px}
.btn-sm{font-size:11px;padding:6px 9px}.btn-xs{font-size:10.5px;padding:4px 7px}
.badge{font-size:10px!important;font-weight:650!important;line-height:1.15;padding:4px 6px!important}

/* Sidebar typography, ISP Digital density */
.sidebar{font-size:12.5px}
.sidebar .nav-link,.sidebar .nav-link-sub{font-weight:500!important;letter-spacing:0!important}
.sidebar .nav-link{font-size:12.5px!important;padding-top:8px!important;padding-bottom:8px!important}
.sidebar .nav-link-sub{font-size:11.5px!important;padding-top:6px!important;padding-bottom:6px!important}
.sidebar-brand-home{color:inherit;text-decoration:none!important;cursor:pointer}
.sidebar-brand-home:hover{color:inherit;text-decoration:none!important;background:rgba(255,255,255,.025)}
.sidebar-brand-copy strong{font-weight:700!important}.sidebar-brand-copy small{font-weight:600!important;letter-spacing:.04em!important}

/* Toolbars and cards */
.reference-table-toolbar,.client-reference-table-toolbar,.ispd-billing-table-toolbar{font-size:11.5px!important;font-weight:600!important}
.reference-table-toolbar .form-control,.client-reference-table-toolbar .form-control,.ispd-billing-table-toolbar .form-control{min-height:30px!important;height:30px!important;padding:4px 7px!important;font-size:11px!important}
.card-header h3,.card-header h4{font-size:14px!important;font-weight:700!important}
.reference-page-head p{font-size:11.5px!important}

/* Client List + Billing List: remove desktop side scroll and match ISP Digital compact density. */
@media (min-width: 1100px){
  .client-reference-list-card .table-responsive,
  .ispd-billing-table-card .table-responsive{
    overflow-x:hidden!important;
    width:100%!important;
  }
  table.client-reference-data-table,
  table.ispd-billing-table{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:fixed!important;
    border-collapse:collapse!important;
  }
  table.client-reference-data-table th,
  table.client-reference-data-table td,
  table.ispd-billing-table th,
  table.ispd-billing-table td{
    font-size:10.5px!important;
    line-height:1.22!important;
    padding:5px 4px!important;
    font-weight:550!important;
    white-space:normal!important;
    overflow-wrap:anywhere;
    vertical-align:middle!important;
  }
  table.client-reference-data-table th,
  table.ispd-billing-table th{
    font-size:9.9px!important;
    font-weight:700!important;
    text-transform:none!important;
    letter-spacing:0!important;
    background:#edf3f7!important;
    color:#34465a!important;
  }
  table.client-reference-data-table td b,
  table.client-reference-data-table td strong,
  table.ispd-billing-table td b,
  table.ispd-billing-table td strong{font-weight:650!important}

  /* client list 12 cols */
  table.client-reference-data-table th:nth-child(1),table.client-reference-data-table td:nth-child(1){width:2.2%}
  table.client-reference-data-table th:nth-child(2),table.client-reference-data-table td:nth-child(2){width:5.5%}
  table.client-reference-data-table th:nth-child(3),table.client-reference-data-table td:nth-child(3){width:8.8%}
  table.client-reference-data-table th:nth-child(4),table.client-reference-data-table td:nth-child(4){width:11%}
  table.client-reference-data-table th:nth-child(5),table.client-reference-data-table td:nth-child(5){width:8%}
  table.client-reference-data-table th:nth-child(6),table.client-reference-data-table td:nth-child(6){width:8%}
  table.client-reference-data-table th:nth-child(7),table.client-reference-data-table td:nth-child(7){width:7.5%}
  table.client-reference-data-table th:nth-child(8),table.client-reference-data-table td:nth-child(8){width:13.5%}
  table.client-reference-data-table th:nth-child(9),table.client-reference-data-table td:nth-child(9){width:6%}
  table.client-reference-data-table th:nth-child(10),table.client-reference-data-table td:nth-child(10){width:7%}
  table.client-reference-data-table th:nth-child(11),table.client-reference-data-table td:nth-child(11){width:7%}
  table.client-reference-data-table th:nth-child(12),table.client-reference-data-table td:nth-child(12){width:15.5%}

  /* billing list 14 cols */
  table.ispd-billing-table th:nth-child(1),table.ispd-billing-table td:nth-child(1){width:2%}
  table.ispd-billing-table th:nth-child(2),table.ispd-billing-table td:nth-child(2){width:4.8%}
  table.ispd-billing-table th:nth-child(3),table.ispd-billing-table td:nth-child(3){width:7.2%}
  table.ispd-billing-table th:nth-child(4),table.ispd-billing-table td:nth-child(4){width:9.4%}
  table.ispd-billing-table th:nth-child(5),table.ispd-billing-table td:nth-child(5){width:7.2%}
  table.ispd-billing-table th:nth-child(6),table.ispd-billing-table td:nth-child(6){width:6.8%}
  table.ispd-billing-table th:nth-child(7),table.ispd-billing-table td:nth-child(7){width:11.2%}
  table.ispd-billing-table th:nth-child(8),table.ispd-billing-table td:nth-child(8){width:6.2%}
  table.ispd-billing-table th:nth-child(9),table.ispd-billing-table td:nth-child(9){width:5.5%}
  table.ispd-billing-table th:nth-child(10),table.ispd-billing-table td:nth-child(10){width:6.2%}
  table.ispd-billing-table th:nth-child(11),table.ispd-billing-table td:nth-child(11){width:6.6%}
  table.ispd-billing-table th:nth-child(12),table.ispd-billing-table td:nth-child(12){width:5.8%}
  table.ispd-billing-table th:nth-child(13),table.ispd-billing-table td:nth-child(13){width:5.8%}
  table.ispd-billing-table th:nth-child(14),table.ispd-billing-table td:nth-child(14){width:15.3%}

  table.client-reference-data-table .btn,
  table.ispd-billing-table .btn{font-size:9.7px!important;padding:3px 5px!important;min-height:24px!important;line-height:1.05!important}
  table.client-reference-data-table .badge,
  table.ispd-billing-table .badge{font-size:9.2px!important;padding:3px 5px!important}
}

/* Online monitoring: ISP Digital-like compact control strip and data table. */
.ispd-monitor-page{font-size:12px!important}
.ispd-monitor-page .monitor-mode-tabs{gap:4px!important;margin-bottom:8px!important}
.ispd-monitor-page .monitor-mode-tabs button{font-size:10.5px!important;font-weight:650!important;padding:6px 9px!important}
.ispd-monitor-page .monitor-kpi-grid{gap:8px!important;margin-bottom:9px!important}
.ispd-monitor-page .monitor-kpi-card{min-height:70px!important;padding:10px 12px!important}
.ispd-monitor-page .monitor-kpi-card span{font-size:10.5px!important;font-weight:600!important}
.ispd-monitor-page .monitor-kpi-card strong{font-size:22px!important;font-weight:700!important}
.monitor-filter-grid{gap:7px!important;grid-template-columns:repeat(7,minmax(0,1fr))!important}
.monitor-filter-grid label{font-size:10.5px!important;font-weight:650!important;margin-bottom:3px!important}
.monitor-filter-grid .form-control{font-size:10.8px!important;height:30px!important;min-height:30px!important;padding:4px 6px!important}
.monitor-table-card .reference-table-toolbar{padding:7px 9px!important}
.monitor-toolbar-right{gap:5px!important}.monitor-toolbar-right .config-search{width:150px!important}

@media (min-width: 1200px){
  .monitor-table-wrap{overflow-x:hidden!important;width:100%!important}
  table.monitor-table{
    width:100%!important;min-width:0!important;max-width:100%!important;table-layout:fixed!important;
  }
  table.monitor-table th,table.monitor-table td{
    padding:4px 3px!important;font-size:9.5px!important;line-height:1.18!important;font-weight:550!important;
    white-space:normal!important;overflow-wrap:anywhere;vertical-align:middle!important;
  }
  table.monitor-table th{font-size:9px!important;font-weight:700!important;letter-spacing:0!important;text-transform:none!important;background:#edf3f7!important;color:#34465a!important}
  table.monitor-table th:nth-child(1),table.monitor-table td:nth-child(1){width:4%}
  table.monitor-table th:nth-child(2),table.monitor-table td:nth-child(2){width:6.5%}
  table.monitor-table th:nth-child(3),table.monitor-table td:nth-child(3){width:8.5%}
  table.monitor-table th:nth-child(4),table.monitor-table td:nth-child(4){width:6.5%}
  table.monitor-table th:nth-child(5),table.monitor-table td:nth-child(5){width:6.8%}
  table.monitor-table th:nth-child(6),table.monitor-table td:nth-child(6){width:7.5%}
  table.monitor-table th:nth-child(7),table.monitor-table td:nth-child(7){width:8%}
  table.monitor-table th:nth-child(8),table.monitor-table td:nth-child(8){width:4.2%}
  table.monitor-table th:nth-child(9),table.monitor-table td:nth-child(9){width:6.8%}
  table.monitor-table th:nth-child(10),table.monitor-table td:nth-child(10){width:6.2%}
  table.monitor-table th:nth-child(11),table.monitor-table td:nth-child(11){width:7.4%}
  table.monitor-table th:nth-child(12),table.monitor-table td:nth-child(12){width:8.5%}
  table.monitor-table th:nth-child(13),table.monitor-table td:nth-child(13){width:5.5%}
  table.monitor-table th:nth-child(14),table.monitor-table td:nth-child(14){width:7%}
  table.monitor-table th:nth-child(15),table.monitor-table td:nth-child(15){width:6.6%}
  .monitor-live-rate,.monitor-session-usage{display:flex!important;flex-direction:column!important;gap:1px!important;font-size:8.9px!important;white-space:nowrap!important}
  .monitor-session-usage small{font-size:8.3px!important}.monitor-status{font-size:8.8px!important;padding:3px 4px!important}
  .monitor-actions{display:flex!important;flex-wrap:wrap!important;gap:2px!important}
  .monitor-actions button{width:21px!important;height:21px!important;font-size:8.5px!important;padding:0!important}
  table.monitor-table code{font-size:8.8px!important}
}

/* Keep usable horizontal scrolling on smaller screens where forcing all columns would become unreadable. */
@media (max-width:1199px){.monitor-table-wrap{overflow-x:auto!important}.monitor-table{min-width:1180px!important}}
@media (max-width:1099px){.client-reference-list-card .table-responsive,.ispd-billing-table-card .table-responsive{overflow-x:auto!important}.client-reference-data-table{min-width:980px!important}.ispd-billing-table{min-width:1120px!important}}

/* Settings: Company and Invoice template editor */
.settings-section-head{margin-bottom:14px;padding-bottom:10px;border-bottom:1px solid rgba(148,163,184,.18)}
.settings-section-head h4{margin:0 0 4px;font-size:15px;font-weight:700}.settings-section-head p{margin:0;font-size:11.5px;color:var(--r4-muted)}
.invoice-template-grid{display:grid;gap:7px}
.invoice-template-row{display:grid;grid-template-columns:minmax(150px,.8fr) 110px minmax(180px,1.4fr);gap:8px;align-items:center;padding:8px 10px;border:1px solid rgba(148,163,184,.18);border-radius:7px;background:rgba(148,163,184,.035)}
.invoice-template-row>strong{font-size:11.5px;font-weight:650}.invoice-template-row .form-control{margin:0}
@media(max-width:760px){.invoice-template-row{grid-template-columns:1fr}.monitor-filter-grid{grid-template-columns:1fr 1fr!important}}

/* Purchase module */
.purchase-page .purchase-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
.purchase-page .purchase-kpi{border:1px solid rgba(148,163,184,.18);border-radius:8px;padding:10px 12px;background:rgba(255,255,255,.025)}
.purchase-page .purchase-kpi span{font-size:10.5px;color:var(--r4-muted);font-weight:600}.purchase-page .purchase-kpi strong{display:block;font-size:19px;margin-top:2px;font-weight:700}
.purchase-page .purchase-line-grid{display:grid;grid-template-columns:minmax(180px,2fr) 80px 105px 105px 90px 34px;gap:6px;align-items:end;margin-bottom:6px}
.purchase-page .purchase-line-grid label{font-size:10px}.purchase-page .purchase-line-grid .form-control{height:32px;min-height:32px}
.purchase-page .purchase-summary{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px;margin-top:10px}
.purchase-page .reference-data-table th,.purchase-page .reference-data-table td{font-size:11px!important;padding:6px!important}
@media(max-width:900px){.purchase-page .purchase-kpi-grid,.purchase-page .purchase-summary{grid-template-columns:1fr 1fr}.purchase-page .purchase-line-grid{grid-template-columns:1fr 1fr}.purchase-page .purchase-line-grid>*{min-width:0}}

/* General desktop tables: slightly denser like ISP Digital without forcing tiny global text. */
@media(min-width:1100px){
  .reference-data-table:not(.monitor-table) th,.reference-data-table:not(.monitor-table) td{font-size:10.8px!important;padding:6px 5px!important}
  .table th{font-weight:700}.table td{font-weight:520}
}
@media (min-width:1100px){
  .client-row-actions{display:flex!important;flex-wrap:wrap!important;gap:2px!important;align-items:center!important}
  .client-row-actions button{width:22px!important;height:22px!important;padding:0!important;font-size:9px!important}
  .ispd-billing-table td:last-child>div,.ispd-billing-table td:last-child .flex{display:flex!important;flex-wrap:wrap!important;gap:2px!important}
}
/* High-specificity final overrides for the legacy list stylesheet. */
@media (min-width:1100px){
 body.xtx-list-ui-enabled.xtx-client-list table.xtx-ispdigital-table.client-reference-data-table,
 body.xtx-list-ui-enabled .client-reference-data-table,
 body.xtx-list-ui-enabled.xtx-billing-list table.xtx-ispdigital-table.ispd-billing-table,
 body.xtx-list-ui-enabled .ispd-billing-table{
   width:100%!important;min-width:0!important;max-width:100%!important;table-layout:fixed!important;font-size:10.5px!important;
 }
 body.xtx-list-ui-enabled .client-reference-table-card .table-responsive,
 body.xtx-list-ui-enabled .ispd-billing-table-card .table-responsive{overflow-x:hidden!important;scrollbar-gutter:auto!important}
 body.xtx-list-ui-enabled .client-reference-data-table thead th,
 body.xtx-list-ui-enabled .ispd-billing-table thead th{font-size:9.9px!important;line-height:1.18!important;padding:5px 4px!important;white-space:normal!important;min-width:0!important}
 body.xtx-list-ui-enabled .client-reference-data-table tbody td,
 body.xtx-list-ui-enabled .ispd-billing-table tbody td{font-size:10.5px!important;line-height:1.22!important;padding:5px 4px!important;white-space:normal!important;min-width:0!important;overflow-wrap:anywhere!important}
 body.xtx-list-ui-enabled .client-reference-data-table th:last-child,
 body.xtx-list-ui-enabled .ispd-billing-table th:last-child,
 body.xtx-list-ui-enabled .client-reference-data-table td:last-child,
 body.xtx-list-ui-enabled .ispd-billing-table td:last-child,
 body.xtx-list-ui-enabled .client-reference-data-table td.xtx-action-cell,
 body.xtx-list-ui-enabled .ispd-billing-table td.xtx-action-cell{position:static!important;right:auto!important;min-width:0!important;box-shadow:none!important}
 body.xtx-list-ui-enabled .client-reference-data-table code,
 body.xtx-list-ui-enabled .ispd-billing-table code{font-size:9.8px!important}
}
@media (min-width:1200px){
 .ispd-monitor-page .monitor-table-wrap{overflow-x:hidden!important}
 .ispd-monitor-page table.monitor-table{width:100%!important;min-width:0!important;max-width:100%!important;table-layout:fixed!important}
 .ispd-monitor-page .monitor-table thead th{font-size:9px!important;font-weight:700!important;line-height:1.15!important;padding:4px 3px!important;white-space:normal!important;min-width:0!important}
 .ispd-monitor-page .monitor-table tbody td{font-size:9.5px!important;font-weight:550!important;line-height:1.18!important;padding:4px 3px!important;white-space:normal!important;overflow-wrap:anywhere!important;min-width:0!important}
 .ispd-monitor-page .monitor-table tbody td b,.ispd-monitor-page .monitor-table .link-button{font-weight:650!important}
 .ispd-monitor-page .monitor-table code{font-size:8.8px!important;font-weight:600!important}
 .ispd-monitor-page .monitor-status{font-size:8.8px!important;font-weight:700!important;padding:3px 4px!important}
 .ispd-monitor-page .monitor-live-rate,.ispd-monitor-page .monitor-session-usage{font-size:8.9px!important;font-weight:650!important;line-height:1.12!important}
 .ispd-monitor-page .monitor-session-usage small,.ispd-monitor-page .monitor-sampling small{font-size:8.2px!important}
 .ispd-monitor-page .monitor-actions button{width:21px!important;height:21px!important;font-size:8.5px!important}
 .ispd-monitor-page .reference-monitor-filter{grid-template-columns:repeat(7,minmax(0,1fr))!important;gap:7px!important}
 .ispd-monitor-page .reference-monitor-filter label{font-size:10.5px!important;font-weight:650!important}
 .ispd-monitor-page .reference-monitor-filter .form-control{font-size:10.8px!important;font-weight:550!important;min-height:30px!important;height:30px!important}
 .ispd-monitor-page .monitor-table-card .reference-table-toolbar,.ispd-monitor-page .monitor-toolbar-right label{font-size:10.5px!important;font-weight:650!important}
 .ispd-monitor-page .monitor-toolbar-right .config-search{font-size:10.8px!important;height:30px!important}
 .ispd-monitor-page .monitor-mode-tabs button,.ispd-monitor-page .monitor-inline-sync{font-size:10.5px!important;font-weight:650!important}
 .ispd-monitor-page .reference-monitor-kpis .monitor-kpi span{font-size:10.5px!important;font-weight:650!important}
 .ispd-monitor-page .reference-monitor-kpis .monitor-kpi strong{font-size:22px!important;font-weight:700!important}
}
.invoice-template-row>div strong{display:block;font-size:11.5px;font-weight:650;color:inherit}
.invoice-template-row>div small{display:block;margin-top:2px;font-size:9.5px;line-height:1.25;color:var(--r4-muted)}

/* R6.3 targeted functional UI refinements. Existing visual language is preserved. */
.push-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.push-settings-grid .card{min-width:0}.onu-live-grid b{text-transform:none}.monitor-subline{display:block;margin-top:3px;color:var(--text-muted);font-size:10px;font-weight:400;white-space:normal}.monitor-table td,.monitor-table th{padding-top:7px!important;padding-bottom:7px!important;vertical-align:middle}.monitor-table .monitor-actions{white-space:nowrap}.monitor-filter-grid{grid-template-columns:repeat(auto-fit,minmax(145px,1fr))!important}
@media(max-width:900px){.push-settings-grid{grid-template-columns:1fr}.monitor-table{min-width:1180px}}


/* R6.4 UI performance patch: no page-shell fade/reflow, lightweight route progress only. */
#content-area{position:relative}
#content-area > .animate-fade-in{animation:none!important;opacity:1!important}
#content-area.xtx-route-loading{cursor:progress}
#content-area.xtx-route-loading::before{
 content:"";position:fixed;z-index:10050;top:0;left:var(--sidebar-width,260px);height:2px;width:32%;
 background:var(--primary,#2563eb);box-shadow:0 0 10px rgba(37,99,235,.35);pointer-events:none;
 animation:xtxRouteProgress .75s ease-in-out infinite alternate;
}
.sidebar.collapsed ~ .main-content #content-area.xtx-route-loading::before{left:78px}
@media(max-width:992px){#content-area.xtx-route-loading::before{left:0}}
@keyframes xtxRouteProgress{from{transform:translateX(-35%);opacity:.55}to{transform:translateX(225%);opacity:1}}
@media(prefers-reduced-motion:reduce){#content-area.xtx-route-loading::before{animation:none;width:100%}}

/* R6.6.54 BILLING LIST SCROLL PARITY
   Billing List must use the page/main scrollbar like Client List.
   Keep horizontal table scrolling where required, but never create a second
   vertical scrollbar inside the Billing List table card. */
body.xtx-list-ui-enabled.xtx-billing-list .ispd-billing-table-card .table-responsive{
  max-height:none!important;
  height:auto!important;
  overflow-y:visible!important;
  overscroll-behavior-y:auto!important;
  scrollbar-gutter:auto!important;
}
@media (max-width:1180px){
  body.xtx-list-ui-enabled.xtx-billing-list .ispd-billing-table-card .table-responsive{
    max-height:none!important;
    height:auto!important;
    overflow-x:auto!important;
    overflow-y:visible!important;
  }
}
