/* Billing inherits all existing AutoFlow theme variables. */
.accountActionsBilling{
 display:flex;flex:0 0 auto;min-width:0;align-items:center;gap:12px;
 margin-left:auto;justify-content:flex-end;
}
.sidebar .accountActionsBilling .purchaseBell440{
 margin-left:0!important;min-width:34px;width:38px;height:38px;
 display:grid;place-items:center;grid-column:auto;border-radius:11px;
}
.sidebar .accountActionsBilling .purchaseBell440.hidden{display:none}
.sidebar .accountActionsBilling .userChip424{margin-left:0!important;padding:0;min-width:0;grid-column:auto!important}
.accountActionsBilling .userAccountToggle439{min-width:0}
.billingWrap{width:100%;max-width:1280px;margin:0 auto;display:flex;flex-direction:column;gap:16px}
.billingHeader{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.billingHeader h2{margin:0 0 8px;font-size:22px}
.billingHeader p{color:var(--muted);margin:0;line-height:1.5}
.billingMetrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.billingMetrics article{min-width:0;border:1px solid var(--line);border-radius:15px;padding:18px;background:var(--panel);display:flex;flex-direction:column;gap:8px}
.billingMetrics span{font-size:12px;color:var(--muted)}
.billingMetrics strong{font-size:clamp(17px,2vw,23px);color:var(--text);overflow-wrap:anywhere}
.billingMetrics small{font-size:11px;color:var(--muted)}
.billingSection{padding:20px;min-width:0}
.billingSection h3{font-size:17px;margin:0 0 15px}
.billingSection h4{font-size:14px;margin:22px 0 9px}
.billingSection p{line-height:1.5}
.billingTitle p,.billingMeta{font-size:12px;color:var(--muted);overflow-wrap:anywhere}
.billingSection form{display:flex;gap:14px;align-items:flex-end;flex-wrap:wrap}
.billingSection form label{display:flex;flex:1;min-width:210px;flex-direction:column;gap:8px;font-size:12px;color:var(--muted)}
.billingSection form button{flex-shrink:0}
.billingNotice{border:1px solid var(--line);background:var(--soft);color:var(--text);padding:14px;border-radius:12px;font-size:13px;line-height:1.5}
.billingTableWrap{overflow-x:auto;width:100%}
.billingTable{width:100%;border-collapse:collapse;font-size:12px;white-space:nowrap}
.billingTable th,.billingTable td{text-align:left;padding:12px 10px;border-bottom:1px solid var(--line)}
.billingTable th{font-weight:650;color:var(--muted)}
.billingAdminGrid{display:grid;grid-template-columns:minmax(235px,.8fr) minmax(0,1.8fr);gap:14px}
.billingCompanyList{display:flex;flex-direction:column;gap:6px;margin-top:13px;max-height:430px;overflow-y:auto}
.billingCompany{width:100%;border:1px solid var(--line);border-radius:10px;background:var(--panel);padding:11px;text-align:left;color:var(--text);display:flex;flex-direction:column;gap:6px}
.billingCompany.selected,.billingCompany:hover{background:var(--soft)}
.billingCompany small{color:var(--muted);font-size:11px}
.billingFields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%;margin-bottom:14px}
.billingFields label{min-width:0!important}
.billingActionGroup{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0}
.billingManual{margin-top:20px;border-top:1px solid var(--line);padding-top:15px;display:flex;flex-direction:column;align-items:start;gap:8px}
.billingManual .input{width:100%}
.billingLoading{padding:18px;color:var(--muted)}
@media(max-width:900px){
 .billingMetrics{grid-template-columns:repeat(2,minmax(0,1fr))}
 .billingAdminGrid{grid-template-columns:1fr}
}
@media(max-width:600px){
 .sidebar>.brand{grid-template-columns:26px minmax(0,1fr) auto!important;gap:6px}
 .sidebar .accountActionsBilling{grid-column:3!important;gap:3px;margin-left:auto;max-width:154px;min-width:0}
 .sidebar .accountActionsBilling .purchaseBell440{min-width:28px;width:30px;height:34px}
 .sidebar .accountActionsBilling .userChip424{max-width:120px;min-width:0}
 .sidebar .accountActionsBilling .userAccountToggle439{max-width:120px}
 .billingMetrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .billingMetrics article{padding:13px}
 .billingAdminGrid{grid-template-columns:minmax(0,1fr)}
 .billingFields{grid-template-columns:1fr}
 .billingSection{padding:15px}
 .billingSection form label{min-width:100%}
 .billingSection form button{width:100%}
 .billingHeader h2{font-size:19px}
 .billingSection .billingReconcile{display:flex;flex-direction:column}
}
@media(max-width:359px){
 .sidebar>.brand{grid-template-columns:24px minmax(0,1fr) auto!important}
 .sidebar .accountActionsBilling{max-width:133px}
 .sidebar .accountActionsBilling .userChip424{max-width:105px}
}

/* Mobile account regression repair (2026-11-02).
 * Keep the notification bell and the authenticated user inside one responsive
 * group. Prior media rules assumed #userChip424 was a direct child of .brand.
 */
.sidebar .brand .accountActionsBilling{
 display:flex;align-items:center;justify-content:flex-end;flex:0 1 auto;
 min-width:0;max-width:100%;gap:8px;margin-left:auto;
}
.sidebar .accountActionsBilling #userChip424:not(.hidden){
 display:block!important;position:relative;flex:0 1 auto;
 min-width:0;max-width:100%;margin:0;padding:0;
}
.sidebar .accountActionsBilling .userAccountToggle439{
 display:flex;min-width:0;max-width:100%;align-items:center;
}
.sidebar .accountActionsBilling .userAccountText439{min-width:0}
.sidebar .accountActionsBilling .userAccountText439 strong,
.sidebar .accountActionsBilling .userAccountText439 small{
 overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
@media(max-width:600px){
 .sidebar>.brand{
  display:grid!important;grid-template-columns:36px minmax(0,1fr) auto!important;
  align-items:center;gap:6px;min-width:0;
 }
 .sidebar>.brand .brandKls{grid-column:1;min-width:0}
 .sidebar>.brand .tenantBrand{
  grid-column:2;min-width:0;width:100%;max-width:100%!important;
 }
 .sidebar>.brand .accountActionsBilling{
  display:flex!important;grid-column:3!important;justify-self:end;
  width:auto;min-width:0;max-width:min(43vw,160px);gap:4px;margin-left:0;
 }
 .sidebar .accountActionsBilling .purchaseBell440{
  flex:0 0 30px;min-width:30px;width:30px;height:36px;
 }
 .sidebar .accountActionsBilling #userChip424:not(.hidden){
  flex:0 1 auto;max-width:120px;min-width:0;
 }
 .sidebar .accountActionsBilling .userAccountToggle439{
  width:100%;min-height:38px;padding:2px 0;gap:4px;
 }
 .sidebar .accountActionsBilling .userAvatar439{
  width:24px;height:24px;flex-basis:24px;
 }
 .sidebar .accountActionsBilling .userAccountText439 strong{font-size:10px}
 .sidebar .accountActionsBilling .userAccountText439 small{font-size:8px}
}
/* Keep all three header groups on ONE line even on 320–390px phones.
 * Shrink/truncate the company and account labels instead of dropping account
 * actions below the company: this is an authenticated PWA toolbar, not a card.
 */
@media(max-width:600px){
 .sidebar>.brand .tenantBrandText{min-width:0;flex:1 1 0;overflow:hidden}
 .sidebar>.brand .tenantBrandText strong{
  display:block;max-width:100%!important;white-space:nowrap!important;
  overflow:hidden!important;text-overflow:ellipsis!important;
 }
 .sidebar>.brand .accountActionsBilling{grid-row:1!important}
}
@media(max-width:390px){
 .sidebar>.brand{
  display:grid!important;
  grid-template-columns:38px minmax(0,1fr) 134px!important;
  grid-template-rows:auto!important;
  align-items:center;column-gap:4px;row-gap:0;
 }
 .sidebar>.brand .brandKls{grid-column:1;grid-row:1}
 .sidebar>.brand .tenantBrand{
  grid-column:2;grid-row:1;min-width:0;max-width:100%!important;
  padding:3px 4px;gap:4px
 }
 .sidebar>.brand .tenantBrand .brandMark{width:20px;height:20px;flex:none}
 .sidebar>.brand .tenantBrandText strong{font-size:10px}
 .sidebar>.brand .accountActionsBilling{
  display:flex!important;grid-column:3!important;grid-row:1!important;
  min-width:0;width:100%;max-width:134px!important;
  justify-self:end;align-items:center;gap:3px;min-height:38px;margin:0;
 }
 .sidebar>.brand .accountActionsBilling .purchaseBell440{
  flex:0 0 26px;min-width:26px;width:26px;
 }
 .sidebar>.brand .accountActionsBilling #userChip424:not(.hidden){
  flex:1 1 0;min-width:0;max-width:none;
 }
 .sidebar>.brand .userAccountToggle439{gap:3px;max-width:100%}
 .sidebar>.brand .userAccountText439{min-width:0;flex:1 1 0}
 .sidebar>.brand .userAccountText439 strong,
 .sidebar>.brand .userAccountText439 small{
  display:block;max-width:100%;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;
 }
 .sidebar>.brand .userAccountChevron439{flex:none;width:9px}
}
