
:root{--brand:#198754;--brand-soft:rgba(25,135,84,.12);--brand-dark:#146c43;--product-image-ratio:1 / 1;--app-navbar-height:56px;}
html,body{height:100%;max-width:100%;overflow-x:clip;}
body.app-body{background:#f5f7f6;color:#1f2937;font-size:14px;max-width:100%;overflow-x:clip;}
*,*::before,*::after{box-sizing:border-box;}
.app-navbar{background:#fff;border-bottom:1px solid #e5e7eb;position:-webkit-sticky;position:sticky;top:0;z-index:1105;}
.app-shell{display:flex;min-height:calc(100vh - 56px);min-width:0;max-width:100%;overflow-x:clip;}
.app-sidebar-col{flex:0 0 280px;max-width:280px;transition:flex-basis .18s ease,max-width .18s ease;}
.app-main-col{flex:1 1 auto;min-width:0;max-width:100%;overflow-x:clip;}
.desktop-sidebar-toggle{width:42px;height:42px;padding:0;align-items:center;justify-content:center;}
.sidebar-toggle-label{display:inline-flex;align-items:center;gap:.55rem;}
.sidebar-footer-meta{min-width:0;}
.sidebar-footer-icon{display:none;font-size:1.1rem;color:var(--brand-dark);}
.app-content{padding:14px;min-width:0;max-width:100%;overflow-x:clip;}
.page-card{background:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 2px 8px rgba(15,23,42,.04);max-width:100%;}
.page-header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px;}
.page-title{margin:0;font-size:1.05rem;font-weight:700;}
.page-subtitle{display:none;}
.sidebar-shell{background:#fff;border-right:1px solid #e5e7eb;min-height:calc(100dvh - 56px);}
.sidebar-mobile-header{display:none;align-items:center;justify-content:space-between;padding:12px 14px;background:#fff;min-height:56px;}
.sidebar-mobile-title{font-size:1rem;font-weight:800;color:#0f172a;letter-spacing:.01em;}
.sidebar-body-shell{display:flex;flex-direction:column;min-height:calc(100vh - 56px);height:100%;}
.sidebar-scroll{padding:16px 12px 12px;flex:1 1 auto;min-height:0;overflow:auto;}
.sidebar-scroll > .sidebar-accordion{margin-top:0;}
.sidebar-mobile-backdrop{display:none;}

.sidebar-link{display:flex;align-items:center;gap:12px;padding:12px 14px;margin-bottom:6px;border-radius:14px;color:#334155;text-decoration:none;font-weight:600;}
.sidebar-link i{color:var(--brand);}
.sidebar-link.active,.sidebar-link:hover{background:var(--brand-soft);color:var(--brand-dark);}
.sidebar-section-title{font-size:.75rem;text-transform:uppercase;letter-spacing:.05em;color:#6b7280;font-weight:700;padding:12px 14px 6px;}
.sidebar-footer{border-top:1px solid #e5e7eb;padding:14px;background:#fff;}
.global-loader{position:fixed;inset:0;background:transparent;display:flex;align-items:center;justify-content:center;z-index:2000;pointer-events:none;transition:background .16s ease,backdrop-filter .16s ease;}
.global-loader-card{pointer-events:auto;display:flex;align-items:center;gap:12px;padding:14px 18px;border-radius:18px;background:#fff;border:1px solid rgba(25,135,84,.12);box-shadow:0 14px 34px rgba(15,23,42,.10);min-width:150px;justify-content:center;}
.global-loader-spinner{width:2rem;height:2rem;border-width:.24em;}
.global-loader-text{font-weight:700;color:var(--brand-dark);letter-spacing:.01em;}
.global-loader.global-loader-dim{background:rgba(255,255,255,.50);backdrop-filter:blur(1.5px);pointer-events:auto;}
.global-loader.global-loader-over-modal{z-index:2000;}
.modal.modal-processing .modal-content{box-shadow:0 18px 40px rgba(15,23,42,.14);}
.toast-container-fixed{position:fixed;top:12px;right:12px;z-index:2100;max-width:min(92vw,420px);}
#liveToast{min-width:min(92vw,340px);}
.fab-add{position:fixed;right:16px;bottom:16px;z-index:1050;border-radius:999px;padding:12px 18px;font-weight:700;box-shadow:0 10px 24px rgba(25,135,84,.25);}

@media (min-width:992px){
  .sidebar-body-shell{overflow:hidden;}
  .sidebar-scroll{padding-bottom:16px;}
  .sidebar-footer-card-static{margin-top:12px;}
}

.table-thumb,.gallery-thumb,.image-preview-square,.master-mobile-thumb{display:block;object-fit:cover;aspect-ratio:var(--product-image-ratio,1 / 1);border:1px solid #d1d5db;background:#fff;}
.table-thumb{width:48px;height:auto;border-radius:10px;}
.gallery-thumb,.image-preview-square{width:72px;height:auto;border-radius:12px;}
.master-mobile-thumb{width:88px;height:auto;border-radius:18px;flex:0 0 88px;}
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,#effaf4 0,#f7f9f8 100%);padding:18px;}
.login-card{width:100%;max-width:420px;border:0;border-radius:22px;overflow:hidden;box-shadow:0 20px 45px rgba(16,24,40,.08);}
.login-card .card-body{padding:24px;}
.form-control,.form-select{min-height:44px;border-radius:12px;}
.btn{border-radius:12px;}
.dt-buttons,.dataTables_length,.dataTables_info{display:none!important;}
.dataTables_wrapper{width:100%;max-width:100%;min-width:0;}
.dataTables_wrapper .dataTables_filter{display:flex;justify-content:flex-end;max-width:100%;min-width:0;}
.dataTables_wrapper .dataTables_filter label{width:100%;max-width:100%;display:flex;justify-content:flex-end;margin:0;}
.dataTables_wrapper .dataTables_filter input{margin-left:0;border-radius:12px;border:1px solid #d1d5db;padding:.45rem .75rem;min-width:0;width:min(260px,100%);max-width:100%;}
.card-stat{background:#fff;border-radius:18px;border:1px solid #e5e7eb;padding:16px;box-shadow:0 2px 8px rgba(15,23,42,.04);}
.table-responsive{max-width:100%;overflow-x:auto;overflow-y:hidden;}
.page-header,.page-actions{max-width:100%;min-width:0;}
.page-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.page-header > div:first-child{min-width:0;}

.card-stat .value{font-size:1.3rem;font-weight:800;color:var(--brand-dark);}
.form-section{background:#f8faf9;border:1px solid #e5e7eb;border-radius:14px;padding:14px;margin-bottom:12px;overflow:visible;}
.offcanvas-lg{--bs-offcanvas-width:280px;}
.modal{overflow-y:auto;}
.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);}
.modal-dialog-scrollable .modal-body{overflow-y:auto;max-height:calc(100vh - 165px);-webkit-overflow-scrolling:touch;}
.search-select{position:relative;overflow:visible;}
.search-select:focus-within{z-index:2060;}
.search-select-menu{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:2055;background:#fff;border:1px solid #d1d5db;border-radius:12px;box-shadow:0 14px 30px rgba(15,23,42,.12);max-height:220px;overflow:auto;display:none;}
.search-select-menu.drop-up{top:auto;bottom:calc(100% + 6px);} 
.search-select-menu.show{display:block;}
.search-select-item{width:100%;border:0;background:#fff;text-align:left;padding:10px 12px;font-size:.94rem;display:block;}
.search-select-item:hover,.search-select-item.active{background:var(--brand-soft);color:var(--brand-dark);}
.search-select-item.disabled{color:#6b7280;pointer-events:none;}
.richtext-shell{border:1px solid #d1d5db;border-radius:12px;background:#fff;overflow:hidden;}
.richtext-toolbar{display:flex;flex-wrap:wrap;gap:6px;padding:8px;border-bottom:1px solid #e5e7eb;background:#f8faf9;}
.richtext-toolbar button{border:1px solid #d1d5db;background:#fff;padding:6px 10px;border-radius:10px;font-size:.9rem;}
.richtext-editor{min-height:170px;padding:12px;outline:none;}
.master-mobile-cards{display:none;}
.master-mobile-card{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:14px;margin-bottom:12px;box-shadow:0 2px 8px rgba(15,23,42,.04);}
.master-mobile-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.master-mobile-title{font-weight:700;font-size:1rem;line-height:1.35;word-break:break-word;}
.master-mobile-subtitle{font-size:.84rem;color:#6b7280;line-height:1.35;margin-top:4px;word-break:break-word;}
.mobile-action-toggle{width:36px;height:36px;padding:0;display:inline-flex;align-items:center;justify-content:center;}
.master-mobile-chips{display:grid;grid-template-columns:1fr;gap:8px;margin-top:12px;}
.master-mobile-chip{background:#f8faf9;border-radius:12px;padding:10px 12px;display:flex;justify-content:space-between;gap:12px;align-items:flex-start;}
.master-mobile-chip span{color:#6b7280;font-size:.82rem;}
.master-mobile-chip strong{font-size:.92rem;font-weight:700;text-align:right;word-break:break-word;}
.master-mobile-empty{background:#fff;border:1px dashed #d1d5db;border-radius:18px;padding:18px;text-align:center;color:#6b7280;}
.master-mobile-search{margin-bottom:12px;}
.master-mobile-search-box{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:10px 12px;box-shadow:0 2px 8px rgba(15,23,42,.04);}
.master-mobile-search-box i{color:#6b7280;font-size:1rem;}
.master-mobile-search-box .form-control{border:0;box-shadow:none;padding:0;min-height:auto;background:transparent;}
.record-view-hero{display:flex;gap:12px;align-items:center;padding:6px 2px 16px;margin-bottom:10px;border-bottom:1px solid #eef2f7;}
.record-view-hero-icon{width:44px;height:44px;border-radius:14px;background:var(--brand-soft);color:var(--brand-dark);display:flex;align-items:center;justify-content:center;font-size:1.1rem;}
.record-view-hero-title{font-size:1.05rem;font-weight:800;line-height:1.2;}
.record-view-hero-subtitle{font-size:.85rem;color:#6b7280;margin-top:3px;}
.record-view-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.record-view-card{background:#f8faf9;border:1px solid #e5e7eb;border-radius:16px;padding:12px 14px;min-height:84px;}
.record-view-label{font-size:.75rem;color:#6b7280;margin-bottom:6px;text-transform:uppercase;letter-spacing:.05em;font-weight:700;}
.record-view-value{font-size:.95rem;word-break:break-word;line-height:1.45;font-weight:600;color:#111827;}
@media (max-width:991.98px){.offcanvas-lg{visibility:visible;}}
@media (max-width:1199.98px){
  .order-bottom-bar{left:12px;right:12px;bottom:0;padding:8px 10px calc(8px + env(safe-area-inset-bottom));}
}
@media (max-width:767.98px){
  .modal-dialog{margin:.35rem;}
  .modal-dialog-scrollable .modal-content{max-height:calc(100vh - .7rem);}
  .page-header{align-items:flex-start;}
  .toast-container-fixed{top:10px;right:10px;left:10px;max-width:none;}
  #liveToast{min-width:0;width:100%;}
  .desktop-master-table{display:none;}
  .master-mobile-cards{display:block;}
  .fab-add{padding:10px 14px;font-size:.9rem;}
  .dataTables_wrapper .dataTables_filter input{min-width:100%;width:100%;}
}
@media (min-width:992px){
  .sidebar-mobile-backdrop{display:none!important;}
  .sidebar-shell{position:sticky;top:56px;height:calc(100dvh - 56px);display:flex;flex-direction:column;}
  .sidebar-mobile-header{display:none!important;}
  body.desktop-sidebar-collapsed .app-sidebar-col{flex-basis:92px;max-width:92px;}
  body.desktop-sidebar-collapsed .sidebar-shell,
  body.desktop-sidebar-collapsed .sidebar-body-shell,
  body.desktop-sidebar-collapsed .sidebar-scroll{overflow:visible;}
  body.desktop-sidebar-collapsed .sidebar-scroll{padding:10px 8px;}
  body.desktop-sidebar-collapsed .sidebar-accordion{padding:8px 0;gap:8px;}
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-link{justify-content:center;padding:12px 10px;border-radius:18px;margin:0 6px;}
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-link span{display:none;}
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-link i{margin:0;font-size:1.15rem;}
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item{position:relative;background:transparent;border:0;border-radius:0;overflow:visible;}
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item > .sidebar-acc-toggle{width:56px;height:56px;padding:0;margin:0 auto;border-radius:18px;justify-content:center;background:#fff;border:1px solid #e5e7eb;box-shadow:0 6px 16px rgba(15,23,42,.06);}
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item > .sidebar-acc-toggle .sidebar-text,
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item > .sidebar-acc-toggle .bi-chevron-down{display:none;}
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item > .sidebar-acc-toggle .sidebar-toggle-label i{margin:0!important;font-size:1.12rem;}
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item > .sidebar-acc-toggle.active,
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item > .sidebar-acc-toggle:hover{background:var(--brand-soft);border-color:rgba(25,135,84,.18);color:var(--brand-dark);}
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item > .collapse,
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item > .collapsing{position:absolute;left:calc(100% + 10px);top:0;width:min(320px,calc(100vw - 130px));max-height:calc(100vh - 76px);overflow:auto;background:#fff;border:1px solid #e5e7eb;border-radius:22px;box-shadow:0 18px 36px rgba(15,23,42,.12);z-index:1055;height:auto!important;transition:none!important;}
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item > .collapse:not(.show),
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item > .collapsing{display:none!important;}
  body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item > .collapse .sidebar-acc-links{padding:14px 12px 12px;}
  body.desktop-sidebar-collapsed .sidebar-footer-card{padding:8px;border-top:0;box-shadow:none;background:transparent;overflow:visible;}
  body.desktop-sidebar-collapsed .sidebar-footer-toggle{width:56px;height:56px;padding:0;margin:0 auto;border-radius:18px;justify-content:center;box-shadow:0 6px 16px rgba(15,23,42,.06);}
  body.desktop-sidebar-collapsed .sidebar-footer-meta,
  body.desktop-sidebar-collapsed .sidebar-footer-toggle .bi-chevron-up{display:none;}
  body.desktop-sidebar-collapsed .sidebar-footer-icon{display:block;}
  body.desktop-sidebar-collapsed .sidebar-footer-actions,
  body.desktop-sidebar-collapsed .sidebar-footer-actions.collapsing{position:absolute;left:calc(100% + 10px);bottom:8px;width:min(260px,calc(100vw - 130px));padding:12px;background:#fff;border:1px solid #e5e7eb;border-radius:20px;box-shadow:0 18px 36px rgba(15,23,42,.12);z-index:1055;height:auto!important;transition:none!important;}
  body.desktop-sidebar-collapsed .sidebar-footer-actions:not(.show),
  body.desktop-sidebar-collapsed .sidebar-footer-actions.collapsing{display:none!important;}
  body.desktop-sidebar-collapsed .sidebar-footer-card.auto-open .sidebar-footer-toggle{pointer-events:auto;}
}

@media (max-width:1199.98px){
  .order-bottom-bar{left:12px;right:12px;bottom:0;padding:8px 10px calc(8px + env(safe-area-inset-bottom));}
}
@media (max-width:767.98px){
  .record-view-grid{grid-template-columns:1fr;}
}

@media (max-width:991.98px){
  .app-shell{display:block;}
  .app-sidebar-col{max-width:none;}
}

.required-mark{color:#dc2626;font-weight:800;}
.sidebar-body-shell{min-height:calc(100vh - 56px);height:100%;}
.sidebar-accordion{padding:0;display:flex;flex-direction:column;gap:10px;}
.sidebar-acc-item{background:#fff;border:1px solid #e5e7eb;border-radius:16px;overflow:hidden;}
.sidebar-acc-toggle{width:100%;border:0;background:#fff;padding:14px 16px;display:flex;align-items:center;justify-content:space-between;font-weight:700;color:#334155;}
.sidebar-acc-toggle .bi-chevron-down{transition:transform .2s ease;}
.sidebar-acc-toggle[aria-expanded="true"] .bi-chevron-down{transform:rotate(180deg);}
.sidebar-acc-links{padding:0 10px 10px;display:flex;flex-direction:column;gap:4px;}
.sidebar-acc-links .sidebar-link{margin-bottom:0;}
.sidebar-footer-card{margin-top:0;position:relative;bottom:auto;background:#fff;border-top:1px solid #e5e7eb;padding:12px;box-shadow:0 -4px 12px rgba(15,23,42,.035);z-index:2;flex:0 0 auto;flex-shrink:0;}
.sidebar-footer-toggle{width:100%;border:1px solid #e5e7eb;background:#fff;border-radius:16px;padding:11px 14px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-weight:700;}
.sidebar-footer-toggle .bi-chevron-up{transition:transform .16s ease;}
.sidebar-footer-toggle[aria-expanded="true"] .bi-chevron-up{transform:rotate(180deg);}
.sidebar-footer-actions{padding-top:10px;}
.sidebar-footer-actions.collapsing{transition:height .16s ease;}
.sidebar-footer-actions .btn{min-height:42px;}
@media (min-height:760px) and (min-width:992px){
  .sidebar-footer-card.auto-open .sidebar-footer-toggle{pointer-events:none;}
  .sidebar-footer-card.auto-open .sidebar-footer-actions{display:block!important;}
}
@media (max-height:760px), (max-width:991.98px){
  .sidebar-footer-actions:not(.show){display:none;}
}


.sidebar-acc-title{padding:10px 14px 4px;font-size:.73rem;text-transform:uppercase;letter-spacing:.06em;color:#6b7280;font-weight:800;}
.sidebar-acc-group{padding-top:2px;display:flex;flex-direction:column;gap:4px;}
.sidebar-footer-actions.collapsing,.collapse{will-change:height;}
.sidebar-footer-actions.collapsing{transition:height .12s ease;}
@media (max-height:760px), (max-width:991.98px){
  .sidebar-footer-card{padding:10px;}
}


.page-card.page-card-loading{position:relative;pointer-events:none;}
.page-card.page-card-loading::before{content:'';position:absolute;inset:0;background:rgba(255,255,255,.72);z-index:5;border-radius:inherit;}
.page-card.page-card-loading::after{content:'';position:absolute;top:50%;left:50%;width:34px;height:34px;margin:-17px 0 0 -17px;border:3px solid rgba(25,135,84,.18);border-top-color:var(--brand);border-radius:50%;animation:oosSpin .7s linear infinite;z-index:6;}
@keyframes oosSpin{to{transform:rotate(360deg);}}


.app-navbar .navbar-brand,
a{color:var(--brand-dark);}
a:hover{color:var(--brand);}
.btn-success{--bs-btn-bg:var(--brand);--bs-btn-border-color:var(--brand);--bs-btn-hover-bg:var(--brand-dark);--bs-btn-hover-border-color:var(--brand-dark);--bs-btn-active-bg:var(--brand-dark);--bs-btn-active-border-color:var(--brand-dark);}
.btn-outline-success{--bs-btn-color:var(--brand);--bs-btn-border-color:var(--brand);--bs-btn-hover-bg:var(--brand);--bs-btn-hover-border-color:var(--brand);--bs-btn-active-bg:var(--brand-dark);--bs-btn-active-border-color:var(--brand-dark);--bs-btn-active-color:#fff;}
.text-bg-success{background-color:var(--brand)!important;}
.form-control:focus,.form-select:focus{border-color:var(--brand);box-shadow:0 0 0 .2rem rgba(0,0,0,.03),0 0 0 .12rem var(--brand-soft);}
.form-check-input:checked{background-color:var(--brand);border-color:var(--brand);}
.form-control-color{border-color:#d1d5db;}
.fab-add{box-shadow:0 10px 24px rgba(15,23,42,.12);}
.dataTables_wrapper .dataTables_paginate .pagination{gap:.25rem;}
.dataTables_wrapper .dataTables_paginate .page-link{border-radius:10px;border-color:#d1d5db;color:var(--brand-dark);}
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.active .page-link{background-color:var(--brand);border-color:var(--brand);color:#fff;}
.dataTables_wrapper .dataTables_paginate .page-item:not(.active) .page-link:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.active) .page-link:hover{background-color:var(--brand-soft);border-color:var(--brand);color:var(--brand-dark);}
.dataTables_wrapper .dataTables_paginate .page-link:focus{box-shadow:0 0 0 .15rem var(--brand-soft);}


.sidebar-footer-actions-row{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:nowrap;}
.sidebar-footer-iconbtn{width:42px;height:42px;display:inline-flex;align-items:center;justify-content:center;padding:0;position:relative;}
.sidebar-footer-iconbtn i{font-size:1rem;}
.sidebar-footer-iconbtn::after{content:attr(data-label);position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%);background:#111827;color:#fff;padding:5px 8px;border-radius:8px;font-size:.74rem;line-height:1;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .14s ease,transform .14s ease;}
.sidebar-footer-iconbtn:hover::after,.sidebar-footer-iconbtn:focus-visible::after{opacity:1;transform:translateX(-50%) translateY(-2px);}
.sidebar-footer-actions .btn{min-height:42px;}

.table-thumb,
.gallery-thumb,
.master-mobile-thumb{cursor:zoom-in;}
.image-preview-modal-content{background:#0f172a;color:#fff;border-radius:24px;overflow:hidden;}
.image-preview-modal-content .btn-close{filter:invert(1) grayscale(1);}
.image-preview-modal-img{max-height:78vh;object-fit:contain;border-radius:18px;}

.bulk-import-steps{display:flex;flex-wrap:wrap;gap:8px;}
.bulk-import-steps span{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid #e5e7eb;border-radius:999px;background:#f8fafc;font-size:.8rem;font-weight:600;color:#475569;}
.bulk-summary-card{background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:14px 16px;height:100%;}
.bulk-summary-label{font-size:.76rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#64748b;}
.bulk-summary-value{font-size:1.4rem;font-weight:800;color:#0f172a;line-height:1.2;margin-top:6px;}
.bulk-preview-search{min-width:min(280px,100%);}
.bulk-preview-table thead th{white-space:nowrap;background:#f8fafc;position:sticky;top:0;z-index:1;}
.bulk-preview-table tbody td{vertical-align:middle;}
.bulk-import-modal .modal-content{border-radius:22px;overflow:hidden;}
.bulk-import-modal .modal-header{border-bottom:1px solid #e5e7eb;}
.bulk-import-modal .modal-footer{border-top:1px solid #e5e7eb;}
.bulk-import-modal .btn-group .btn.active{box-shadow:none;}

.app-sidebar-col{position:relative;z-index:1030;}
.app-main-col{position:relative;z-index:auto;}
.sidebar-shell,.sidebar-body-shell,.sidebar-scroll{position:relative;z-index:auto;}
body.desktop-sidebar-collapsed .sidebar-accordion > .sidebar-acc-item > .collapse,
body.desktop-sidebar-collapsed .sidebar-footer-actions{z-index:1040!important;}
.modal-backdrop{z-index:2050!important;}
.modal{z-index:2060!important;}
.global-loader.global-loader-over-modal{z-index:2070;}
.dataTables_scrollHead,.dataTables_scrollHeadInner,.dataTables_scrollHeadInner table,.dataTables_scrollBody{z-index:1!important;}
.page-card,.table-responsive,.dataTables_wrapper{position:relative;z-index:1;}
body.modal-open .app-sidebar-col{z-index:1020!important;}
body.modal-open .sidebar-shell,
body.modal-open .sidebar-body-shell,
body.modal-open .sidebar-scroll{z-index:auto!important;pointer-events:none;}
body.modal-open .sidebar-accordion > .sidebar-acc-item > .collapse.show,
body.modal-open .sidebar-footer-actions.show,
body.modal-open .sidebar-accordion > .sidebar-acc-item > .collapsing,
body.modal-open .sidebar-footer-actions.collapsing{display:none!important;}
body.modal-open .fab-add{z-index:1020!important;}


@media (max-width:991.98px){
  .app-shell{min-height:calc(100dvh - 56px);}
  .app-sidebar-col{position:fixed;inset:56px 0 0 0;width:100%;max-width:none;height:calc(100dvh - 56px);z-index:2040;pointer-events:none;}
  .sidebar-mobile-backdrop{display:block;position:absolute;inset:0;background:rgba(15,23,42,.52);opacity:0;visibility:hidden;transition:opacity .18s ease;pointer-events:none;}
  .sidebar-shell{position:absolute;top:0;left:0;height:100%;width:min(84vw,320px);max-width:320px;min-height:0;border-right:1px solid #e5e7eb;box-shadow:0 20px 40px rgba(15,23,42,.18);transform:translateX(-105%);transition:transform .18s ease;overflow:hidden;z-index:1;display:flex;flex-direction:column;}
  .sidebar-mobile-header{display:flex;}
  .sidebar-body-shell{min-height:0;height:calc(100% - 56px);background:#fff;overflow:hidden;}
  .sidebar-scroll{height:100%;overflow:auto;padding-bottom:20px;}
  body.mobile-sidebar-open{overflow:hidden;touch-action:none;}
  body.mobile-sidebar-open .app-sidebar-col{pointer-events:auto;}
  body.mobile-sidebar-open .sidebar-mobile-backdrop{opacity:1;visibility:visible;pointer-events:auto;}
  body.mobile-sidebar-open .sidebar-shell{transform:translateX(0);}
  .app-main-col{min-height:calc(100dvh - 56px);}
  .app-content{padding-top:14px;scroll-margin-top:70px;}
  body.order-page-active .app-sidebar-col{inset:var(--app-navbar-height) 0 0 0;height:calc(100dvh - var(--app-navbar-height));}
}


body.order-page-active .app-navbar{position:fixed;top:0;left:0;right:0;width:100%;z-index:1115;}
body.order-page-active .app-shell{padding-top:var(--app-navbar-height);min-height:calc(100dvh - var(--app-navbar-height));}
body.order-page-active .app-sidebar-col{min-height:calc(100dvh - var(--app-navbar-height));}
body.order-page-active .app-main-col{min-height:calc(100dvh - var(--app-navbar-height));}
body.order-page-active .app-content{padding-top:0;scroll-margin-top:calc(var(--app-navbar-height) + 12px);}

.order-shell{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;padding-bottom:86px;}
body.order-page-active .app-content{padding-top:0;}
body.order-page-active .order-shell{padding-top:0;}
body.order-page-active .order-sticky-stack::before{display:none;}
body.order-page-active .order-create-header{margin-top:0!important;}

.order-sticky-stack{position:sticky;top:var(--app-navbar-height);z-index:1102;background:#f5f7f6;margin:0 -14px 14px;padding:12px 14px 10px;border-bottom:1px solid #e5e7eb;box-shadow:0 8px 18px rgba(15,23,42,.05);align-self:start;}
.order-sticky-stack > *{position:relative;z-index:1;}
.order-create-header{position:static;top:auto;z-index:auto;background:transparent;padding:0;margin-bottom:8px!important;}
.order-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:0;position:static;top:auto;background:transparent;padding:0;z-index:auto;}
.order-search{flex:1 1 260px;min-width:0;}
.order-search .form-control{border-radius:999px;padding-left:40px;}
.order-search .bi-search{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#6b7280;}
.order-chip-row{display:flex;gap:8px;overflow:auto;padding-bottom:4px;margin-bottom:14px;}
.order-chip{border:1px solid #d1d5db;background:#fff;color:#334155;border-radius:999px;padding:8px 14px;font-weight:700;white-space:nowrap;}
.order-chip.active,.order-chip:hover{background:var(--brand);border-color:var(--brand);color:#fff;}
.order-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:14px;}
.order-main-panel{min-width:0;}
.order-card{position:relative;background:#fff;border:1px solid color-mix(in srgb, var(--brand) 14%, #d9e2ec);border-radius:20px;box-shadow:0 8px 20px rgba(15,23,42,.05);padding:12px;display:flex;flex-direction:column;gap:10px;min-height:100%;} 
.order-card-stock{position:absolute;top:10px;right:10px;display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:4px 12px;border-radius:10px;color:#fff;font-size:.74rem;font-weight:700;line-height:1.1;}
.order-card-stock.in-stock{background:#16a34a;box-shadow:0 8px 18px rgba(22,163,74,.22);}
.order-card-stock.out-of-stock{background:#dc3545;box-shadow:0 8px 18px rgba(220,53,69,.22);}
.order-card-main{display:grid;grid-template-columns:126px minmax(0,1fr);gap:14px;align-items:start;min-width:0;}
.order-card-media{padding:0;}
.order-card-media button{border:0;background:transparent;padding:0;width:100%;display:block;}
.order-card-media img{width:100%;aspect-ratio:var(--product-image-ratio);object-fit:contain;border-radius:14px;background:#fff;border:1px solid #dbe4ea;}
.order-card-body{padding:32px 0 0;display:flex;flex-direction:column;gap:0;min-width:0;}
.order-card-sku{font-size:.66rem;font-weight:400;color:#94a3b8;line-height:1.1;min-height:.82rem;letter-spacing:.01em;margin-bottom:2px;}
.order-card-title{font-size:1rem;font-weight:800;line-height:1.34;color:var(--brand);margin-bottom:16px;}
.order-card-prices{display:flex;flex-direction:column;gap:3px;}
.order-card-price-label{font-size:.78rem;color:#6b7280;font-weight:700;text-transform:uppercase;letter-spacing:.04em;}
.order-card-price-value{font-size:.98rem;font-weight:900;color:var(--brand);line-height:1.16;}
.order-card-price-secondary{font-size:.8rem;font-weight:500;color:#334155;line-height:1.14;}
.order-card-pricing-note{font-size:.78rem;color:#475569;line-height:1.45;padding-left:0;}
.order-card-note{font-size:.76rem;color:#64748b;line-height:1.4;}
.order-card-meta{display:flex;flex-direction:column;gap:6px;font-size:.86rem;color:#475569;}
.order-card-meta strong{color:#111827;}
.order-card-footer{display:flex;align-items:stretch;justify-content:space-between;gap:10px;border:1px solid #cbd5e1;border-radius:12px;overflow:hidden;background:#fff;}
.order-card-pack{display:flex;align-items:center;flex:1 1 auto;padding:10px 12px;font-size:.95rem;color:#0f172a;background:#fff;}
.order-card-action{display:flex;align-items:center;justify-content:flex-end;padding:6px 8px;background:color-mix(in srgb, var(--brand) 7%, #fff);min-width:120px;}
.order-add-btn{border-radius:10px;padding:10px 18px;font-weight:800;min-width:84px;}
.order-qty-control{display:inline-flex;align-items:center;gap:6px;border:1px solid color-mix(in srgb, var(--brand) 20%, #cbd5e1);border-radius:10px;padding:4px 6px;background:#fff;flex-wrap:nowrap;}
.order-qty-control button,.order-cart-qty button{width:30px;height:30px;border:0;border-radius:8px;background:var(--brand-soft);color:var(--brand-dark);font-size:1rem;font-weight:800;flex:0 0 auto;}
.order-qty-control input,.order-cart-qty input{width:48px;border:0;background:transparent;text-align:center;font-weight:800;outline:none;flex:0 0 auto;}
.order-qty-control-unit{font-size:.72rem;font-weight:700;color:#64748b;white-space:nowrap;padding-right:2px;}
.order-cart-panel{background:#fff;border:1px solid #e5e7eb;border-radius:22px;box-shadow:0 2px 8px rgba(15,23,42,.04);padding:14px;position:sticky;top:132px;}
.order-cart-line{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid #eef2f7;}
.order-cart-line:last-child{border-bottom:0;}
.order-cart-thumb-btn{border:0;background:transparent;padding:0;display:block;flex:0 0 auto;}
.order-cart-thumb{width:68px;aspect-ratio:var(--product-image-ratio);border-radius:14px;object-fit:contain;background:#f8faf9;border:1px solid #e5e7eb;}
.order-cart-name{font-weight:700;line-height:1.32;}
.order-cart-meta{font-size:.82rem;color:#6b7280;}
.order-cart-remove{width:30px;height:30px;border:1px solid #e5e7eb;border-radius:999px;background:#fff;color:#64748b;display:inline-flex;align-items:center;justify-content:center;flex:0 0 30px;}
.order-cart-remove:hover{border-color:#dc3545;color:#dc3545;}
.order-cart-qty{display:inline-flex;align-items:center;gap:6px;border:1px solid color-mix(in srgb, var(--brand) 20%, #cbd5e1);border-radius:10px;padding:4px 6px;background:#fff;}
.order-summary-row{display:flex;justify-content:space-between;gap:14px;font-size:.92rem;padding:5px 0;}
.order-summary-row.total{font-size:1.05rem;font-weight:800;border-top:1px solid #e5e7eb;margin-top:8px;padding-top:12px;}
.order-gallery-main{width:100%;max-height:72vh;object-fit:contain;background:#f8faf9;border-radius:18px;border:1px solid #e5e7eb;}
.order-gallery-nav{position:absolute;top:50%;transform:translateY(-50%);width:42px;height:42px;border-radius:999px;border:0;background:rgba(15,23,42,.8);color:#fff;}
.order-gallery-prev{left:16px;}
.order-gallery-next{right:16px;}
.order-empty-state{background:#fff;border:1px dashed #cbd5e1;border-radius:22px;padding:36px 18px;text-align:center;color:#64748b;}
.order-customer-card{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:14px;display:flex;justify-content:space-between;gap:12px;align-items:flex-start;text-decoration:none;color:inherit;box-shadow:0 2px 8px rgba(15,23,42,.04);}
.order-customer-card:hover{border-color:var(--brand);box-shadow:0 10px 24px rgba(25,135,84,.10);}
.order-customer-name{font-size:1rem;font-weight:800;line-height:1.3;color:#111827;}
.order-customer-meta{font-size:.86rem;color:#64748b;line-height:1.45;margin-top:4px;}
.order-source-badge{display:inline-flex;align-items:center;gap:6px;font-weight:700;font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;padding:5px 9px;border-radius:999px;background:var(--brand-soft);color:var(--brand-dark);}

.order-customer-details-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
.order-customer-detail-card-full{grid-column:1 / -1;}
#orderCustomerInfoModal .modal-content{border-radius:22px;}
#orderCustomerInfoModal .modal-body{padding-top:12px;}

.order-page-subtitle{display:block;font-size:.86rem;color:#64748b;line-height:1.45;margin-top:2px;}
.order-create-header .page-title{font-size:1.05rem;}
.order-customer-trigger-wrap{min-width:0;}
.order-customer-trigger{display:inline-flex;align-items:center;gap:6px;text-decoration:none;color:var(--brand-dark);font-weight:800;position:relative;z-index:1;}
.order-customer-trigger:hover{color:var(--brand);}
.order-customer-card-colorful{background:linear-gradient(180deg,#fff 0%,var(--card-bg) 100%);border-color:var(--card-border);border-left:4px solid var(--card-accent);min-height:100%;}
.order-customer-card-colorful:hover{border-color:var(--card-accent);box-shadow:0 12px 28px color-mix(in srgb, var(--card-accent) 18%, transparent);transform:translateY(-1px);}
.order-customer-main{display:flex;flex-direction:column;gap:8px;min-width:0;flex:1 1 auto;}
.order-customer-topline{display:flex;gap:12px;justify-content:space-between;align-items:flex-start;}
.order-customer-type-line{font-size:.88rem;font-weight:700;color:#475569;line-height:1.4;}
.order-customer-meta-line{display:flex;align-items:flex-start;gap:8px;}
.order-customer-meta-line i{color:var(--card-accent);font-size:.9rem;line-height:1.4;margin-top:1px;}
.order-customer-meta-line-address i{color:#f97316;}
.order-customer-meta-line-salesperson i{color:#0f766e;}
.order-customer-address{color:#b45309;font-weight:600;}
.order-customer-salesperson{color:#0f766e;font-weight:700;}
.order-customer-action-icons{display:flex;flex-direction:column;gap:8px;align-items:flex-end;}
.order-customer-icon-badge{width:34px;height:34px;border-radius:999px;background:#fff;border:1px solid color-mix(in srgb, var(--card-accent) 30%, #d1d5db);display:inline-flex;align-items:center;justify-content:center;color:var(--card-accent);box-shadow:0 6px 14px rgba(15,23,42,.04);}
.order-bottom-bar{position:fixed;left:308px;right:24px;bottom:0;z-index:1045;display:flex;gap:10px;align-items:center;justify-content:space-between;padding:8px 10px calc(8px + env(safe-area-inset-bottom));border:1px solid #e5e7eb;border-bottom:0;border-radius:18px 18px 0 0;background:rgba(255,255,255,.98);backdrop-filter:blur(8px);box-shadow:0 -8px 24px rgba(15,23,42,.10);margin-top:0;}
body.desktop-sidebar-collapsed .order-bottom-bar{left:120px;}
.order-bottom-btn{min-height:46px;font-weight:700;flex:1 1 0;}
.order-shell{padding-bottom:124px;}
.order-qty-control input,.order-cart-qty input{-moz-appearance:textfield;appearance:textfield;}
.order-qty-control input::-webkit-outer-spin-button,.order-qty-control input::-webkit-inner-spin-button,.order-cart-qty input::-webkit-outer-spin-button,.order-cart-qty input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}
.order-summary-row-charge .btn{padding:.25rem .55rem;font-size:.8rem;}
@media (min-width:1200px){
  .order-shell{grid-template-columns:minmax(0,1fr);}
  .order-cart-panel{display:none!important;}
  .order-bottom-bar{display:flex;padding:8px 10px 8px;}
  .order-bottom-btn{min-height:40px;font-size:.94rem;padding-top:.45rem;padding-bottom:.45rem;}
}
@media (max-width:1199.98px){
  .order-bottom-bar{left:12px;right:12px;bottom:0;padding:8px 10px calc(8px + env(safe-area-inset-bottom));}
}
@media (max-width:767.98px){
  .order-grid{grid-template-columns:1fr;}
  body.order-page-active .app-content{padding-top:0;}
  body.order-page-active .order-shell{padding-top:0;}
  body.order-page-active .order-sticky-stack::before{display:none;}
  .order-sticky-stack{margin:0 -12px 12px;padding:10px 12px 8px;top:var(--app-navbar-height);}
  .order-create-header{padding:0;margin-bottom:6px!important;}
  .order-toolbar{padding:0;}
  .order-cart-panel{position:static;}
  .order-create-header .page-title{font-size:1rem;}
  .order-customer-card{padding:12px;}
  .order-card{padding:10px;}
  .order-card-main{grid-template-columns:124px minmax(0,1fr);gap:10px;}
  .order-card-body{padding-top:26px;gap:0;}
  .order-card-stock{font-size:.66rem;font-weight:600;padding:4px 9px;min-height:24px;}
  .order-card-sku{font-size:.6rem;min-height:.74rem;margin-bottom:1px;}
  .order-card-title{font-size:.88rem;line-height:1.26;margin-bottom:13px;}
  .order-card-price-secondary{font-size:.7rem;line-height:1.1;font-weight:500;color:#334155;}
  .order-card-price-value{font-size:.86rem;line-height:1.08;}
  .order-card-pricing-note{font-size:.7rem;line-height:1.35;}
  .order-card-note{font-size:.7rem;line-height:1.3;}
  .order-card-pack{font-size:.82rem;padding:9px 10px;}
  .order-card-action{min-width:108px;padding:5px 6px;}
  .order-qty-control{gap:4px;padding:4px 5px;}
  .order-qty-control button{width:28px;height:28px;}
  .order-qty-control input{width:34px;font-size:.88rem;}
  .order-qty-control-unit{font-size:.66rem;}
  .order-add-btn{padding:9px 14px;min-width:76px;font-size:.84rem;}
  .order-bottom-bar{left:8px;right:8px;gap:8px;bottom:0;padding:8px 8px calc(8px + env(safe-area-inset-bottom));border-radius:16px 16px 0 0;}
  .order-bottom-btn{min-height:44px;}

  .order-customer-topline{align-items:center;}
}


.sidebar-brand-wrap,.sidebar-brand-card{display:none!important;}

.sidebar-footer-card-static{margin-top:0;position:relative;bottom:auto;background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:12px;box-shadow:0 8px 18px rgba(15,23,42,.05);z-index:2;flex:0 0 auto;width:auto;max-width:none;margin:0 12px 12px;}
.sidebar-footer-head{display:flex;align-items:center;justify-content:flex-start;gap:12px;}
.sidebar-footer-user{display:flex;align-items:center;justify-content:flex-start;gap:10px;min-width:0;width:100%;text-align:left;}
.sidebar-footer-avatar{width:36px;height:36px;border-radius:12px;background:#f8fafc;border:1px solid #e5e7eb;display:inline-flex;align-items:center;justify-content:center;color:#64748b;flex:0 0 auto;}
.sidebar-footer-name{display:block;font-size:.92rem;font-weight:700;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.sidebar-footer-role{display:block;font-size:.78rem;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.sidebar-footer-actions-static{display:block!important;padding-top:10px;}
.sidebar-footer-card-static .sidebar-footer-meta{min-width:0;display:flex;flex-direction:column;}
.sidebar-footer-card-static .sidebar-footer-toggle,.sidebar-footer-card-static .sidebar-footer-icon{display:none!important;}
.sidebar-footer-card-static .sidebar-footer-actions-row{justify-content:center;}
@media (max-width:991.98px){
  .sidebar-footer-card-static{padding:10px 12px calc(10px + env(safe-area-inset-bottom));margin:0 12px calc(12px + env(safe-area-inset-bottom));}
}

/* v65 sidebar footer + top spacing cleanup */
.sidebar-shell{
  display:flex;
  flex-direction:column;
}
.sidebar-body-shell{
  min-height:calc(100dvh - var(--app-navbar-height));
  height:calc(100dvh - var(--app-navbar-height));
  overflow:hidden;
}
.sidebar-scroll{
  padding:0 12px 12px !important;
}
.sidebar-accordion{
  padding:0 !important;
  gap:10px;
}
.sidebar-footer-card-static{
  margin:0 12px 12px !important;
  padding:0 !important;
  position:sticky;
  bottom:0;
  border:1px solid #e5e7eb;
  border-radius:18px;
  background:#fff;
  box-shadow:0 -8px 20px rgba(15,23,42,.06);
  overflow:hidden;
}
.sidebar-footer-head{display:none !important;}
.sidebar-footer-card-static .sidebar-footer-toggle{
  display:flex !important;
  width:100%;
  border:0;
  background:#fff;
  padding:12px 14px;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  text-align:left;
}
.sidebar-footer-card-static .sidebar-footer-icon{display:none !important;}
.sidebar-footer-card-static .sidebar-footer-meta{
  min-width:0;
  display:flex;
  flex-direction:column;
}
.sidebar-footer-card-static .sidebar-footer-actions-static{
  display:block;
  padding:0 12px 12px;
}
.sidebar-footer-card-static .sidebar-footer-actions-row{
  justify-content:center;
}
.sidebar-footer-card-static .sidebar-footer-toggle .bi-chevron-up{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#64748b;
  transition:transform .16s ease;
}
.sidebar-footer-card-static .sidebar-footer-toggle[aria-expanded="true"] .bi-chevron-up{
  transform:rotate(180deg);
}
@media (min-width:992px){
  .sidebar-shell{
    position:sticky;
    top:var(--app-navbar-height);
    height:calc(100dvh - var(--app-navbar-height));
  }
}
@media (max-width:991.98px){
  .sidebar-mobile-header{
    min-height:54px;
    padding:12px 14px;
  }
  .sidebar-scroll{
    padding:0 12px 10px !important;
  }
  .sidebar-footer-card-static{
    margin:0 12px calc(12px + env(safe-area-inset-bottom)) !important;
  }
}
.sidebar-footer-card-static .sidebar-footer-actions-static{padding:0 12px 12px;}
.sidebar-footer-card-static .sidebar-footer-actions-static:not(.show){display:none !important;}
.sidebar-footer-card.auto-open .sidebar-footer-actions-static.show{display:block !important;}

@media (max-width:575.98px){
  .order-customer-details-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .order-customer-detail-card{min-height:74px;padding:10px 12px;}
  .order-customer-detail-card-full{grid-column:1 / -1;}
}

.report-nav-card{transition:transform .14s ease,box-shadow .14s ease;}
.report-nav-card:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(15,23,42,.08);}
.report-nav-icon{width:44px;height:44px;border-radius:14px;background:var(--brand-soft);display:flex;align-items:center;justify-content:center;color:var(--brand-dark);font-size:1.15rem;flex:0 0 44px;}
.report-summary-card{min-height:102px;display:flex;flex-direction:column;justify-content:center;}
.report-summary-label{font-size:.76rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#64748b;}
.report-summary-value{font-size:1.25rem;font-weight:800;color:#0f172a;line-height:1.2;margin-top:6px;word-break:break-word;}
.report-filter-offcanvas{height:min(82vh,760px);border-top-left-radius:20px;border-top-right-radius:20px;}
.report-filter-offcanvas .offcanvas-body{padding-bottom:88px;}
.report-filter-footer{position:sticky;bottom:0;background:#fff;padding-top:8px;border-top:1px solid #e5e7eb;}
@media (max-width:991.98px){.report-filter-desktop{display:none!important;}}
