/* UtiliNexus 2.8.45.18 — Multi-branch + geographic marketplace */

.unx-business-identity{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:6px;
  font-size:12px;
}
.unx-business-identity span{
  color:#7390aa;
  font-size:9px;
  letter-spacing:.12em;
  font-weight:900;
}
.unx-business-identity b{color:#eef7ff}

.unx-contractor-org-banner{
  display:flex;
  gap:8px;
  align-items:center;
  margin:5px 0 8px;
}
.unx-contractor-org-banner span{
  color:#6f8da9;
  font-size:10px;
  letter-spacing:.13em;
  font-weight:900;
}
.unx-contractor-org-banner b{
  color:#fff;
  font-size:16px;
}

.unx-branch-modal{
  width:min(1120px,100%);
  max-height:min(92vh,980px);
  overflow:auto;
}

.unx-branch-title-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:18px;
}
.unx-branch-title-row h2{margin:4px 0}
.unx-branch-title-row p{margin:0}

.unx-company-trades{
  border:1px solid #203d57;
  border-radius:16px;
  padding:16px;
  background:#081827;
  margin-bottom:18px;
}
.unx-company-trades .section-head{margin-bottom:10px}

.unx-trade-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
.unx-trade-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr))}
.unx-trade-check{
  display:flex!important;
  align-items:center;
  gap:8px;
  margin:0!important;
  padding:9px 10px;
  border:1px solid #28445d;
  border-radius:11px;
  background:#0a1a2a;
  font-size:12px!important;
  cursor:pointer;
}
.unx-trade-check:has(input:checked){
  border-color:#1677ff;
  background:#12325a;
}
.unx-trade-check input{
  width:auto!important;
  accent-color:#1677ff;
}

.unx-org-tree{
  position:relative;
  padding:5px 0 5px 0;
}
.unx-trunk-card{
  display:flex;
  align-items:center;
  gap:12px;
  border:1px solid #2f6daa;
  border-radius:15px;
  background:linear-gradient(120deg,#0d2b4c,#0a1a2a);
  padding:15px;
  width:min(460px,100%);
}
.unx-tree-icon{
  width:42px;height:42px;border-radius:12px;
  display:grid;place-items:center;
  background:#1677ff22;color:#6badff;
}
.unx-trunk-card div{display:grid}
.unx-trunk-card small{color:#6fa7dd;font-size:9px;letter-spacing:.13em;font-weight:900}
.unx-trunk-card b{font-size:17px;margin:2px 0}
.unx-trunk-card span:last-child{font-size:11px;color:#8da4b9}

.unx-branches-list{
  position:relative;
  display:grid;
  gap:10px;
  margin:13px 0 0 34px;
  padding-left:24px;
  border-left:2px solid #1e4e7a;
}
.unx-branch-card{
  position:relative;
  border:1px solid #233f58;
  border-radius:14px;
  background:#091827;
  padding:14px;
}
.unx-branch-card.inactive{opacity:.6}
.unx-branch-tree-line{
  position:absolute;
  width:24px;height:2px;
  background:#1e4e7a;
  left:-25px;top:31px;
}
.unx-branch-card-main{
  display:grid;
  grid-template-columns:1fr auto;
  gap:14px;
}
.unx-branch-card-head{
  display:flex;gap:10px;align-items:center;
}
.unx-branch-card-head h3{margin:0}
.unx-branch-card p{color:#9aafc2;margin:6px 0}
.unx-branch-meta{
  display:flex;flex-wrap:wrap;gap:8px;
}
.unx-branch-meta span{
  font-size:11px;color:#91a7ba;
  background:#ffffff08;
  border:1px solid #ffffff0b;
  border-radius:999px;
  padding:5px 7px;
}
.unx-trade-chips{
  display:flex;flex-wrap:wrap;gap:5px;margin-top:9px;
}
.unx-trade-chips span{
  font-size:10px;
  border:1px solid #225b93;
  color:#8cc1ff;
  border-radius:999px;padding:4px 7px;
}
.unx-trade-chips .inherit{border-color:#355067;color:#9eb1c2}
.unx-branch-actions{
  display:flex;gap:7px;align-items:start;
}
.unx-branch-actions button{padding:8px 11px}

.unx-empty-branches{
  border:1px dashed #36516b;
  border-radius:14px;
  padding:18px;
  color:#c7d6e4;
}
.unx-empty-branches p{color:#8da4b9;margin-bottom:0}

.unx-branch-help{
  display:grid;gap:5px;
  border:1px solid #1f466d;
  background:#0b2037;
  padding:13px 14px;
  border-radius:13px;
  margin-top:16px;
}
.unx-branch-help span{color:#8fa8be;font-size:12px;line-height:1.5}

.unx-branch-editor-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(360px,.9fr);
  gap:18px;
}
.unx-branch-editor-grid label{
  display:block;
  font-size:12px;
  font-weight:800;
  margin:12px 0 6px;
}
.unx-branch-editor-grid input,
.unx-branch-editor-grid select,
.unx-simple-request input,
.unx-simple-request select,
.unx-simple-request textarea{
  width:100%;
  border:1px solid #34516c;
  background:#0a1a2a;
  color:#fff;
  border-radius:11px;
  padding:11px 12px;
}
.unx-radius-input{
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:7px;
}
.unx-radius-input span{color:#91a7ba;font-size:11px}

.unx-geocode-row{
  display:flex;align-items:center;gap:10px;
  margin:8px 0;
}
.unx-geocode-row span{
  font-size:11px;color:#8da7bd;
}
.unx-radius-map-head{
  display:flex;justify-content:space-between;gap:10px;
  margin:12px 0 7px;
}
.unx-radius-map-head span{font-size:11px;color:#839aae}
.unx-radius-map{
  height:440px;
  border:1px solid #294a66;
  border-radius:14px;
  overflow:hidden;
  background:#081521;
}
.unx-radius-map-note{
  color:#7892a8;font-size:10px;line-height:1.45;margin-top:7px;
}
.unx-branch-trade-box{
  margin-top:13px;
  border-top:1px solid #1d3449;
  padding-top:12px;
}
.unx-modal-actions{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:18px;
}

.unx-team-list{display:grid;gap:8px;margin-top:15px}
.unx-team-row{
  display:grid!important;
  grid-template-columns:auto 1fr auto auto;
  align-items:center;
  gap:10px;
  margin:0!important;
  border:1px solid #26435c;
  border-radius:12px;
  padding:11px 12px;
  background:#091827;
}
.unx-team-row input{width:auto!important}
.unx-team-row div{display:grid}
.unx-team-row div span{font-size:10px;color:#7f97aa}
.unx-team-row small{color:#72e0b3}

.unx-signup-trades{
  border:1px solid #2e4c68;
  border-radius:14px;
  padding:12px;
  margin:13px 0;
  background:#071827;
}
.unx-signup-trades-head{display:grid;gap:3px;margin-bottom:9px}
.unx-signup-trades-head small{color:#8da4b9;line-height:1.4}

.unx-simple-request{
  display:grid;
  gap:12px;
}
.unx-simple-step{
  display:grid;
  grid-template-columns:40px 1fr;
  gap:11px;
  border:1px solid #233e56;
  border-radius:14px;
  padding:13px;
  background:#081827;
}
.unx-simple-step>span{
  width:34px;height:34px;border-radius:50%;
  background:#1677ff;
  color:#fff;
  display:grid;place-items:center;
  font-weight:900;
}
.unx-simple-step h3{margin:2px 0 10px}
.unx-simple-step input,
.unx-simple-step textarea,
.unx-simple-step select{margin-bottom:8px}
.unx-simple-map{
  height:260px;
  border:1px solid #29465f;
  border-radius:12px;
  overflow:hidden;
  background:#071420;
  margin-top:7px;
}
.unx-marketplace-privacy{
  display:grid;gap:4px;
  border:1px solid #265a87;
  background:#0a223a;
  border-radius:13px;
  padding:12px 13px;
}
.unx-marketplace-privacy span{color:#94acc0;font-size:11px;line-height:1.45}
.unx-big-submit{
  width:100%;
  min-height:52px;
  font-size:15px;
}
.unx-request-success{
  text-align:center;
  padding:15px;
}
.unx-request-success h2{font-size:30px}
.unx-request-success p{color:#9ab0c3;line-height:1.55}
.unx-success-icon{
  width:64px;height:64px;border-radius:50%;
  display:grid;place-items:center;
  margin:0 auto 13px;
  font-size:30px;font-weight:900;
  color:#06111f;background:#5de0a7;
}

.unx-lead-match{
  display:grid;
  gap:2px;
  margin-top:7px;
  padding:7px 9px;
  background:#0a2a47;
  border:1px solid #1d5e93;
  border-radius:9px;
}
.unx-lead-match b{font-size:11px;color:#83beff}
.unx-lead-match span{font-size:10px;color:#8fa9bd}

.unx-marketplace-warning{
  display:grid!important;
  grid-template-columns:1fr auto;
  gap:5px 12px;
  align-items:center;
  margin:10px 0!important;
}
.unx-marketplace-warning b,
.unx-marketplace-warning span{grid-column:1}
.unx-marketplace-warning button{
  grid-column:2;
  grid-row:1/3;
}

@media(max-width:900px){
  .unx-trade-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .unx-trade-grid.compact{grid-template-columns:repeat(2,minmax(0,1fr))}
  .unx-branch-editor-grid{grid-template-columns:1fr}
  .unx-radius-map{height:360px}
}

@media(max-width:600px){
  .unx-branch-title-row{display:grid}
  .unx-branch-title-row button{width:100%}
  .unx-branches-list{margin-left:15px;padding-left:17px}
  .unx-branch-tree-line{left:-18px;width:17px}
  .unx-branch-card-main{grid-template-columns:1fr}
  .unx-branch-actions button{flex:1}
  .unx-trade-grid,.unx-trade-grid.compact{grid-template-columns:1fr}
  .unx-team-row{grid-template-columns:auto 1fr auto}
  .unx-team-row small{grid-column:2/4}
  .unx-marketplace-warning{display:block!important}
  .unx-marketplace-warning button{margin-top:8px;width:100%}
}


/* ============================================================
   UtiliNexus 2.8.45.19 — Trade selection polish
   Removes browser-default white checkboxes and replaces them
   with dark UtiliNexus selection controls.
   ============================================================ */

.unx-trade-check{
  position:relative;
  min-height:44px;
  padding:10px 12px 10px 42px !important;
  border:1px solid #29465f !important;
  background:
    linear-gradient(180deg,rgba(15,36,55,.98),rgba(8,25,39,.98)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.025),
    0 4px 12px rgba(0,0,0,.12);
  transition:
    border-color .16s ease,
    background .16s ease,
    box-shadow .16s ease,
    transform .16s ease;
  user-select:none;
}

.unx-trade-check:hover{
  border-color:#3e6e96 !important;
  background:
    linear-gradient(180deg,rgba(18,43,66,.98),rgba(9,29,45,.98)) !important;
  transform:translateY(-1px);
}

.unx-trade-check input[type="checkbox"]{
  position:absolute !important;
  opacity:0 !important;
  pointer-events:none !important;
  width:1px !important;
  height:1px !important;
  margin:0 !important;
}

.unx-trade-check::before{
  content:"";
  position:absolute;
  left:13px;
  top:50%;
  width:18px;
  height:18px;
  border-radius:6px;
  transform:translateY(-50%);
  border:1.5px solid #55728a;
  background:
    linear-gradient(180deg,#102436,#0b1926);
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,255,255,.015);
  transition:
    background .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

.unx-trade-check::after{
  content:"";
  position:absolute;
  left:18px;
  top:50%;
  width:7px;
  height:11px;
  border-right:2px solid transparent;
  border-bottom:2px solid transparent;
  transform:translateY(-58%) rotate(45deg) scale(.75);
  opacity:0;
  transition:opacity .14s ease,transform .14s ease;
}

.unx-trade-check:has(input:checked){
  border-color:#1677ff !important;
  background:
    linear-gradient(180deg,rgba(20,67,116,.95),rgba(10,41,74,.96)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 0 0 1px rgba(22,119,255,.15),
    0 8px 20px rgba(5,80,170,.14) !important;
}

.unx-trade-check:has(input:checked)::before{
  border-color:#4d9cff;
  background:
    linear-gradient(180deg,#2085ff,#0f63d8);
  box-shadow:
    0 0 0 3px rgba(22,119,255,.10),
    0 0 14px rgba(22,119,255,.30);
}

.unx-trade-check:has(input:checked)::after{
  border-right-color:#ffffff;
  border-bottom-color:#ffffff;
  opacity:1;
  transform:translateY(-58%) rotate(45deg) scale(1);
}

.unx-trade-check span{
  color:#d9e8f5;
  font-weight:800;
  letter-spacing:.01em;
}

.unx-trade-check:has(input:checked) span{
  color:#ffffff;
}

.unx-trade-check:focus-within{
  outline:none;
  border-color:#5aa3ff !important;
  box-shadow:
    0 0 0 3px rgba(22,119,255,.16),
    0 8px 20px rgba(5,80,170,.10) !important;
}

.unx-trade-check:has(input:disabled){
  opacity:.48;
  cursor:not-allowed;
  transform:none !important;
}

/* Branch inheritance toggle also gets a matching dark custom control. */
.unx-branch-trade-box .check-row{
  position:relative;
  padding:10px 12px 10px 42px;
  min-height:44px;
  display:flex !important;
  align-items:center;
  border:1px solid #29465f;
  border-radius:11px;
  background:linear-gradient(180deg,rgba(15,36,55,.98),rgba(8,25,39,.98));
  cursor:pointer;
}

.unx-branch-trade-box .check-row input[type="checkbox"]{
  position:absolute !important;
  opacity:0 !important;
  pointer-events:none !important;
  width:1px !important;
  height:1px !important;
}

.unx-branch-trade-box .check-row::before{
  content:"";
  position:absolute;
  left:13px;
  top:50%;
  width:18px;
  height:18px;
  border-radius:6px;
  transform:translateY(-50%);
  border:1.5px solid #55728a;
  background:linear-gradient(180deg,#102436,#0b1926);
}

.unx-branch-trade-box .check-row::after{
  content:"";
  position:absolute;
  left:18px;
  top:50%;
  width:7px;
  height:11px;
  border-right:2px solid transparent;
  border-bottom:2px solid transparent;
  transform:translateY(-58%) rotate(45deg) scale(.75);
  opacity:0;
}

.unx-branch-trade-box .check-row:has(input:checked){
  border-color:#1677ff;
  background:linear-gradient(180deg,rgba(20,67,116,.95),rgba(10,41,74,.96));
}

.unx-branch-trade-box .check-row:has(input:checked)::before{
  border-color:#4d9cff;
  background:linear-gradient(180deg,#2085ff,#0f63d8);
  box-shadow:
    0 0 0 3px rgba(22,119,255,.10),
    0 0 14px rgba(22,119,255,.30);
}

.unx-branch-trade-box .check-row:has(input:checked)::after{
  border-right-color:#fff;
  border-bottom-color:#fff;
  opacity:1;
  transform:translateY(-58%) rotate(45deg) scale(1);
}

/* Signup trade selectors use the same visual treatment automatically
   because they share .unx-trade-check. */


/* ============================================================
   UtiliNexus 2.8.45.20 — Independent sidebar scrolling
   Keeps long navigation menus usable without affecting the
   main workspace scroll.
   ============================================================ */

#sidebar,
.sidebar{
  height:100vh;
  max-height:100vh;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}

/* Keep the sidebar's own content comfortably reachable. */
#sidebar,
.sidebar{
  padding-bottom:18px;
}

/* Firefox */
#sidebar,
.sidebar{
  scrollbar-width:thin;
  scrollbar-color:#315b7e #091827;
}

/* Chromium / Edge / Safari */
#sidebar::-webkit-scrollbar,
.sidebar::-webkit-scrollbar{
  width:9px;
}

#sidebar::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track{
  background:#091827;
  border-radius:999px;
}

#sidebar::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg,#365f82,#244660);
  border:2px solid #091827;
  border-radius:999px;
}

#sidebar::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover{
  background:linear-gradient(180deg,#4a79a0,#315b7e);
}

/* If the sidebar lives in a fixed desktop shell, prevent its parent from
   clipping the new scrollbar. */
.app-shell,
.app-layout,
.shell{
  min-height:100vh;
}

/* Mobile keeps normal document flow rather than creating a nested scroller. */
@media(max-width:760px){
  #sidebar,
  .sidebar{
    height:auto;
    max-height:none;
    overflow-y:visible;
    scrollbar-gutter:auto;
  }
}


/* ============================================================
   UtiliNexus 2.8.45.21 — Branch Scoped Operations
   ============================================================ */

.unx-branch-actions{
  flex-wrap:wrap;
}

.unx-branch-work-header{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:16px;
  align-items:start;
  margin-bottom:16px;
}
.unx-branch-work-header h2{margin:4px 0}
.unx-branch-work-header p{margin:0;max-width:720px}

.unx-branch-work-kpis{
  display:grid;
  grid-template-columns:repeat(2,minmax(100px,1fr));
  gap:8px;
}
.unx-branch-work-kpis>div{
  min-width:112px;
  border:1px solid #27465f;
  border-radius:12px;
  padding:10px 12px;
  background:#081827;
  display:grid;
}
.unx-branch-work-kpis b{
  font-size:20px;
  color:#fff;
}
.unx-branch-work-kpis span{
  color:#7f98ad;
  font-size:10px;
}
.unx-branch-work-kpis .warn{
  border-color:#7e5b20;
  background:#241b09;
}
.unx-branch-work-kpis .warn b{color:#ffd166}

.unx-branch-work-group{
  margin:14px 0;
}
.unx-branch-work-group-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:7px;
}
.unx-branch-work-group-head h3{margin:0}
.unx-branch-work-group-head span{
  color:#7893aa;
  font-size:10px;
}

.unx-branch-work-list{
  display:grid;
  gap:7px;
}
.unx-branch-work-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(190px,250px);
  gap:12px;
  align-items:center;
  padding:11px 12px;
  border:1px solid #223d54;
  border-radius:12px;
  background:#081724;
}
.unx-branch-work-row.focus{
  border-color:#2d669b;
  background:linear-gradient(90deg,#0c2842,#081724 58%);
}
.unx-branch-work-row.unassigned{
  border-left:4px solid #d49a2c;
}
.unx-branch-work-main{
  min-width:0;
  display:grid;
  gap:4px;
}
.unx-branch-work-main>span{
  color:#839db2;
  font-size:11px;
  overflow-wrap:anywhere;
}
.unx-branch-work-title{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.unx-unassigned-chip,
.unx-assigned-chip{
  font-size:8px;
  font-weight:900;
  letter-spacing:.08em;
  border-radius:999px;
  padding:4px 6px;
}
.unx-unassigned-chip{
  color:#ffd166;
  border:1px solid #7a591d;
  background:#2b1f08;
}
.unx-assigned-chip{
  color:#91c6ff;
  border:1px solid #235e92;
  background:#0b2944;
}
.unx-record-branch-select{
  margin:0!important;
  display:grid!important;
  gap:4px;
}
.unx-record-branch-select>span{
  color:#7893aa;
  font-size:9px;
  font-weight:900;
  letter-spacing:.08em;
}
.unx-record-branch-select select{
  width:100%;
  border:1px solid #35536d;
  background:#0a1a2a;
  color:#eef7ff;
  border-radius:9px;
  padding:8px 10px;
}
.unx-record-branch-select select.saving{
  opacity:.55;
}

.unx-branch-work-note{
  display:grid;
  gap:4px;
  margin-top:14px;
  border:1px solid #274d70;
  border-radius:12px;
  padding:11px 12px;
  background:#0a2036;
}
.unx-branch-work-note span{
  color:#8ea8bd;
  font-size:11px;
  line-height:1.5;
}

@media(max-width:700px){
  .unx-branch-work-header{
    grid-template-columns:1fr;
  }
  .unx-branch-work-kpis{
    grid-template-columns:repeat(2,1fr);
  }
  .unx-branch-work-row{
    grid-template-columns:1fr;
  }
}
