:root{--cj-font-size:16px;--cj-input-font-size:16px;--cj-label-font-size:14px;--cj-table-font-size:15px}
@media screen{
body{font-size:var(--cj-font-size)!important}
.MuiTypography-body1,.MuiTypography-body2,.MuiButton-root{font-size:var(--cj-font-size)!important;line-height:1.45!important}
.MuiInputBase-input,input:not([type=checkbox]):not([type=radio]),textarea,select{font-size:var(--cj-input-font-size)!important}
.MuiInputLabel-root,label{font-size:var(--cj-label-font-size)}
.MuiTableCell-root,.report-dom td,.report-dom th{font-size:var(--cj-table-font-size)!important;line-height:1.45!important}
.menu-text,.mega-link,.menu-link{font-size:max(14px,var(--cj-label-font-size))!important}
.page-modal-titlebar-title{font-size:max(15px,var(--cj-label-font-size))!important;font-weight:700!important}
.page-modal-breadcrumb{font-size:max(13px,calc(var(--cj-label-font-size) - 1px))!important}
#cj-company-header-logo{position:absolute;top:6px;height:44px;display:flex;align-items:center;justify-content:center;z-index:5;text-decoration:none;max-width:240px;overflow:hidden}
#cj-company-header-logo img{display:block;max-width:100%;object-fit:contain;filter:none!important}
#cj-company-header-logo[data-position=left]{left:58px;transform:none}
#cj-company-header-logo[data-position=center]{left:50%;transform:translateX(-50%)}
#cj-company-header-logo[data-position=right]{right:178px;left:auto;transform:none}
.cj-company-theme{font-size:16px}
.cj-company-theme input,.cj-company-theme select,.cj-company-theme textarea,.cj-company-theme button{font-size:15px!important}
}
@media(max-width:768px){#cj-company-header-logo{display:none!important}.menu-text{font-size:13px!important}.page-modal-titlebar-title{font-size:15px!important}}


/* Existing invoice/challan auto header: preserve component, override only user-configurable presentation. */
.inv-auto-header>div{box-sizing:border-box!important;padding:var(--cj-doc-padding,12px)!important;gap:16px!important;align-items:center!important}
html[data-cj-doc-position="left"] .inv-auto-header>div{flex-direction:row!important;text-align:left!important}
html[data-cj-doc-position="center"] .inv-auto-header>div{flex-direction:column!important;text-align:center!important}
html[data-cj-doc-position="right"] .inv-auto-header>div{flex-direction:row-reverse!important;text-align:right!important}
.inv-auto-header>div>div:first-child{width:auto!important;flex:0 0 auto!important;display:flex!important;align-items:center!important;justify-content:center!important}
.inv-auto-header>div>div:first-child img,.inv-top img[alt="Company Logo"]{width:var(--cj-doc-logo-width,180px)!important;height:var(--cj-doc-logo-height,80px)!important;max-width:100%!important;object-fit:contain!important;filter:none!important}
.inv-auto-header>div>div:nth-child(2){width:auto!important;flex:1 1 auto!important;min-width:0!important;text-align:inherit!important}
.inv-auto-header>div>div:nth-child(2)>div:first-child{font-size:var(--cj-doc-company-size,28px)!important;line-height:1.2!important}
.inv-auto-header>div>div:nth-child(2)>div:nth-child(2){font-size:var(--cj-doc-font-size,11pt)!important;line-height:1.45!important}
html[data-cj-doc-position="center"] .inv-top img[alt="Company Logo"]{display:block!important;margin-left:auto!important;margin-right:auto!important}
html[data-cj-doc-position="right"] .inv-top img[alt="Company Logo"]{display:block!important;margin-left:auto!important;margin-right:0!important}
.inv-top{font-size:var(--cj-doc-font-size,11pt)}


.cj-layout-settings{max-width:1180px;margin:16px auto 28px;padding:0 14px;color:#20364a}
.cj-layout-card{background:#fff;border:1px solid #dce5eb;border-radius:14px;padding:20px;box-shadow:0 2px 8px rgba(12,43,74,.06)}
.cj-layout-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.cj-layout-head span{font-size:12px;font-weight:700;color:#60788b;letter-spacing:.04em}.cj-layout-head h2{font-size:21px!important;margin:4px 0 5px!important}.cj-layout-head p{margin:0;color:#637789}
.cj-layout-card h3{margin:22px 0 10px;font-size:16px}.cj-layout-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.cj-layout-grid label{display:grid;gap:6px;font-size:14px;font-weight:650;color:#415a70}.cj-layout-grid input,.cj-layout-grid select,.cj-layout-card button{box-sizing:border-box;min-height:40px;border:1px solid #ccd8e1;border-radius:8px;background:#fff;color:#174d70;padding:8px 11px;font:inherit}
.cj-layout-grid .cj-check{display:flex;align-items:center;gap:9px;align-self:end;min-height:40px}.cj-layout-grid .cj-check input{width:18px;height:18px;min-height:0;padding:0}
.cj-layout-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}.cj-layout-card button{font-weight:700;cursor:pointer}.cj-layout-card button.primary{background:#075b9a;color:#fff;border-color:#075b9a}
#cj-layout-message{min-height:20px;margin-top:10px;font-size:14px}.cj-layout-ok{color:#176b3a}.cj-layout-error{color:#9b2c2c}
@media(max-width:850px){.cj-layout-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:520px){.cj-layout-settings{padding:0 8px}.cj-layout-card{padding:15px}.cj-layout-head{flex-direction:column}.cj-layout-grid{grid-template-columns:1fr}.cj-layout-actions{flex-direction:column}.cj-layout-actions button{width:100%}}

/* Reserve a real slot for the existing left-aligned company logo. */
@media screen and (min-width:769px){
  .top-header:has(> #cj-company-header-logo[data-position="left"]) > .mobile-toggle{
    order:-2;
    flex-shrink:0;
  }
  .top-header > #cj-company-header-logo[data-position="left"]{
    position:static;
    inset:auto;
    transform:none;
    order:-1;
    flex:0 0 auto;
    max-width:clamp(80px,12vw,240px);
    margin:0 8px;
  }
}

/* Keep native drawer controls fixed while its existing menu content scrolls. */
@media screen{
  body .mobile-sidebar{
    display:flex;
    flex-direction:column;
    height:100vh;
    height:100dvh;
    max-width:100vw;
    overflow:hidden;
  }
  .mobile-sidebar > .sidebar-header{flex:0 0 auto;}
  .mobile-sidebar > .sidebar-body{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  .mobile-sidebar > .sidebar-header > button:not(.cj-update-launch){
    flex:0 0 auto;
    min-width:44px;
    min-height:44px;
  }
}
