/* Consistent, compact working tables. Individual columns may override emphasis. */
:is(#clients,#vehicles,#estimates,#products) table{font-family:Inter,Arial,sans-serif;font-size:13px;font-weight:500;line-height:1.35}
:is(#clients,#vehicles,#estimates,#products) tbody td{font-weight:500}
:is(#clients,#vehicles,#estimates,#products) tbody td :is(b,strong,a,button){font-weight:inherit}
:is(#clients,#vehicles,#estimates,#products) thead th{font-weight:650}
:is(#clients,#vehicles,#estimates,#products) :is(th,td).crm-col-bold,
:is(#clients,#vehicles,#estimates,#products) :is(th,td).crm-col-bold :is(b,strong,a,button){font-weight:750}
:is(#clients,#vehicles,#estimates,#products) :is(th,td).crm-col-underline{text-decoration:underline;text-decoration-color:var(--a);text-underline-offset:3px}
:is(#clients,#vehicles,#estimates,#products) :is(th,td).crm-col-highlight{background:color-mix(in srgb,var(--a) 15%,var(--p))}

/* Shared column editor. */
:is(#clients,#vehicles,#estimates,#products) :is(.client-popover,.column-popover,.estimate-popover,.product-popover){width:min(440px,calc(100vw - 24px));max-height:min(72vh,620px);overflow:auto;padding:15px;border-radius:9px;scrollbar-width:thin}
:is(#clients,#vehicles,#estimates,#products) :is(.client-popover,.column-popover,.estimate-popover,.product-popover)>b{display:block;margin-bottom:5px;font-size:14px}
:is(#clients,#vehicles,#estimates,#products) :is(.client-popover,.column-popover,.estimate-popover,.product-popover)>p{line-height:1.4}
.crm-column-row{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:42px;padding:4px 3px;border-top:1px solid var(--l)}
.crm-column-row.dragging{opacity:.45}.crm-column-row.drop-target{box-shadow:inset 0 2px var(--a)}
.crm-column-grip{display:grid;place-items:center;min-width:20px;min-height:27px;color:var(--m);font-size:19px;cursor:grab;user-select:none}
.crm-column-grip[aria-disabled=true]{opacity:.35;cursor:default}.crm-column-grip:active{cursor:grabbing}
.crm-column-grip:focus-visible,.crm-column-styles button:focus-visible{outline:2px solid var(--a);outline-offset:2px}
.crm-column-name{display:flex!important;align-items:center;gap:8px;min-width:0;padding:0!important;font-size:12px}
.crm-column-name span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-column-name input{flex:none}
.crm-column-styles{display:flex;gap:3px}
.crm-column-styles button{display:grid;place-items:center;width:27px;height:27px;padding:0!important;border:1px solid var(--l);border-radius:5px;background:var(--bg);color:var(--m);font-size:12px;font-weight:700}
.crm-column-styles button[aria-pressed=true]{border-color:var(--a);background:color-mix(in srgb,var(--a) 20%,var(--p));color:var(--a)}
.crm-column-styles button:hover{color:var(--t)}
.crm-column-styles button[data-column-style=underline]{text-decoration:underline;text-underline-offset:2px}

/* One compact header pattern for every register. */
@media(min-width:901px){
  :is(#clients,#vehicles,#estimates,#products).show{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:12px;row-gap:5px}
  :is(#clients,#vehicles,#estimates,#products)>.head{grid-column:1;grid-row:1;display:flex;justify-content:flex-start;align-items:center;gap:16px;min-height:38px;margin:0}
  :is(#clients,#vehicles,#estimates,#products)>.head .eyebrow{display:none}
  :is(#clients,#vehicles,#estimates,#products)>.head h1{margin:0;font-size:22px;line-height:1.15}
  :is(#clients,#vehicles,#estimates,#products)>.head .btn{margin:0;min-height:32px;padding:6px 10px;font-size:12px;white-space:nowrap}
  :is(#clients,#vehicles,#products)>.toolbar{grid-column:2;grid-row:1;display:flex;justify-content:flex-end;align-items:center;gap:6px;margin:0;min-width:0}
  :is(#clients,#vehicles,#products)>.toolbar .search{width:clamp(170px,22vw,280px);min-height:34px}
  #estimates>.estimate-toolbar{display:contents}
  #estimates #estimatesSearch{grid-column:2;grid-row:1;justify-self:end;width:clamp(170px,22vw,280px);margin-right:43px;min-height:34px}
  #estimates .estimate-config{grid-column:2;grid-row:1;justify-self:end;margin:0}
  #estimates .estimate-selection{grid-column:1;grid-row:2;min-height:31px}
  :is(#clients,#vehicles,#products) :is(.client-bulk,.vehicle-bulk,.product-selection){grid-column:1;grid-row:2;display:flex;align-items:center;gap:12px;min-height:31px;margin:0}
  :is(#vehicles,#products,#estimates)>.list-summary{grid-column:2;grid-row:2;justify-content:flex-end;margin:0;min-height:31px}
  :is(#clients,#vehicles,#estimates,#products)>.box{grid-column:1/-1;grid-row:3}
  :is(#vehicles,#estimates,#products)>.list-pager{grid-column:1/-1;grid-row:4;margin-top:1px}
}
:is(#clients,#vehicles,#estimates,#products) :is(#columnSettings,#clientSettingsButton,#productColumnsButton,#estimatesConfigure){display:grid;place-items:center;width:34px;height:34px;min-width:34px;padding:0!important}
:is(#clients,#vehicles,#estimates,#products) :is(#columnSettings,#clientSettingsButton,#productColumnsButton,#estimatesConfigure) svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#clients .client-bulk #clientsTotal{color:var(--m)}

/* Sidebar can collapse without hiding navigation targets. */
.side .nav #adminNav{display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:12px;padding-inline:8px}
.side .nav #adminNav i{flex:0 0 20px;width:20px;margin-right:0}
.side .nav i{display:inline-grid;place-items:center;vertical-align:middle;width:24px;height:22px;margin-right:8px}
.side .nav i svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.sidebar-toggle{display:grid;place-items:center;width:30px;height:30px;margin:-8px 0 15px auto;border:1px solid var(--l);border-radius:6px;background:var(--p);color:var(--m)}
.sidebar-toggle:hover{color:var(--a);border-color:var(--a)}
.sidebar-toggle svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
@media(min-width:761px){
  body.sidebar-collapsed .app{grid-template-columns:58px minmax(0,1fr)}
  body.sidebar-collapsed .side{align-items:center;padding:13px 5px}
  body.sidebar-collapsed .brand{width:37px;height:37px;display:grid;place-items:center;overflow:hidden;padding:0;margin:0;font-size:0;border:1px solid var(--l);border-radius:7px;color:var(--a)}
  body.sidebar-collapsed .brand::before{content:'F';font-size:20px;font-weight:900;line-height:1}
  body.sidebar-collapsed .brand small{display:none}
  body.sidebar-collapsed .sidebar-toggle{margin:9px 0 15px;width:37px}
  body.sidebar-collapsed .sidebar-toggle svg{transform:rotate(180deg)}
  body.sidebar-collapsed .nav{width:100%}
  body.sidebar-collapsed .nav button{display:grid;place-items:center;width:100%;height:42px;min-height:42px;overflow:hidden;padding:0;font-size:0;white-space:nowrap}
  body.sidebar-collapsed .nav i{width:24px;margin:0}
  body.sidebar-collapsed .nav i svg{width:20px;height:20px}
  body.sidebar-collapsed .side .nav #adminNav{justify-content:center;padding:0;font-size:0;gap:0}
  body.sidebar-collapsed #globalSearchOpen small{display:none}
  body.sidebar-collapsed .side .side-footer{width:100%;padding:10px 0 0}
  body.sidebar-collapsed .side-footer .staff-button{display:grid;place-items:center;width:100%;min-width:0;min-height:40px;padding:0}
  body.sidebar-collapsed .side-footer #staffLabel,body.sidebar-collapsed .side-footer .staff-dot,body.sidebar-collapsed .side-footer .relay-note,body.sidebar-collapsed .crm-data-status{display:none}
  body.sidebar-collapsed .side-footer .account-icon{display:inline;font-size:22px;color:var(--a)}
  body.sidebar-collapsed .account-menu{left:calc(100% + 7px);bottom:0}
}
@media(max-width:900px){
  :is(#clients,#vehicles,#estimates,#products)>.head .eyebrow{display:none}
  :is(#clients,#vehicles,#estimates,#products)>.head{margin-bottom:8px}
  :is(#clients,#vehicles,#products)>.toolbar{justify-content:flex-end}
  :is(#clients,#vehicles,#products)>.toolbar .search{width:min(100%,380px)}
  #estimates .estimate-toolbar{justify-content:flex-end}
  #estimates #estimatesSearch{order:1}#estimates .estimate-config{order:2}
  #estimates .estimate-selection{order:3;width:100%}
}
@media(max-width:760px){.sidebar-toggle{display:none}}
