/* DOTS Client Portal navigation and request-table repair.
   Release 2026.10.22.1-cpanel.75. Scoped to the client portal.
   Keep one-row-per-item behavior and horizontal table scrolling. */
.client-portal .portal-header{
  display:flex;align-items:center;column-gap:18px;row-gap:10px;
}
.client-portal .portal-header .reference-brand{flex:0 0 auto}
.client-portal .portal-header nav[aria-label="Client navigation"]{
  display:flex;flex:0 1 auto;align-self:center;align-items:center;
  width:max-content;max-width:100%;margin-left:auto;gap:5px;
  justify-content:flex-end;min-width:0;
}
.client-portal .portal-header nav[aria-label="Client navigation"]>button{
  flex:0 0 auto!important;width:auto!important;min-width:0!important;
  max-width:none;white-space:nowrap!important;text-align:center;
  padding-inline:12px!important;
}
.client-portal .portal-header .portal-actions{flex:0 0 auto;min-width:0;justify-content:flex-end}
/* Contain the scroll region but never shrink a table cell to one character. */
.client-portal .portal-request-editor,
.client-portal .portal-record-body{min-width:0}
.client-portal .portal-request-table{
  display:block;max-width:100%;min-width:0;
  overflow-x:auto;overflow-y:hidden;
  contain:none;
  border:1px solid var(--border,#e0e3e1);border-radius:6px;
  background:var(--card,#fff);
}
.client-portal .portal-request-table>table{
  table-layout:fixed;width:100%;min-width:1040px;
  border-collapse:collapse;border-spacing:0;
}
.client-portal .portal-request-table :is(th,td){
  box-sizing:border-box;vertical-align:middle!important;
  white-space:normal;overflow-wrap:normal;word-break:normal;
  height:auto;min-height:0;
  text-align:left;
}
.client-portal .portal-request-table thead th{
  background:color-mix(in srgb,var(--card,#fff) 94%,#e3e9e3 6%);
  font-size:12px;line-height:1.35;
  padding:10px 8px!important;
  white-space:normal;overflow-wrap:normal;word-break:normal;
  vertical-align:middle!important;
}
/* Specific columns: 38 + 220 + 300 + 80 + 150 + 166 + 46 = 1000px;
   spare width goes to the description; never let its heading collapse. */
.client-portal .portal-request-table :is(th,td):nth-child(1){width:38px!important;text-align:center}
.client-portal .portal-request-table :is(th,td):nth-child(2){width:220px!important}
.client-portal .portal-request-table :is(th,td):nth-child(3){width:300px!important;overflow-wrap:anywhere}
.client-portal .portal-request-table :is(th,td):nth-child(4){width:80px!important;text-align:center}
.client-portal .portal-request-table :is(th,td):nth-child(5){width:150px!important}
.client-portal .portal-request-table :is(th,td):nth-child(6){width:166px!important}
.client-portal .portal-request-editor .portal-request-table :is(th,td):nth-child(7){width:46px!important;text-align:center}
.client-portal .portal-request-table td input{box-sizing:border-box;width:100%;max-width:100%;min-width:0}
.client-portal .portal-request-table tbody tr{background:var(--card,#fff)}
.client-portal .portal-request-table tbody tr:hover{background:color-mix(in srgb,var(--card,#fff) 96%,var(--foreground,#333) 4%)}
@media(max-width:850px){
 .client-portal .portal-header nav[aria-label="Client navigation"]{
   order:3;flex:1 1 100%;width:100%;max-width:100%;margin-left:0;
   justify-content:flex-end;overflow-x:auto;min-height:40px;
 }
 .client-portal .portal-header .portal-actions{margin-left:auto}
 .client-portal .portal-request-table{overscroll-behavior-inline:contain}
}
@media(max-width:500px){
 .client-portal .portal-header{padding:12px 14px;gap:8px}
 .client-portal .portal-header .portal-actions{width:auto}
 .client-portal .portal-header nav[aria-label="Client navigation"]{gap:2px}
 .client-portal .portal-header nav[aria-label="Client navigation"]>button{padding-inline:8px!important;font-size:12px!important}
 .client-portal .portal-request-table :is(th,td){padding-block:8px!important}
}
@media print{
 .client-portal .portal-request-table{overflow:visible;contain:none;border:0}
 .client-portal .portal-request-table>table{width:100%;min-width:0}
 .client-portal .portal-request-table :is(th,td){width:auto!important;font-size:10px}
 .client-portal .portal-request-table thead th{background:#f4f4f4!important}
}

/* Sticky navigation refinement — 2026-10-22.
   Pure CSS; no database, routes, client permissions or save behavior changed. */
.client-portal > .portal-header {
  position: sticky;
  top: 0;
  z-index: 65;
  background: var(--card, #fff);
  box-shadow: 0 2px 8px rgba(0,0,0,.075);
}
.dots-app:not(.client-portal) > .top-navigation {
  position: sticky;
  top: 0;
  z-index: 65;
  background: var(--card, #fff);
}
/* Keep buttons compact and aligned right without a full-width stretch. */
.client-portal > .portal-header nav[aria-label="Client navigation"] {
  flex: 0 1 auto;
  justify-content: flex-end;
  margin-left: auto;
}
.client-portal > .portal-header nav[aria-label="Client navigation"] > button {
  flex: 0 0 auto !important;
}
@media (max-width: 850px) {
  .client-portal > .portal-header nav[aria-label="Client navigation"] {
    flex: 1 1 100%;
    margin-left: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
}
@media print {
  .client-portal > .portal-header,
  .dots-app > .top-navigation {
    position: static;
    box-shadow: none;
  }
}
