:root{--blue:#243aa7;--blue2:#3158cc;--ink:#182033;--muted:#69748a;--bg:#f4f6fa;--panel:#fff;--line:#e2e7f0;--soft:#eef3ff;--danger:#b42318;--shadow:0 18px 50px rgba(31,49,96,.10)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Segoe UI,Arial,sans-serif;color:var(--ink)}button,input{font:inherit}a{text-decoration:none;color:inherit}
.cs-kicker{font-size:12px;letter-spacing:.16em;font-weight:800;color:var(--blue)}
/* Login */
.cs-login-body{min-height:100vh;background:radial-gradient(circle at 15% 15%,#f6f8ff 0,#edf2ff 28%,#f7f8fb 60%,#eef1f7 100%);display:grid;place-items:center;padding:30px}
.cs-login-shell{width:min(1060px,100%);display:grid;grid-template-columns:1.15fr .85fr;background:rgba(255,255,255,.88);border:1px solid rgba(255,255,255,.9);border-radius:30px;box-shadow:0 28px 80px rgba(25,45,95,.16);overflow:hidden;backdrop-filter:blur(18px)}
.cs-login-brand-panel{padding:58px 54px;display:flex;flex-direction:column;justify-content:center;background:linear-gradient(145deg,#fff 0,#f2f5ff 100%);border-right:1px solid var(--line)}
.cs-login-logo{display:block;width:min(520px,100%);height:auto;object-fit:contain;margin-bottom:48px}.cs-login-copy h1{font-size:36px;line-height:1.06;margin:9px 0 14px}.cs-login-copy p{max-width:520px;color:var(--muted);font-size:16px;line-height:1.65;margin:0}
.cs-login-card{padding:58px 48px;display:flex;flex-direction:column;justify-content:center;background:#fff}.cs-login-card-head h2{font-size:30px;margin:8px 0 8px}.cs-login-card-head p{margin:0 0 28px;color:var(--muted)}
.cs-login-form{display:grid;gap:10px}.cs-login-form label{font-size:13px;font-weight:700;margin-top:8px}.cs-login-form input{height:50px;border-radius:13px;border:1px solid #cfd7e6;padding:0 14px;outline:none;background:#fbfcff}.cs-login-form input:focus{border-color:var(--blue2);box-shadow:0 0 0 4px rgba(49,88,204,.10)}.cs-login-form button{height:52px;margin-top:16px;border:0;border-radius:13px;background:linear-gradient(135deg,var(--blue),var(--blue2));color:#fff;font-weight:800;cursor:pointer;box-shadow:0 12px 28px rgba(36,58,167,.24)}
.cs-login-foot{margin-top:28px;font-size:11px;color:#98a1b3;text-align:center;letter-spacing:.06em}.cs-alert{padding:12px 14px;border-radius:12px;margin-bottom:12px;font-size:13px}.cs-alert-error{background:#fff0ef;color:#a72b22;border:1px solid #ffd6d2}
/* App shell */
.cs-app-body{background:var(--bg);min-height:100vh}.cs-topbar{height:84px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:20px;padding:10px 24px;position:sticky;top:0;z-index:50}.cs-brand{width:190px;display:flex;align-items:center}.cs-brand img{display:block;max-width:100%;max-height:62px;object-fit:contain}.cs-topbar-title{display:flex;flex-direction:column;gap:2px;border-left:1px solid var(--line);padding-left:20px}.cs-topbar-title strong{font-size:16px}.cs-topbar-title span{font-size:12px;color:var(--muted)}.cs-user-area{margin-left:auto;display:flex;align-items:center;gap:10px}.cs-user-copy{display:flex;flex-direction:column;align-items:flex-end;margin-right:8px}.cs-user-copy strong{font-size:13px}.cs-user-copy span{font-size:11px;color:var(--muted)}.cs-top-link{font-size:12px;font-weight:700;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:#fff}.cs-top-link.danger{color:var(--danger)}
.cs-layout{display:grid;grid-template-columns:250px minmax(0,1fr);min-height:calc(100vh - 84px)}.cs-sidebar{background:#101938;padding:24px 14px 18px;color:#dce4ff;display:flex;flex-direction:column;gap:7px;position:sticky;top:84px;height:calc(100vh - 84px)}.cs-sidebar-label{font-size:10px;letter-spacing:.16em;color:#8796c5;padding:0 12px 8px}.cs-module-nav{border:0;background:transparent;color:#cbd5f4;border-radius:12px;display:flex;gap:11px;align-items:center;text-align:left;padding:12px 12px;cursor:pointer;font-size:13px;font-weight:650}.cs-module-nav:hover{background:rgba(255,255,255,.07);color:#fff}.cs-module-nav.active{background:linear-gradient(135deg,#293da7,#3565d9);color:#fff;box-shadow:0 9px 24px rgba(25,55,150,.3)}.cs-nav-icon{width:24px;text-align:center;font-size:18px}.cs-sidebar-spacer{flex:1}.cs-sidebar-foot{padding:10px 12px;font-size:10px;color:#7180ad;border-top:1px solid rgba(255,255,255,.08)}
.cs-main{padding:34px 38px 60px;max-width:1450px;width:100%;margin:0 auto}.cs-mobile-menu{display:none}.cs-view{display:none}.cs-view.active{display:block}.cs-page-heading{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:26px}.cs-page-heading h1{font-size:32px;margin:5px 0 6px;letter-spacing:-.025em}.cs-page-heading p{margin:0;color:var(--muted)}
.cs-module-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.cs-module-card{min-height:180px;text-align:left;border:1px solid var(--line);background:var(--panel);border-radius:20px;padding:24px;box-shadow:0 8px 28px rgba(31,49,96,.05);cursor:pointer;display:flex;flex-direction:column;align-items:flex-start;transition:.18s ease}.cs-module-card:hover{transform:translateY(-3px);border-color:#bac8ef;box-shadow:var(--shadow)}.cs-card-icon{width:46px;height:46px;border-radius:14px;background:var(--soft);color:var(--blue);display:grid;place-items:center;font-size:22px;margin-bottom:22px}.cs-module-card strong{font-size:18px;margin-bottom:7px}.cs-module-card small{font-size:13px;line-height:1.45;color:var(--muted)}
.cs-menu-stack{display:grid;gap:14px;max-width:980px}.cs-menu-group{background:#fff;border:1px solid var(--line);border-radius:17px;overflow:hidden;box-shadow:0 6px 20px rgba(31,49,96,.04)}.cs-menu-group summary{list-style:none;display:flex;justify-content:space-between;align-items:center;padding:17px 19px;font-weight:800;cursor:pointer;background:#fff}.cs-menu-group summary::-webkit-details-marker{display:none}.cs-menu-group[open] summary{background:#f8faff;border-bottom:1px solid var(--line);color:var(--blue)}.cs-chevron{font-size:17px;transition:.15s}.cs-menu-group[open] .cs-chevron{transform:rotate(180deg)}.cs-menu-items{padding:8px}.cs-menu-item{min-height:46px;border-radius:11px;display:flex;align-items:center;justify-content:space-between;padding:0 12px 0 14px;font-size:14px;border:1px solid transparent}.cs-menu-item:hover:not(.disabled){background:#f3f6ff;border-color:#e3e9fa;color:var(--blue)}.cs-menu-item em{font-size:10px;font-style:normal;font-weight:800;color:#16803b;background:#ebf8ef;padding:5px 8px;border-radius:999px}.cs-menu-item.disabled{color:#7d8799}.cs-menu-item.disabled em{color:#8992a1;background:#f1f3f6}
@media(max-width:1000px){.cs-module-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cs-layout{grid-template-columns:220px minmax(0,1fr)}.cs-main{padding:28px 24px}.cs-topbar-title{display:none}}
@media(max-width:760px){.cs-login-body{padding:14px}.cs-login-shell{grid-template-columns:1fr;border-radius:22px}.cs-login-brand-panel{padding:32px 28px 24px;border-right:0;border-bottom:1px solid var(--line)}.cs-login-logo{width:min(420px,100%);margin-bottom:22px}.cs-login-copy h1{font-size:26px}.cs-login-copy p{font-size:14px}.cs-login-card{padding:30px 28px 34px}.cs-topbar{height:72px;padding:8px 14px}.cs-brand{width:145px}.cs-user-copy{display:none}.cs-top-link{padding:8px 9px}.cs-layout{display:block;min-height:calc(100vh - 72px)}.cs-sidebar{position:fixed;left:-270px;top:72px;width:250px;height:calc(100vh - 72px);z-index:60;transition:left .2s ease;box-shadow:18px 0 40px rgba(10,20,50,.22)}.cs-sidebar.open{left:0}.cs-main{padding:20px 16px 50px}.cs-mobile-menu{display:inline-flex;border:1px solid var(--line);background:#fff;border-radius:11px;padding:9px 12px;margin-bottom:18px;font-weight:750;color:var(--blue)}.cs-page-heading h1{font-size:27px}.cs-module-grid{grid-template-columns:1fr;gap:12px}.cs-module-card{min-height:135px;padding:20px}.cs-card-icon{margin-bottom:14px}}
@media(max-width:440px){.cs-brand{width:120px}.cs-top-link:first-of-type{display:none}.cs-login-card-head h2{font-size:25px}}


/* V2 branding and responsive refinements */
.infosmart-word{font-weight:800;letter-spacing:-.025em}
.cs-topbar-title strong{font-size:20px;line-height:1.05}
.cs-topbar-title span{font-size:13px}
.cs-page-heading h1{font-size:42px;line-height:1.08;margin-top:10px}
.cs-page-heading p{font-size:18px;margin-top:10px}
.cs-kicker{font-size:13px}
.cs-brand{width:245px}
.cs-brand img{max-height:72px}
.cs-topbar{height:100px;padding:12px 28px}
.cs-layout{min-height:calc(100vh - 100px);grid-template-columns:290px minmax(0,1fr)}
.cs-sidebar{top:100px;height:calc(100vh - 100px);padding:30px 16px 18px}
.cs-module-nav{padding:15px 15px;font-size:15px;border-radius:16px}
.cs-nav-icon{font-size:20px;width:28px}
.cs-main{padding:58px 54px 70px}
.cs-module-grid{gap:22px}
.cs-module-card{min-height:210px;border-radius:24px;padding:30px}
.cs-card-icon{width:56px;height:56px;border-radius:18px;font-size:26px;margin-bottom:26px}
.cs-module-card strong{font-size:20px}
.cs-module-card small{font-size:14px;line-height:1.55}

@media(max-width:1100px){
  .cs-layout{grid-template-columns:240px minmax(0,1fr)}
  .cs-sidebar{width:auto}
  .cs-main{padding:38px 28px 60px}
  .cs-brand{width:205px}
  .cs-page-heading h1{font-size:35px}
}

@media(max-width:760px){
  .cs-topbar{height:78px;padding:8px 12px}
  .cs-brand{width:155px;flex:0 0 auto}
  .cs-brand img{max-height:58px}
  .cs-topbar-title{display:none}
  .cs-user-area{gap:6px}
  .cs-layout{display:block;min-height:calc(100vh - 78px)}
  .cs-sidebar{
    top:78px;
    height:calc(100vh - 78px);
    width:min(84vw,300px);
    left:-310px;
    padding:22px 14px 16px;
  }
  .cs-main{padding:18px 14px 44px}
  .cs-mobile-menu{display:inline-flex;align-items:center;gap:8px}
  .cs-page-heading{margin-bottom:22px}
  .cs-page-heading h1{font-size:30px}
  .cs-page-heading p{font-size:15px}
  .cs-module-grid{grid-template-columns:1fr}
  .cs-module-card{min-height:145px;padding:20px;border-radius:18px}
  .cs-card-icon{width:46px;height:46px;margin-bottom:14px}
  .cs-module-card strong{font-size:18px}
  .cs-top-link{font-size:11px;padding:7px 8px}
}


/* V3 login refinements */
.cs-login-copy .cs-kicker{letter-spacing:.18em}
.cs-login-copy h1{font-size:40px;line-height:1.06;letter-spacing:-.03em}
.cs-login-copy h1 .infosmart-word{color:#16214a}
.cs-login-copy p{max-width:560px}
.cs-login-card-head h2{font-size:32px;letter-spacing:-.02em}
@media(max-width:760px){
  .cs-login-copy h1{font-size:30px}
  .cs-login-card-head h2{font-size:27px}
}

/* Sales invoice module */
.invoice-page-body{background:#f3f6fb}.invoice-shell{max-width:1500px;margin:0 auto;padding:34px 34px 110px}.invoice-heading{display:flex;justify-content:space-between;gap:20px;align-items:flex-end;margin-bottom:24px}.invoice-heading h1{font-size:34px;margin:6px 0}.invoice-heading p{color:var(--muted);margin:0}.invoice-heading-side{display:flex;flex-direction:column;align-items:flex-end;gap:10px}.invoice-badge{padding:10px 15px;border-radius:999px;background:#e8efff;color:var(--blue);font-weight:800;font-size:12px}.invoice-action-bar{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.invoice-mobile-actions{display:none}.invoice-panel{background:#fff;border:1px solid var(--line);border-radius:20px;padding:22px;box-shadow:0 8px 26px rgba(31,49,96,.05);margin-bottom:18px}.invoice-customer-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}.invoice-field{position:relative}.invoice-field.wide{grid-column:span 2}.invoice-field label{display:block;font-size:11px;font-weight:800;color:#667085;margin:0 0 7px;text-transform:uppercase;letter-spacing:.04em}.invoice-field input,.invoice-field textarea,.invoice-field select,.invoice-table input,.invoice-table select{width:100%;box-sizing:border-box;border:1px solid #ced6e5;border-radius:10px;background:#fff;padding:10px 11px;outline:none;font:inherit}.invoice-field input:focus,.invoice-field textarea:focus,.invoice-table input:focus,.invoice-table select:focus{border-color:#5578dd;box-shadow:0 0 0 3px rgba(65,98,197,.1)}.lookup-results{position:absolute;left:0;right:0;top:100%;z-index:40;margin-top:5px;background:#fff;border:1px solid #cbd5e7;border-radius:12px;box-shadow:0 18px 38px rgba(19,35,80,.18);max-height:330px;overflow:auto}.lookup-results button{display:flex;width:100%;border:0;border-bottom:1px solid #eef1f6;background:#fff;padding:11px 12px;text-align:left;cursor:pointer;flex-direction:column;gap:2px}.lookup-results button:hover{background:#f4f7ff}.lookup-results span,.lookup-results small{color:#687386;font-size:12px}.lookup-empty{padding:14px;color:#7b8494;font-size:13px}.invoice-section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.invoice-section-title h2{margin:0 0 3px;font-size:20px}.invoice-section-title p{margin:0;color:var(--muted);font-size:12px}.invoice-table-wrap{overflow:auto}.invoice-table{width:100%;border-collapse:collapse;min-width:1250px}.invoice-table th{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#667085;text-align:left;padding:10px 8px;border-bottom:1px solid #dfe5ef}.invoice-table td{padding:9px 8px;border-bottom:1px solid #edf0f5;vertical-align:top}.invoice-table .num{text-align:right}.num-input{text-align:right}.item-cell{position:relative}.selected-item{font-size:11px;color:#667085;padding:4px 2px 0;max-width:290px}.row-remove{border:0;background:#fff0ef;color:#b3261e;border-radius:8px;width:32px;height:32px;font-size:20px;cursor:pointer}.invoice-total-area{display:flex;justify-content:space-between;gap:25px;padding-top:18px}.invoice-note{font-size:12px;color:#7d8797}.invoice-totals{width:min(430px,100%);display:grid;gap:7px}.invoice-totals>div{display:flex;justify-content:space-between;border-bottom:1px solid #edf0f4;padding:8px}.invoice-totals .grand{background:#eef3ff;border:0;border-radius:12px;padding:13px;color:#132b78;font-size:18px}.invoice-actions{display:none!important}.invoice-btn{display:inline-flex;align-items:center;justify-content:center;border-radius:11px;border:1px solid #cbd4e4;padding:11px 18px;font-weight:800;cursor:pointer;text-decoration:none}.invoice-btn.secondary{background:#fff;color:#334155}.invoice-btn.primary{background:linear-gradient(135deg,var(--blue),var(--blue2));color:#fff;border-color:transparent;min-width:150px}.invoice-btn:disabled{opacity:.6;cursor:wait}.invoice-alert{border-radius:12px;padding:12px 15px;margin-bottom:16px;font-weight:650}.invoice-alert.error{background:#fff0ef;color:#a52a23;border:1px solid #ffd4d0}.invoice-alert.success{background:#edf9f0;color:#146c31;border:1px solid #ccefd6}
.invoice-print-body{background:#e9edf4;margin:0;font-family:Arial,sans-serif;color:#111}.print-toolbar{width:210mm;max-width:calc(100% - 20px);margin:14px auto;display:flex;justify-content:space-between}.print-toolbar a,.print-toolbar button{padding:8px 12px;background:#fff;border:1px solid #ccd4e1;border-radius:8px;text-decoration:none;color:#172033;cursor:pointer}.invoice-paper{width:210mm;height:297mm;box-sizing:border-box;margin:0 auto 24px;background:#fff;padding:10mm;box-shadow:0 8px 28px rgba(20,30,60,.16);overflow:hidden}.print-head{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:2px solid #182657;padding-bottom:7px}.print-head img{width:1.65in;height:.55in;object-fit:contain;object-position:left center}.print-head>div{text-align:right;display:flex;flex-direction:column;gap:1px;max-width:3.25in}.print-head h1{font-size:18px;margin:0 0 3px;color:#182657;letter-spacing:.04em}.print-head strong{font-size:9px}.print-head span{font-size:7px}.print-meta{display:grid;grid-template-columns:.82fr 1.18fr;gap:12px;padding:9px 0}.print-meta>div{display:grid;grid-template-columns:70px 1fr;gap:3px;font-size:7.5px;line-height:1.2}.print-table{width:100%;border-collapse:collapse;font-size:6.8px;table-layout:fixed}.print-table th{background:#eef2f9;padding:4px 3px;border:1px solid #d9e0eb}.print-table td{padding:4px 3px;border:1px solid #dfe4ed;vertical-align:top;overflow-wrap:anywhere}.print-table th:nth-child(1){width:4%}.print-table th:nth-child(2){width:34%}.print-table th:nth-child(3){width:7%}.print-table th:nth-child(4){width:7%}.print-table th:nth-child(5){width:12%}.print-table th:nth-child(6){width:11%}.print-table th:nth-child(7){width:10%}.print-table th:nth-child(8){width:15%}.print-table .num{text-align:right}.print-table small{font-size:6px}.print-totals{margin:9px 0 0 auto;width:2.65in;font-size:8px}.print-totals div{display:flex;justify-content:space-between;padding:3px 4px}.print-totals .grand{border-top:2px solid #17265b;font-size:10px;padding-top:5px}.print-remarks{font-size:7px;margin-top:9px}.invoice-paper footer{text-align:center;color:#7d8490;font-size:6.5px;margin-top:18px}.cancelled-mark{color:#a00;font-size:12px;margin-top:2px}
@media print{html,body{width:210mm;height:297mm;margin:0!important;padding:0!important}.print-toolbar{display:none!important}.invoice-print-body{background:#fff!important;margin:0!important}.invoice-paper{box-shadow:none!important;margin:0!important;padding:10mm!important;width:210mm!important;height:297mm!important;min-height:297mm!important;max-height:297mm!important;overflow:hidden!important;break-after:avoid!important;page-break-after:avoid!important;break-inside:avoid!important;page-break-inside:avoid!important}@page{size:A4 portrait;margin:0}}

/* Invoice master-maintenance overlay */
.master-modal[hidden]{display:none!important}
.master-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(15,23,42,.58);backdrop-filter:blur(2px)}
.master-modal-card{width:min(1480px,calc(100vw - 48px));height:min(900px,calc(100vh - 48px));background:#fff;border-radius:18px;overflow:hidden;box-shadow:0 28px 80px rgba(15,23,42,.32);border:1px solid rgba(255,255,255,.55)}
.master-modal-card iframe{display:block;width:100%;height:100%;border:0;background:#f3f6fb}
body.master-modal-open{overflow:hidden}
@media(max-width:900px){.master-modal{padding:8px}.master-modal-card{width:calc(100vw - 16px);height:calc(100vh - 16px);border-radius:14px}}

/* CS setup master maintenance pages */
.master-body{margin:0;background:#f3f6fb;color:#172033;min-height:100vh;overflow-x:hidden}
.master-body.master-embed{background:#f3f6fb}
.master-shell{max-width:1500px;margin:0 auto;padding:32px 34px 60px;box-sizing:border-box}
.master-embed .master-shell{max-width:none;padding:24px 26px 34px}
.master-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:22px}
.master-heading h1{margin:6px 0 4px;font-size:32px;line-height:1.12;color:#172033;letter-spacing:-.02em}
.master-heading p{margin:0;color:#697386;font-size:14px}
.master-heading-actions{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.master-layout{display:grid;grid-template-columns:minmax(280px,340px) minmax(0,1fr);gap:18px;align-items:start}
.master-list-panel,.master-form-panel{background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:0 8px 26px rgba(31,49,96,.05);box-sizing:border-box}
.master-list-panel{padding:18px;position:sticky;top:20px;max-height:calc(100vh - 150px);display:flex;flex-direction:column;min-height:520px}
.master-embed .master-list-panel{top:0;max-height:calc(100vh - 125px)}
.master-form-panel{padding:22px;min-width:0}
.master-search-label{display:block;font-size:11px;font-weight:800;color:#667085;text-transform:uppercase;letter-spacing:.04em;margin:0 0 7px}
.master-search{width:100%;box-sizing:border-box;border:1px solid #ced6e5;border-radius:10px;background:#fff;padding:11px 12px;outline:none;font:inherit}
.master-search:focus{border-color:#5578dd;box-shadow:0 0 0 3px rgba(65,98,197,.1)}
.master-filter{margin-top:12px}
.master-results{margin-top:12px;overflow:auto;border:1px solid #e1e6ef;border-radius:12px;background:#fff;flex:1;min-height:220px}
.master-results>button{display:flex;width:100%;box-sizing:border-box;border:0;border-bottom:1px solid #edf0f5;background:#fff;padding:12px 13px;text-align:left;cursor:pointer;flex-direction:column;gap:3px;color:#172033}
.master-results>button:last-child{border-bottom:0}
.master-results>button:hover,.master-results>button:focus{background:#f3f6ff;outline:none}
.master-results strong{font-size:14px;overflow-wrap:anywhere}
.master-results span{font-size:13px;color:#4b5565;line-height:1.35;overflow-wrap:anywhere}
.master-results small{font-size:11px;color:#7a8495;line-height:1.3}
.master-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.master-grid .invoice-field.wide{grid-column:span 2}
.master-form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px;padding-top:18px;border-top:1px solid #e8edf4}
.master-form-panel .invoice-field input:disabled{background:#f4f6f9;color:#667085;cursor:not-allowed}
.item-edit-btn{margin-top:5px;border:0;background:transparent;color:#3157bf;padding:2px 0;font-size:11px;font-weight:800;cursor:pointer}
.item-edit-btn:hover{text-decoration:underline}

@media(max-width:1100px){
  .master-shell{padding:24px 22px 50px}
  .master-layout{grid-template-columns:280px minmax(0,1fr)}
  .master-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .master-shell,.master-embed .master-shell{padding:16px 12px 36px}
  .master-heading{align-items:flex-start;flex-direction:column}
  .master-heading h1{font-size:27px}
  .master-heading-actions{width:100%}
  .master-heading-actions .invoice-btn{flex:1}
  .master-layout{grid-template-columns:1fr}
  .master-list-panel{position:static;max-height:none;min-height:300px}
  .master-embed .master-list-panel{max-height:none}
  .master-grid{grid-template-columns:1fr}
  .master-grid .invoice-field.wide{grid-column:span 1}
  .master-form-panel{padding:16px}
  .master-form-actions{position:sticky;bottom:0;background:#fff;padding-bottom:4px;z-index:5}
  .master-form-actions .invoice-btn{width:100%}
}

/* Item Master: fast list/editor workflow */
.master-mobile-tabs{display:none}
.master-list-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:10px}
.master-panel-hint{font-size:12px;color:#8992a3;margin-top:3px}
.master-form-head{display:flex;align-items:center;gap:12px;padding-bottom:16px;margin-bottom:18px;border-bottom:1px solid #e8edf4}
.master-form-title{display:flex;flex-direction:column;min-width:0}
.master-form-title span{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:#7b8495}
.master-form-title strong{font-size:15px;color:#172033;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:720px}
.master-back-btn{display:none;border:1px solid #ccd5e4;background:#fff;color:#26324b;border-radius:10px;padding:9px 11px;font-weight:750;cursor:pointer}
.master-results>button.selected{background:#eaf0ff;box-shadow:inset 3px 0 0 #3155c6}

@media(max-width:720px){
  .master-heading{margin-bottom:12px}
  .master-heading>div:first-child p,.master-heading .cs-kicker{display:none}
  .master-heading h1{font-size:22px;margin:0}
  .master-heading-actions{gap:8px}
  .master-heading-actions .invoice-btn{min-height:42px}
  .master-mobile-tabs{position:sticky;top:0;z-index:20;display:grid;grid-template-columns:1fr 1fr;gap:4px;background:#eef2f8;padding:4px;border-radius:12px;margin:0 0 12px;box-shadow:0 4px 14px rgba(31,49,96,.08)}
  .master-mobile-tabs button{border:0;background:transparent;border-radius:9px;padding:10px 8px;font:inherit;font-weight:800;color:#667085}
  .master-mobile-tabs button.active{background:#fff;color:#2447b8;box-shadow:0 2px 8px rgba(31,49,96,.10)}
  .master-layout{display:block}
  .master-list-panel{display:flex;min-height:0;height:calc(100vh - 215px);max-height:none;padding:12px;border-radius:15px}
  .master-results{min-height:0;margin-top:10px}
  .master-results>button{padding:11px 12px}
  .master-results strong{font-size:14px}
  .master-results span{font-size:12.5px}
  .master-form-panel{display:none;border-radius:15px;padding:14px 14px 78px}
  .master-layout.mobile-edit .master-list-panel{display:none}
  .master-layout.mobile-edit .master-form-panel{display:block}
  .master-form-head{position:sticky;top:56px;z-index:10;background:#fff;margin:-4px -4px 14px;padding:8px 4px 12px}
  .master-back-btn{display:inline-flex;align-items:center;flex:0 0 auto}
  .master-form-title strong{font-size:13px;max-width:calc(100vw - 135px)}
  .master-grid{gap:12px}
  .master-form-actions{position:fixed;left:12px;right:12px;bottom:10px;z-index:25;margin:0;padding:8px;background:rgba(255,255,255,.96);border:1px solid #e4e9f2;border-radius:13px;box-shadow:0 10px 30px rgba(24,39,75,.18);backdrop-filter:blur(8px)}
  .master-form-actions .invoice-btn{min-height:46px}
  .master-embed .master-mobile-tabs{top:0}
  .master-embed .master-form-head{top:56px}
}

/* 2026-08-15 invoice workflow refinements */
.invoice-dialog[hidden]{display:none!important}.invoice-dialog{position:fixed;inset:0;z-index:1100;background:rgba(15,23,42,.58);display:flex;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(2px)}.invoice-dialog-card{width:min(1100px,calc(100vw - 32px));max-height:calc(100vh - 32px);overflow:auto;background:#fff;border-radius:20px;box-shadow:0 28px 80px rgba(15,23,42,.32);padding:22px}.dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;border-bottom:1px solid #e7ebf2;padding-bottom:14px;margin-bottom:16px}.dialog-head h2{margin:4px 0 0}.dialog-close{border:0;background:#eef2f8;width:38px;height:38px;border-radius:10px;font-size:24px;cursor:pointer}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px;padding-top:16px;border-top:1px solid #e7ebf2}.preview-company{display:flex;align-items:center;gap:16px;padding-bottom:16px;border-bottom:2px solid #1e347d}.preview-company img{width:190px;max-height:65px;object-fit:contain}.preview-company>div{display:flex;flex-direction:column;gap:3px}.preview-company span{font-size:12px;color:#59657a}.preview-meta{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:16px 0}.preview-meta>div{display:flex;flex-direction:column;gap:4px}.preview-meta small{color:#697386}.preview-lines{border:1px solid #e2e7f0;border-radius:12px;overflow:hidden}.preview-line{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:14px;align-items:center;padding:12px 14px;border-bottom:1px solid #edf0f5}.preview-line:last-child{border-bottom:0}.preview-line>div:first-child{display:flex;flex-direction:column;gap:2px}.preview-line span{font-size:13px}.preview-line small{font-size:11px;color:#667085}.preview-totals{margin:16px 0 0 auto;width:min(360px,100%)}.preview-totals>div{display:flex;justify-content:space-between;padding:7px 8px}.preview-totals .grand{border-top:2px solid #1e347d;font-size:16px}.history-card{width:min(760px,calc(100vw - 32px))}.history-results{margin-top:12px;border:1px solid #e1e6ef;border-radius:12px;max-height:60vh;overflow:auto}.history-results button{width:100%;border:0;border-bottom:1px solid #edf0f5;background:#fff;padding:12px 14px;text-align:left;display:flex;flex-direction:column;gap:3px;cursor:pointer}.history-results button:hover{background:#f3f6ff}.history-results span{font-size:13px}.history-results small{font-size:11px;color:#697386}.readonly-description{min-width:180px;max-width:320px;padding:9px 10px;border-radius:9px;background:#f4f6fa;border:1px solid #e0e5ee;font-size:13px;line-height:1.35}.danger-action{background:#fff3f2!important;color:#b42318!important;border:1px solid #f5c2bd!important}.company-address{max-width:300px;margin-left:auto;line-height:1.35}.ref-detail{font-size:10px;color:#555}.cancelled-mark{color:#b42318;border:2px solid #b42318;padding:3px 7px;margin-top:6px;align-self:flex-end;transform:rotate(-4deg)}
@media(max-width:720px){.invoice-items-scroll{min-height:58vh;max-height:68vh;overflow:auto}.invoice-table tbody tr{scroll-margin-top:86px}.invoice-table .item-results{position:static!important;max-height:260px;overflow:auto;margin-top:6px;box-shadow:none}.invoice-dialog{padding:6px}.invoice-dialog-card{width:calc(100vw - 12px);max-height:calc(100vh - 12px);border-radius:14px;padding:14px}.preview-meta{grid-template-columns:1fr}.preview-company img{width:135px}.preview-line{grid-template-columns:1fr auto;gap:8px}.preview-line>strong{grid-column:2;grid-row:1 / span 2}.dialog-actions{position:sticky;bottom:-14px;background:#fff;padding:10px 0 0}.dialog-actions .invoice-btn{flex:1}.readonly-description{max-width:none;min-width:0}.invoice-items-panel{padding-bottom:10px}.invoice-items-panel .invoice-total-area{margin-top:14px}.history-results{max-height:70vh}}

/* Simple Item Master sales-UOM setup */
.uom-config-block{padding:12px;border:1px solid #e0e6f0;border-radius:12px;background:#f8faff}
.uom-config-head,.uom-config-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:center}
.uom-config-head{font-size:10px;font-weight:800;color:#748095;text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px}
.uom-config-row{margin-bottom:7px}.uom-config-row input{background:#fff}.field-help{display:block;color:#6f7b8f;line-height:1.35;margin-top:5px}
@media(max-width:560px){.uom-config-head,.uom-config-row{grid-template-columns:1fr 1fr;gap:8px}.uom-config-block{padding:10px}}


/* CS branded confirmation dialog — replaces browser confirm() in Sales Invoice */
.confirm-card{width:min(500px,calc(100vw - 28px));text-align:center;padding:26px 24px 22px}
.confirm-icon{width:54px;height:54px;margin:0 auto 14px;border-radius:50%;display:grid;place-items:center;background:#fff1f0;color:#b42318;font-size:27px;font-weight:900;border:1px solid #fecaca}
.confirm-copy h2{margin:5px 0 10px;color:#172033;font-size:24px}
.confirm-copy p{margin:0 auto;color:#5d687a;line-height:1.55;max-width:410px;white-space:pre-line}
.confirm-actions{justify-content:center;margin-top:22px}
.confirm-actions .invoice-btn{min-width:145px}
@media(max-width:560px){.confirm-card{padding:22px 16px 16px;border-radius:18px}.confirm-copy h2{font-size:22px}.confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.confirm-actions .invoice-btn{min-width:0;width:100%;padding-left:10px;padding-right:10px}}

/* Sales invoice desktop item-entry workspace.
   Keep enough vertical room below the active line for item lookup results. */
@media (min-width:721px){
  .invoice-items-scroll{
    min-height:390px;
    max-height:58vh;
    overflow:auto;
  }
  .invoice-items-scroll .item-results{
    max-height:300px;
  }
  .invoice-items-panel .invoice-total-area{
    margin-top:14px;
  }
}


/* 2026-08-15: keep invoice UOM readable on desktop and mobile */
.invoice-table th.uom-col,.invoice-table td.uom-cell{min-width:104px;width:104px}
.invoice-table .uom-select{min-width:96px;width:100%;padding-left:10px;padding-right:28px;white-space:nowrap}
@media(max-width:720px){
  .invoice-table th.uom-col,.invoice-table td.uom-cell{min-width:112px;width:112px}
  .invoice-table .uom-select{min-width:104px;font-size:15px}
}

.invoice-action-bar [hidden],.invoice-mobile-actions [hidden]{display:none!important}

/* ================================================================
   2026-08-30 Invoice responsive restore
   Keep Sales Invoice isolated from generic/shared transaction layout.
   ================================================================ */
@media (max-width: 900px){
  .invoice-page-body .invoice-shell{padding:24px 20px 118px}
  .invoice-page-body .invoice-heading{align-items:flex-start}
  .invoice-page-body .invoice-customer-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .invoice-page-body .invoice-field.wide{grid-column:1 / -1}
  .invoice-page-body .customer-tools{grid-column:1 / -1}
}

@media (max-width: 760px){
  /* Mobile invoice header: title gets the full width. Actions move to bottom bar. */
  .invoice-page-body .cs-topbar{height:78px;min-height:78px;padding:8px 12px;gap:8px}
  .invoice-page-body .cs-brand{width:155px;min-width:0;flex:0 1 155px}
  .invoice-page-body .cs-brand img{max-width:100%;max-height:58px}
  .invoice-page-body .cs-topbar-title{display:none}
  .invoice-page-body .cs-user-area{margin-left:auto;gap:5px;min-width:0}
  .invoice-page-body .cs-user-copy{display:none}
  .invoice-page-body .cs-top-link{font-size:0;padding:8px 10px;min-width:42px;min-height:40px}
  .invoice-page-body .cs-top-link[href="/portal"]::after{content:"Hub";font-size:11px}
  .invoice-page-body .cs-top-link.danger::after{content:"Logout";font-size:11px}

  .invoice-page-body .invoice-shell{width:100%;max-width:none;padding:22px 14px 112px;overflow-x:hidden}
  .invoice-page-body .invoice-heading{display:block;margin-bottom:18px}
  .invoice-page-body .invoice-heading>div:first-child{width:100%;min-width:0}
  .invoice-page-body .invoice-heading h1{font-size:30px;line-height:1.1;margin:7px 0 8px;overflow-wrap:normal;word-break:normal}
  .invoice-page-body .invoice-heading p{font-size:14px;line-height:1.45;max-width:34rem}
  .invoice-page-body .invoice-heading-side{display:block;width:100%;margin-top:12px}
  .invoice-page-body .invoice-badge{display:inline-flex;padding:8px 12px}
  .invoice-page-body .invoice-action-bar{display:none!important}

  /* Customer header/details must never retain the desktop 4-column grid. */
  .invoice-page-body .invoice-panel{width:100%;min-width:0;border-radius:17px;padding:16px;margin-bottom:14px}
  .invoice-page-body .invoice-customer-grid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:13px!important}
  .invoice-page-body .invoice-customer-grid>*{grid-column:1 / -1!important;min-width:0!important;width:100%!important}
  .invoice-page-body .invoice-field,.invoice-page-body .customer-search-wrap{min-width:0;width:100%}
  .invoice-page-body .invoice-field label{font-size:11px;line-height:1.25;margin-bottom:6px;white-space:normal}
  .invoice-page-body .invoice-field input,
  .invoice-page-body .invoice-field textarea,
  .invoice-page-body .invoice-field select{display:block;width:100%!important;min-width:0!important;max-width:100%!important;min-height:46px;font-size:16px;padding:10px 12px}
  .invoice-page-body .invoice-field textarea{min-height:74px;resize:vertical}
  .invoice-page-body .lookup-results{left:0;right:0;width:100%;max-width:100%}
  .invoice-page-body .customer-tools{display:grid!important;grid-template-columns:1fr 1fr;gap:9px;margin-top:2px}
  .invoice-page-body .customer-tools .invoice-btn{width:100%;min-width:0;padding:10px 8px}

  /* Item area remains a usable horizontal data grid instead of shrinking columns. */
  .invoice-page-body .invoice-section-title{display:block;margin-bottom:12px}
  .invoice-page-body .invoice-section-title h2{font-size:19px}
  .invoice-page-body .invoice-section-title p{line-height:1.45;margin-top:4px}
  .invoice-page-body .master-inline-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
  .invoice-page-body .master-inline-actions .invoice-btn{width:100%;min-width:0;padding-left:8px;padding-right:8px}
  .invoice-page-body .invoice-items-scroll{width:100%;min-height:48vh;max-height:62vh;overflow:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--line);border-radius:12px}
  .invoice-page-body .invoice-table{min-width:1250px}
  .invoice-page-body .invoice-total-area{display:block;padding-top:14px}
  .invoice-page-body .invoice-note{margin-bottom:10px}
  .invoice-page-body .invoice-totals{width:100%}

  /* Standard transaction actions on mobile: compact fixed bar, not beside title. */
  .invoice-page-body .invoice-mobile-actions{position:fixed;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));z-index:900;padding:8px;border:1px solid var(--is-line,var(--line));border-radius:16px;background:rgba(255,255,255,.96);box-shadow:0 14px 38px rgba(16,25,56,.22);backdrop-filter:blur(12px)}
  .invoice-page-body .invoice-mobile-actions .invoice-btn{width:100%;min-width:0;min-height:48px;padding:7px 4px;border-radius:11px;font-size:12px;line-height:1.1;gap:4px;white-space:nowrap}
  .invoice-page-body .invoice-mobile-actions .invoice-btn.primary{min-width:0}
  .invoice-page-body .invoice-mobile-actions [hidden]{display:none!important}

  /* Dialogs and preview stay inside the phone viewport. */
  .invoice-page-body .invoice-dialog{padding:6px}
  .invoice-page-body .invoice-dialog-card{width:calc(100vw - 12px);max-width:calc(100vw - 12px);max-height:calc(100dvh - 12px);padding:14px;border-radius:15px}
}

@media (max-width: 430px){
  .invoice-page-body .cs-brand{width:132px;flex-basis:132px}
  .invoice-page-body .invoice-shell{padding-left:10px;padding-right:10px}
  .invoice-page-body .invoice-panel{padding:14px 12px}
  .invoice-page-body .invoice-heading h1{font-size:27px}
  .invoice-page-body .invoice-mobile-actions{grid-template-columns:repeat(4,minmax(0,1fr));left:5px;right:5px;gap:4px;padding:6px}
  .invoice-page-body .invoice-mobile-actions .invoice-btn{font-size:11px;min-height:46px;padding:6px 2px}
  .invoice-page-body .customer-tools,.invoice-page-body .master-inline-actions{grid-template-columns:1fr}
}

/* Dark theme support for the fixed mobile invoice action surface. */
html[data-theme="dark"] .invoice-page-body .invoice-mobile-actions,
body[data-theme="dark"] .invoice-page-body .invoice-mobile-actions,
.invoice-page-body[data-theme="dark"] .invoice-mobile-actions{
  background:rgba(17,27,46,.96);
}
/* 6x8 dot-matrix invoice: monochrome line-art only; deliberately no shaded fills. */
.tax-guideline-paper .print-head{border-color:#000}.tax-guideline-paper .print-head h1{color:#000}.tax-parties{display:grid;grid-template-columns:1fr 1fr;border:1px solid #000;margin:8px 0 5px}.tax-parties>div{padding:5px;min-height:.72in;display:flex;flex-direction:column;gap:2px;font-size:6.8px}.tax-parties>div+div{border-left:1px solid #000}.tax-parties b{font-size:7.2px}.tax-parties strong{font-size:7px}.tax-meta{display:grid;grid-template-columns:72px 1fr 44px 1fr;gap:3px 4px;font-size:6.6px;margin:5px 0 7px}.tax-guideline-paper .print-table th{background:#fff!important;border-color:#000;color:#000}.tax-guideline-paper .print-table td{border-color:#000}.tax-guideline-paper .print-totals .grand{border-color:#000}.tax-bottom{font-size:6.5px;margin-top:8px;display:flex;flex-direction:column;gap:3px}.signature-row{display:flex;justify-content:space-between;margin-top:16px;font-size:6px}.signature-row span{width:1.55in;border-top:1px solid #000;padding-top:3px}.signature-row span:last-child{text-align:right}.tax-guideline-paper footer{color:#000;margin-top:8px}


/* 2026-09-04: Professional module icon set (inline SVG, no external dependency). */
.cs-icon-svg{width:1em;height:1em;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.cs-nav-icon{display:grid;place-items:center;flex:0 0 auto}
.cs-nav-icon .cs-icon-svg{width:20px;height:20px}
.cs-card-icon{box-shadow:inset 0 0 0 1px rgba(36,58,167,.08)}
.cs-card-icon .cs-icon-svg{width:30px;height:30px}
.cs-module-card:hover .cs-card-icon{background:#e6edff;transform:translateY(-1px);transition:background .18s ease,transform .18s ease}
@media(max-width:760px){.cs-card-icon .cs-icon-svg{width:27px;height:27px}.cs-nav-icon .cs-icon-svg{width:19px;height:19px}}


/* SOFTCOOL Operations Hub integration - 2026-09-15 */
.softcool-hub{--sc-orange:#f28b25;--sc-orange-soft:#fff2e4;--sc-navy:#15385b}
.softcool-brand{display:flex!important;align-items:center;gap:10px;width:auto!important;min-width:205px}
.softcool-brand-mark{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;background:linear-gradient(145deg,#f59a35,#e87412);color:#fff;font-weight:900;letter-spacing:-.04em;box-shadow:0 8px 20px rgba(232,116,18,.22)}
.softcool-brand-mark.large{width:72px;height:72px;border-radius:20px;font-size:25px}
.softcool-brand-name{font-size:21px!important;color:#173b5e!important;font-weight:900;letter-spacing:.055em}
.softcool-login-brand{display:flex;align-items:center;gap:16px;margin-bottom:42px}.softcool-login-brand>div{display:flex;flex-direction:column}.softcool-login-brand strong{font-size:28px;letter-spacing:.06em;color:#173b5e}.softcool-login-brand span:not(.softcool-brand-mark){font-size:12px;color:#778397;margin-top:3px}
.softcool-quick-section{margin:0 0 42px}.softcool-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin:0 0 16px}.softcool-section-head h2{font-size:24px;margin:4px 0 0}.softcool-section-head>span{font-size:12px;color:var(--muted)}.module-section-head{margin-top:10px}
.softcool-quick-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.softcool-quick-card{position:relative;display:grid;grid-template-columns:50px minmax(0,1fr) 22px;gap:14px;align-items:center;min-height:112px;padding:18px 18px;border:1px solid #e1e7f0;border-radius:18px;background:#fff;box-shadow:0 7px 24px rgba(32,55,89,.055);transition:.18s ease}.softcool-quick-card:hover{transform:translateY(-2px);border-color:#f2bf8b;box-shadow:0 14px 34px rgba(42,58,89,.10)}.softcool-quick-card.featured{background:linear-gradient(145deg,#fff 25%,#fff8f0 100%);border-color:#f5c99e}.softcool-quick-card .quick-icon{width:50px;height:50px;border-radius:15px;display:grid;place-items:center;background:var(--sc-orange-soft);color:#df7312;font-size:23px;font-weight:900}.softcool-quick-card strong,.softcool-quick-card small{display:block}.softcool-quick-card strong{font-size:16px;margin-bottom:5px;color:#1d2b3d}.softcool-quick-card small{font-size:12px;line-height:1.42;color:#758095}.softcool-quick-card .quick-arrow{font-size:20px;color:#d97920}.theme-link{cursor:pointer;color:inherit}
.preview-brand-mark{min-width:132px;height:56px;padding:0 16px;border-radius:13px;display:grid;place-items:center;background:#fff2e4;color:#d86d0c;font-weight:900;font-size:19px;letter-spacing:.06em}.print-brand-text{font-size:18px;font-weight:900;letter-spacing:.06em;color:#111;min-width:110px}
@media(max-width:1100px){.softcool-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.softcool-brand{min-width:0}.softcool-brand-name{font-size:17px!important}.softcool-brand-mark{width:39px;height:39px}.softcool-quick-grid{grid-template-columns:1fr}.softcool-section-head{align-items:flex-start}.softcool-section-head>span{display:none}.softcool-login-brand{margin-bottom:25px}.softcool-quick-card{min-height:104px}}


/* SOFTCOOL official logo integration - 2026-09-15 */
.softcool-brand{width:245px!important;min-width:245px!important;gap:0!important}
.softcool-brand-logo{display:block;width:100%;height:auto;max-height:62px;object-fit:contain;object-position:left center}
.softcool-login-logo{display:block;width:min(520px,100%);height:auto;object-fit:contain;object-position:left center;margin:0 0 42px}
@media(max-width:760px){.softcool-brand{width:170px!important;min-width:170px!important}.softcool-brand-logo{max-height:52px}.softcool-login-logo{width:min(420px,100%);margin-bottom:25px}}
@media(max-width:440px){.softcool-brand{width:132px!important;min-width:132px!important}.softcool-brand-logo{max-height:44px}}
