:root{--bg:#f6faf8;--surface:#fff;--text:#11231b;--muted:#64756d;--line:#dde9e3;--primary:#0fa86b;--primary-2:#078451;--primary-soft:#e8fff4;--danger:#ef4444;--danger-soft:#fff1f2;--warn:#f59e0b;--warn-soft:#fff7ed;--info:#2563eb;--info-soft:#eff6ff;--purple:#7c3aed;--purple-soft:#f5f3ff;--radius-sm:10px;--radius:16px;--radius-lg:24px;--shadow:0 18px 50px rgba(17,35,27,.08);--font:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;--space:8px}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:linear-gradient(135deg,#f8fafc,#ecfdf5);color:var(--text);font-family:var(--font)}button,input,select,textarea{font:inherit}button{cursor:pointer;border:0}h1,h2,h3,p{margin-top:0}.money{font-variant-numeric:tabular-nums}.muted{color:var(--muted)}.hide{display:none!important}.text-right{text-align:right}.success{color:var(--primary-2)}.danger{color:#b91c1c}.warn{color:#b45309}.info{color:#1d4ed8}.caption{font-size:12px;color:var(--muted)}

/* v5.8.4 Desktop drag/back-swipe fix
   Cho phép bôi chọn text bình thường, nhưng chặn thao tác kéo ngang vô tình kích hoạt Back/Forward của trình duyệt. */
html, body{
  overscroll-behavior-x: none;
  overflow-x: hidden;
}
body, .app-shell, .main, .content{
  overscroll-behavior-x: none;
}
input, textarea, [contenteditable="true"], .card, .modal, .drawer-panel, .table, .workspace-grid{
  user-select: text;
  -webkit-user-select: text;
}
.kanban, .production-kanban, .tabs, .v55-product-list, .warehouse-material-list, .table-wrap{
  overscroll-behavior-x: contain;
}
@media (pointer: coarse){
  body{ touch-action: pan-y; }
  .kanban, .production-kanban, .tabs{ touch-action: pan-x pan-y; }
}

/* v5.8.6 Scroll/Back gesture fix
   - Sidebar/menu bên trái cố định.
   - Chỉ vùng nội dung bên phải cuộn.
   - Không can thiệp thao tác bôi chọn text. */
html,body{height:100%;overflow:hidden;overscroll-behavior:none;}
.app-shell{height:100vh;min-height:0;overflow:hidden;}
.sidebar{height:100vh;position:sticky;top:0;overflow-y:auto;overscroll-behavior:contain;}
.main{height:100vh;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;}
.content{min-height:calc(100vh - 74px);}
input,textarea,select,[contenteditable="true"]{user-select:text!important;-webkit-user-select:text!important;touch-action:auto!important;}
@media(max-width:760px){
  html,body{overflow:auto;height:auto;}
  .app-shell,.main{height:auto;overflow:visible;}
}
.force-mobile .app-shell,.force-mobile .main{height:auto;overflow:visible;}
