/* SUKAVINA · Giao nhận sản xuất — giao diện chung cho máy tính, laptop, Android và iPhone.
   Một bộ màu (sáng / tối), một bộ biểu tượng (icons.js), bố cục tự co giãn:
   ≥1024px: thanh bên trái + bảng; <1024px: thanh điều hướng dưới + thẻ.            */

/* ---------- 1. Màu, cỡ chữ, bo góc ---------- */
:root{
  --bg:#f3f4f6; --surface:#ffffff; --surface-2:#f7f8fa; --surface-3:#eef0f3;
  --line:#e3e6eb; --line-strong:#cfd4dc;
  --text:#161a21; --text-2:#4a5463; --text-3:#7b8494;
  --brand:#c8102e; --brand-600:#a50d26; --brand-soft:#fdecef; --brand-line:#f4b9c2;
  --side-bg:#171b21; --side-bg-2:#20262e; --side-text:#cdd3dc; --side-muted:#8a93a1; --side-line:rgba(255,255,255,.09);
  --ok:#17784f; --ok-600:#11603f; --ok-bg:#e5f4ec; --ok-line:#b5dfc7;
  --warn:#a8530a; --warn-bg:#fef1de; --warn-line:#f4cf9c;
  --info:#1b5fd1; --info-bg:#e8f0fd; --info-line:#b9cff6;
  --danger:#b42318; --danger-bg:#fdecea; --danger-line:#f1b9b3;
  --shadow-sm:0 1px 2px rgba(16,24,40,.06),0 1px 3px rgba(16,24,40,.05);
  --shadow-md:0 8px 24px rgba(16,24,40,.12),0 2px 6px rgba(16,24,40,.06);
  --shadow-lg:0 24px 60px rgba(16,24,40,.28);
  --r-sm:8px; --r-md:12px; --r-lg:16px;
  --font:"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"SF Pro Text",Roboto,"Helvetica Neue",Arial,sans-serif;
  --sab:env(safe-area-inset-bottom,0px); --sat:env(safe-area-inset-top,0px);
  color-scheme:light;
}
html[data-mode="dark"]{
  --bg:#0f1318; --surface:#171c23; --surface-2:#1d232b; --surface-3:#262d37;
  --line:#2a313b; --line-strong:#3a4350;
  --text:#eceff4; --text-2:#b4bcc9; --text-3:#7f8998;
  --brand:#ee3b55; --brand-600:#d52a44; --brand-soft:#3a1820; --brand-line:#6b2833;
  --side-bg:#0b0e12; --side-bg-2:#141920;
  --ok:#43c286; --ok-600:#2fa772; --ok-bg:#12291f; --ok-line:#1f5239;
  --warn:#f0a04a; --warn-bg:#2d2112; --warn-line:#5c4120;
  --info:#6ea2ff; --info-bg:#14223d; --info-line:#27427a;
  --danger:#ff7a6e; --danger-bg:#331a18; --danger-line:#6b2f2a;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4); --shadow-md:0 8px 24px rgba(0,0,0,.5); --shadow-lg:0 24px 60px rgba(0,0,0,.7);
  color-scheme:dark;
}
@media (prefers-color-scheme:dark){
  html:not([data-mode="light"]){
    --bg:#0f1318; --surface:#171c23; --surface-2:#1d232b; --surface-3:#262d37;
    --line:#2a313b; --line-strong:#3a4350;
    --text:#eceff4; --text-2:#b4bcc9; --text-3:#7f8998;
    --brand:#ee3b55; --brand-600:#d52a44; --brand-soft:#3a1820; --brand-line:#6b2833;
    --side-bg:#0b0e12; --side-bg-2:#141920;
    --ok:#43c286; --ok-600:#2fa772; --ok-bg:#12291f; --ok-line:#1f5239;
    --warn:#f0a04a; --warn-bg:#2d2112; --warn-line:#5c4120;
    --info:#6ea2ff; --info-bg:#14223d; --info-line:#27427a;
    --danger:#ff7a6e; --danger-bg:#331a18; --danger-line:#6b2f2a;
    --shadow-sm:0 1px 2px rgba(0,0,0,.4); --shadow-md:0 8px 24px rgba(0,0,0,.5); --shadow-lg:0 24px 60px rgba(0,0,0,.7);
    color-scheme:dark;
  }
}

/* ---------- 2. Nền tảng ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font:15px/1.5 var(--font);-webkit-font-smoothing:antialiased;min-height:100vh;min-height:100dvh;overflow-x:hidden}
h1,h2,h3,h4{margin:0;line-height:1.25;font-weight:700;letter-spacing:-.01em}
h2{font-size:20px}h3{font-size:16px}
p{margin:0 0 10px}
a{color:var(--info);text-underline-offset:2px}
b,strong{font-weight:650}
img{max-width:100%;font-size:0;color:transparent}
.hidden{display:none!important}
.muted,.meta{color:var(--text-3)}
.meta{font-size:13px}
::selection{background:var(--brand-soft);color:var(--text)}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px;border-radius:6px}
*{scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}
.ico{width:18px;height:18px;flex:0 0 auto;display:inline-block;vertical-align:-3px}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* ---------- 3. Ô nhập ---------- */
input,select,textarea{font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--line-strong);border-radius:var(--r-sm);min-height:42px;padding:9px 12px;width:100%;transition:border-color .15s,box-shadow .15s;-webkit-appearance:none;appearance:none}
textarea{min-height:84px;resize:vertical}
input::placeholder,textarea::placeholder{color:var(--text-3)}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}
input:disabled,select:disabled,textarea:disabled{background:var(--surface-3);color:var(--text-3)}
select{padding-right:36px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8494' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:18px}
select option{color:#161a21;background:#fff}
input[type=search],.toolbar input:not([type=checkbox]):not([type=file]):not([type=number]){padding-left:38px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8494' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:12px center;background-size:18px}
input[type=checkbox],input[type=radio]{width:18px;height:18px;min-height:0;padding:0;flex:0 0 auto;display:inline-grid;place-content:center;cursor:pointer}
input[type=checkbox]{border-radius:5px}
input[type=radio]{border-radius:50%}
input[type=checkbox]:checked,input[type=radio]:checked{background:var(--brand);border-color:var(--brand)}
input[type=checkbox]:checked::after{content:"";width:9px;height:5px;margin-top:-2px;border:solid #fff;border-width:0 0 2px 2px;transform:rotate(-45deg)}
input[type=radio]:checked::after{content:"";width:7px;height:7px;border-radius:50%;background:#fff}
input[type=checkbox]:disabled,input[type=radio]:disabled{opacity:.5;cursor:not-allowed}
input[type=file]{padding:8px}
input[type=number]{font-variant-numeric:tabular-nums;-moz-appearance:textfield}
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
label{font-weight:600;font-size:14px}
label.line{display:flex;align-items:center;gap:10px;font-weight:500}
.field-label{display:block;font-weight:600;font-size:13px;color:var(--text-2);margin:0 0 6px 2px}
.input-error{border-color:var(--danger)!important;background:var(--danger-bg)!important}
.validation-summary{background:var(--danger-bg);border:1px solid var(--danger-line);color:var(--danger);border-radius:var(--r-md);padding:12px 14px;margin:10px 0;line-height:1.45}
.hint{background:var(--info-bg);border:1px solid var(--info-line);color:var(--text-2);border-radius:var(--r-md);padding:10px 14px;margin:10px 0;font-size:14px}
.hint:empty{display:none}
.grid{display:grid;gap:12px}
.grid.roomy{grid-template-columns:repeat(auto-fit,minmax(345px,1fr));margin:12px 0}
.form-thumb{width:160px;height:120px;object-fit:contain;background:#fff;border:1px solid var(--line);border-radius:var(--r-md)}

/* ---------- 4. Nút ---------- */
button,.btn{font:inherit;font-size:14px;font-weight:600;line-height:1.2;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:0 16px;border-radius:var(--r-sm);border:1px solid transparent;background:var(--brand);color:#fff;cursor:pointer;white-space:nowrap;transition:background .15s,border-color .15s,box-shadow .15s,transform .06s;-webkit-tap-highlight-color:transparent;touch-action:manipulation;text-decoration:none}
button:hover{background:var(--brand-600)}
button:active{transform:translateY(1px)}
button:disabled{opacity:.45;cursor:not-allowed;transform:none}
button.secondary{background:var(--surface);color:var(--text);border-color:var(--line-strong)}
button.secondary:hover{background:var(--surface-3)}
button.ok{background:var(--ok);color:#fff}
button.ok:hover{background:var(--ok-600)}
button.danger{background:var(--surface);color:var(--danger);border-color:var(--danger-line)}
button.danger:hover{background:var(--danger-bg)}
button.warn{background:var(--warn);color:#fff}
button.small{min-height:32px;padding:0 10px;font-size:13px}
button.icon-only,.icon-btn{width:40px;padding:0;flex:0 0 auto}
.icon-btn{background:var(--surface);color:var(--text-2);border:1px solid var(--line-strong)}
.icon-btn:hover{background:var(--surface-3);color:var(--text)}
.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.actions:empty{display:none}

/* ---------- 5. Khung ứng dụng ---------- */
.shell{display:grid;grid-template-columns:248px minmax(0,1fr);min-height:100vh;min-height:100dvh}
.sidebar{position:sticky;top:0;height:100vh;height:100dvh;display:flex;flex-direction:column;gap:14px;padding:20px 14px 14px;background:var(--side-bg);color:var(--side-text);overflow-y:auto;z-index:30}
.brand{display:flex;align-items:center;gap:12px;padding:2px 8px 16px;border-bottom:1px solid var(--side-line)}
.brand-logo{width:42px;height:42px;border-radius:11px;background:#fff;padding:5px;object-fit:contain;flex:0 0 auto}
.brand-copy b{display:block;font-size:15px;letter-spacing:.16em;color:#fff}
.brand-copy span{display:block;font-size:12px;color:var(--side-muted);margin-top:1px}
.nav-main{display:flex;flex-direction:column;gap:4px;flex:1 1 auto}
.grouped-menu-wrap,.system-menu-wrap,.nav-admin{display:block}
.nav-admin{position:relative}
.sidebar button{background:transparent;color:var(--side-text);border:0;min-height:44px;padding:0 12px;border-radius:10px;width:100%;justify-content:flex-start;font-weight:600;position:relative;gap:12px}
.sidebar button:hover{background:var(--side-bg-2);color:#fff}
.sidebar button.active,.sidebar button[aria-expanded="true"]{background:var(--side-bg-2);color:#fff}
.sidebar button.active::before{content:"";position:absolute;left:-14px;top:9px;bottom:9px;width:4px;border-radius:0 4px 4px 0;background:var(--brand)}
.sidebar .ico{width:20px;height:20px}
.system-submenu{position:absolute;right:0;bottom:calc(100% + 8px);display:flex;flex-direction:column;gap:2px;margin:0;padding:6px;background:var(--side-bg-2);border:1px solid var(--side-line);border-radius:12px;box-shadow:0 12px 28px rgba(0,0,0,.35);z-index:40}
.system-submenu button{min-height:40px;font-weight:500;font-size:14px}
.system-submenu button:hover{background:rgba(255,255,255,.08)}
@media (min-width:1024px){.sidebar .system-menu-button{width:44px;padding:0;justify-content:center}.system-menu-button .sys-label{display:none}.system-submenu{left:0}}
.side-foot{margin-top:auto;padding:12px 8px 0;font-size:12px;color:var(--side-muted);border-top:1px solid var(--side-line)}
.made-by{display:block}

.content{min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:14px;min-height:52px;padding:0 24px;background:var(--bg);border-bottom:1px solid var(--line)}
.topbar h1{font-size:20px}
.topbar-brand{display:none}
.header-actions{margin-left:auto;display:flex;align-items:center;gap:10px}
.user-box{display:flex;align-items:center;gap:10px;padding:5px 14px 5px 5px;background:var(--surface);border:1px solid var(--line);border-radius:999px;min-width:0}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--side-bg);color:#fff;display:grid;place-items:center;font-weight:700;font-size:14px;flex:0 0 auto}
.user-copy{display:flex;flex-direction:column;min-width:0;line-height:1.2}
.user-copy b{font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}
.user-copy small{font-size:12px;color:var(--text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}
.logout-btn{background:var(--surface);color:var(--text);border-color:var(--line-strong)}
.logout-btn:hover{background:var(--surface-3)}
main{padding:14px 24px 40px;width:100%;max-width:1680px}
.panel{display:block}

/* ---------- 6. Thanh công cụ ---------- */
.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 10px}
.toolbar input:not([type=checkbox]),.toolbar select{flex:1 1 280px;width:auto;min-width:0}
.toolbar button{flex:0 0 auto}
.toolbar input,.toolbar select{min-height:40px;padding-block:6px}
.toolbar .primary{min-height:40px;padding:0 18px}
button.primary{background:var(--brand);color:#fff}
.order-filter-count{background:var(--brand);color:#fff;border-radius:999px;font-size:11px;padding:1px 7px;margin-left:2px}
button.active-filter{border-color:var(--brand);color:var(--brand)}

/* Hai mục Xuất khẩu / Nội địa */
.seg{display:inline-flex;gap:4px;padding:3px;margin:0 0 10px;background:var(--surface-3);border-radius:12px;max-width:100%}
.seg-btn{min-height:34px;padding:0 16px;background:transparent;color:var(--text-2);border:0;border-radius:9px;font-weight:600}
.seg-btn:hover{background:var(--surface-2);color:var(--text)}
.seg-btn.active{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}
.seg-count{min-width:24px;height:20px;padding:0 7px;border-radius:999px;background:var(--surface-3);color:var(--text-3);font-size:12px;display:inline-grid;place-items:center}
.seg-btn.active .seg-count{background:var(--brand);color:#fff}
@media (max-width:1023px){.seg{display:flex}.seg-btn{flex:1 1 0}}

/* ---------- 7. Trạng thái ---------- */
.ux-status,.status-pill{display:inline-flex;align-items:center;gap:6px;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:600;line-height:1.5;border:1px solid transparent;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;background:var(--surface-3);color:var(--text-2)}
.ux-status i{width:7px;height:7px;border-radius:50%;background:currentColor;flex:0 0 auto}
.ux-status.success{background:var(--ok-bg);color:var(--ok);border-color:var(--ok-line)}
.ux-status.info{background:var(--info-bg);color:var(--info);border-color:var(--info-line)}
.ux-status.warning{background:var(--warn-bg);color:var(--warn);border-color:var(--warn-line)}
.ux-status.danger{background:var(--danger-bg);color:var(--danger);border-color:var(--danger-line)}
.badge{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:600;background:var(--surface-3);color:var(--text-2);border:1px solid var(--line)}

/* ---------- 8. Danh sách lệnh (bảng trên máy tính, thẻ trên điện thoại) ---------- */
#orderList.cards{display:block}
.order-list-wrap{display:flex;flex-direction:column;gap:12px}
.order-po-section{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow-sm);overflow:hidden}
.order-po-header{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:7px 16px;background:var(--surface-2);border-bottom:1px solid var(--line)}
.order-po-badge{font-weight:700;font-size:13px;letter-spacing:.02em;color:var(--brand);background:var(--brand-soft);border:1px solid var(--brand-line);border-radius:999px;padding:2px 12px}
.order-po-header b{font-size:13px;color:var(--text-2)}
.order-po-customer{font-size:13px;color:var(--text-3);margin-left:auto}
.order-list-body{display:block}
.order-list-head,.order-list-row{display:grid;grid-template-columns:48px minmax(200px,1.6fr) 60px 72px minmax(100px,.9fr) 84px minmax(345px,1fr);column-gap:14px;align-items:center;padding-inline:18px}
/* cột Phụ trách và Màu chỉ hiện khi màn hình đủ rộng */
.order-list-head>:nth-child(6),.order-list-head>:nth-child(7),.order-list-row>.order-row-value.assignee,.order-list-row>.order-row-value.color{display:none}
@media (min-width:1760px){
  .order-list-head,.order-list-row{grid-template-columns:48px minmax(220px,1.6fr) 60px 72px minmax(110px,1fr) minmax(100px,.9fr) minmax(80px,.7fr) 86px minmax(360px,1fr)}
  .order-list-head>:nth-child(6),.order-list-head>:nth-child(7){display:block}
  .order-list-row>.order-row-value.assignee,.order-list-row>.order-row-value.color{display:block}
}
.order-list-head{padding-block:0;margin-inline:1px;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-3);min-height:20px;margin-bottom:-10px}
.order-list-row{position:relative;min-height:52px;padding-block:6px;border-top:1px solid var(--line);background:var(--surface);transition:background .12s}
.order-list-body>.order-list-row:first-child,.order-list-body>.order-set:first-child{border-top:0}
.order-list-row:hover{background:var(--surface-2)}
.order-row-clickable{cursor:pointer}
.order-row-image{display:flex;align-items:center;justify-content:center}
.order-row-img{width:42px;height:42px;object-fit:contain;background:#fff;border:1px solid var(--line);border-radius:10px;cursor:zoom-in;display:block}
.order-row-img.empty{display:grid;place-items:center;font-size:10px;line-height:1.2;color:var(--text-3);background:var(--surface-3);border-style:dashed;text-align:center;cursor:default}
.order-row-name{min-width:0}
.order-row-kicker{display:none;font-size:10.5px;font-weight:700;letter-spacing:.08em;color:var(--text-3);text-transform:uppercase}
.order-row-name>b{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:14.5px;line-height:1.3;word-break:break-word;margin:0 0 2px}
.order-row-sub{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;font-size:12px;color:var(--text-3);min-width:0}
.order-row-sub span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.order-row-value{font-size:13.5px;font-weight:600;color:var(--text);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}
.order-row-value.qty{color:var(--brand);font-weight:700;font-size:15px}
.order-row-value.date{color:var(--text-2);font-weight:500}
.order-row-value.assignee,.order-row-value.color{font-weight:500;color:var(--text-2)}
.order-row-actions{display:flex;flex-wrap:nowrap;gap:6px;justify-content:flex-end;align-items:center}
.order-row-actions button.icon-only{width:34px;padding:0}
.order-row-actions button{min-height:34px;padding:0 11px;font-size:13px;background:var(--surface-2);color:var(--text);border:1px solid var(--line-strong)}
.order-row-actions button:hover{background:var(--surface-3)}
.order-row-actions button.ok{background:var(--ok);border-color:var(--ok);color:#fff}
.order-row-actions button.ok:hover{background:var(--ok-600)}
.order-row-actions button.danger{background:transparent;color:var(--danger);border-color:var(--danger-line)}
.order-row-actions button.danger:hover{background:var(--danger-bg)}
.order-row-actions button.export{background:var(--ok-bg);border-color:var(--ok-line);color:var(--ok)}
.order-row-actions button.export:hover{background:var(--ok-line)}
.order-row-actions button.warn{background:var(--warn);border-color:var(--warn);color:#fff}
.order-row-actions button:disabled{background:var(--surface-3);color:var(--text-3)}
.order-list-row.rejected{background:var(--danger-bg)}
.order-list-row.compensation{background:var(--warn-bg)}
/* Bộ chi tiết */
.order-set{border-top:1px solid var(--line)}
.order-set-head{background:var(--surface-2);box-shadow:inset 4px 0 0 var(--brand)}
.order-set-head:hover{background:var(--surface-3)}
.order-set-head .order-row-value.qty{font-size:12px;color:var(--brand);background:var(--brand-soft);border:1px solid var(--brand-line);border-radius:999px;padding:2px 9px;justify-self:start}
.order-set-parts{margin:8px 0;padding-left:20px;font-size:14px;line-height:1.7}
.order-set-parts li::marker{color:var(--brand)}
.order-set-parts li.pick{cursor:pointer;border-radius:8px;padding:2px 8px;margin-left:-8px}
.order-set-parts li.pick:hover{background:var(--surface-3)}

/* ---------- 9. Hộp thoại ---------- */
.modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(11,14,18,.58);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.modal-box{position:relative;width:min(600px,100%);max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);overflow:auto;background:var(--surface);color:var(--text);border-radius:var(--r-lg);box-shadow:var(--shadow-lg);padding:24px;overscroll-behavior:contain}
.modal-box.editor-modal,.modal-box.system-maintenance-modal,.modal-box.customer-order-modal{width:min(960px,100%)}
.modal-box.perm-modal{width:min(1240px,100%)}
.modal-box>.x,.image-x{position:absolute;top:12px;right:12px;width:36px;height:36px;min-height:0;padding:0;border-radius:50%;background:var(--surface-3);color:var(--text-2);border:0;z-index:2}
.modal-box>.x:hover,.image-x:hover{background:var(--line-strong);color:var(--text)}
.modal-box h2{margin:0 40px 14px 0;font-size:20px}
.modal-box h3{margin:18px 0 8px;font-size:15px;color:var(--text-2)}
.img-modal-info{display:grid;grid-template-columns:minmax(0,190px) minmax(0,1fr);gap:18px;align-items:start}
.img,.big-img{border-radius:var(--r-md)}
.img.clickable-img{width:100%;aspect-ratio:1/1;object-fit:contain;background:#fff;border:1px solid var(--line);cursor:zoom-in}
.order-detail-view .group-detail-head{display:grid;grid-template-columns:minmax(0,200px) minmax(0,1fr);gap:20px;align-items:start}
.group-detail-info h2{margin-right:44px}
dl.kv{margin:8px 0 4px;display:block}
dl.kv>div{display:flex;justify-content:space-between;gap:16px;padding:8px 0;border-bottom:1px solid var(--line)}
dl.kv>div:last-child{border-bottom:0}
dl.kv dt{color:var(--text-3);font-size:13.5px;flex:0 0 auto}
dl.kv dd{margin:0;font-weight:600;text-align:right;min-width:0;overflow-wrap:anywhere}
.history-line,.route-view>div{margin:8px 0;padding:10px 14px;background:var(--surface-2);border-left:3px solid var(--line-strong);border-radius:0 var(--r-md) var(--r-md) 0;font-size:13.5px;line-height:1.5}
.image-zoom{position:fixed;inset:0;z-index:2000;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(8,10,13,.82)}
.image-zoom-box{position:relative;max-width:min(1100px,100%);max-height:100%;background:var(--surface);padding:12px;border-radius:var(--r-lg)}
.image-zoom .big-img{display:block;max-width:100%;max-height:calc(100dvh - 90px);margin:0 auto;object-fit:contain}

/* Thông báo, xác nhận, nạp dữ liệu */
.ux-progress{position:fixed;top:0;left:0;right:0;height:3px;z-index:9999;pointer-events:none;opacity:0;overflow:hidden;transition:opacity .18s}
.ux-progress i{display:block;height:100%;width:34%;background:var(--brand);border-radius:3px;transform:translateX(-120%)}
html.ux-network-busy .ux-progress{opacity:1}
html.ux-network-busy .ux-progress i{animation:uxbar 1.05s cubic-bezier(.22,.8,.3,1) infinite}
@keyframes uxbar{to{transform:translateX(320%)}}
.ux-toast-stack{position:fixed;top:calc(16px + var(--sat));right:16px;z-index:5000;display:flex;flex-direction:column;gap:10px;pointer-events:none;width:min(380px,calc(100vw - 32px))}
.ux-toast{pointer-events:auto;display:flex;align-items:flex-start;gap:12px;background:var(--surface);color:var(--text);border:1px solid var(--line);border-left:4px solid var(--info);border-radius:var(--r-md);padding:12px 12px 12px 14px;box-shadow:var(--shadow-md);opacity:0;transform:translateY(-8px);transition:opacity .2s,transform .2s}
.ux-toast.show{opacity:1;transform:none}
.ux-toast.success{border-left-color:var(--ok)}.ux-toast.danger{border-left-color:var(--danger)}.ux-toast.warning{border-left-color:var(--warn)}
.ux-toast-icon{display:grid;place-items:center;color:var(--info);padding-top:1px}
.ux-toast.success .ux-toast-icon{color:var(--ok)}.ux-toast.danger .ux-toast-icon{color:var(--danger)}.ux-toast.warning .ux-toast-icon{color:var(--warn)}
.ux-toast-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.ux-toast-copy b{font-size:14px}.ux-toast-copy span{font-size:13.5px;color:var(--text-2);overflow-wrap:anywhere}
.ux-toast-close{background:transparent;color:var(--text-3);border:0;min-height:0;width:28px;height:28px;padding:0;font-size:18px;line-height:1}
.ux-toast-close:hover{background:var(--surface-3);color:var(--text)}
.ux-confirm{position:fixed;inset:0;z-index:6000;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(11,14,18,.58);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.ux-confirm-card{width:min(440px,100%);background:var(--surface);color:var(--text);border-radius:var(--r-lg);box-shadow:var(--shadow-lg);padding:22px;display:grid;grid-template-columns:auto 1fr;gap:6px 16px}
.ux-confirm-icon{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:var(--info-bg);color:var(--info)}
.ux-confirm-icon .ico{width:22px;height:22px}
.ux-confirm.danger .ux-confirm-icon{background:var(--danger-bg);color:var(--danger)}
.ux-confirm-copy h3{margin:2px 0 4px;font-size:17px}.ux-confirm-copy p{margin:0;color:var(--text-2);font-size:14.5px;white-space:pre-line}
.ux-confirm-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:10px;margin-top:14px}
.ux-empty-state{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;padding:56px 20px;background:var(--surface);border:1px dashed var(--line-strong);border-radius:var(--r-lg);color:var(--text-2)}
.ux-empty-icon{width:56px;height:56px;border-radius:16px;background:var(--surface-3);color:var(--text-3);display:grid;place-items:center;margin-bottom:6px}
.ux-empty-icon .ico{width:28px;height:28px}
.ux-empty-state b{color:var(--text);font-size:16px}
.ux-skeleton-grid{display:grid;gap:12px}
.ux-skeleton-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:16px;display:grid;gap:10px}
.ux-sk-img,.ux-sk-line,.ux-sk-pills i{background:linear-gradient(90deg,var(--surface-3),var(--surface-2),var(--surface-3));background-size:200% 100%;animation:uxsk 1.2s linear infinite;border-radius:8px}
.ux-sk-img{height:70px}.ux-sk-line{height:12px}.ux-sk-line.w70{width:70%}.ux-sk-line.w45{width:45%}
.ux-sk-pills{display:flex;gap:8px}.ux-sk-pills i{width:70px;height:22px;border-radius:999px}
@keyframes uxsk{to{background-position:-200% 0}}


/* Biểu mẫu trong hộp thoại */
.modal-box label:not(.line):not(.ai-model-picker){display:flex;flex-direction:column;gap:6px;margin:0 0 14px;font-weight:600;font-size:13.5px;color:var(--text-2)}
.modal-box label>span{font-weight:600}
#modalBody>input,#modalBody>select,#modalBody>textarea{margin-bottom:12px}
#modalBody>label.line{margin-bottom:12px}
.account-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px;margin-bottom:4px}
.account-password-edit>div{display:flex;gap:8px}
.account-password-edit button{min-height:42px;padding:0 14px;flex:0 0 auto}
@media (max-width:1023px){.account-edit-grid{grid-template-columns:1fr}}

/* ---------- 10. Bảng dữ liệu (tài khoản, tổ, công đoạn) ---------- */
.account-table-wrap,.team-process-table-wrap{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow-sm);overflow:auto}
.account-table{width:100%;border-collapse:separate;border-spacing:0;font-size:14px}
.account-table th{position:sticky;top:0;text-align:left;padding:11px 16px;background:var(--surface-2);color:var(--text-3);font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;border-bottom:1px solid var(--line);white-space:nowrap}
.account-table td{padding:12px 16px;border-bottom:1px solid var(--line);vertical-align:middle}
.account-table tr:last-child td{border-bottom:0}
.account-table tbody tr.row-click-detail{cursor:pointer;transition:background .12s}
.account-table tbody tr.row-click-detail:hover{background:var(--surface-2)}
.account-table .actions{margin:0;flex-wrap:nowrap}
.account-table .actions button{min-height:34px;padding:0 12px;font-size:13px;background:var(--surface);color:var(--text);border:1px solid var(--line-strong)}
.account-table .actions button:hover{background:var(--surface-3)}
.account-table .actions button.danger{color:var(--danger);border-color:var(--danger-line)}
.account-table .actions button.danger:hover{background:var(--danger-bg)}
.account-table td.empty-cell,.team-process-empty{text-align:center;color:var(--text-3);padding:28px 16px}
.account-password-cell{display:flex;align-items:center;gap:8px;max-width:240px}
.account-password-cell input{min-height:36px;background:var(--surface-2);font-family:ui-monospace,Consolas,monospace;font-size:13px}
.account-password-cell .account-eye{width:36px;min-height:36px;padding:0}
.team-process-split{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start}
.team-process-pane{min-width:0}
.team-process-pane-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 2px 10px}
.team-process-pane-head b{display:block;font-size:16px}
.team-process-pane-head span{display:block;font-size:13px;color:var(--text-3)}
.team-process-pane-head strong{min-width:34px;height:28px;padding:0 10px;border-radius:999px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center;font-size:13px}
.team-process-name{display:flex;flex-direction:column}
.team-process-name small{color:var(--text-3);font-size:12.5px}
.unified-data-status,.data-status{display:inline-flex}

/* ---------- 11. Nhận phôi (hộp quét và bảng nhận) ---------- */
.qsc-overlay{position:fixed;inset:0;z-index:4000;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(11,14,18,.6);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.qsc-dialog{background:var(--surface);color:var(--text);border-radius:var(--r-lg);padding:22px;width:100%;max-width:440px;max-height:calc(100dvh - 32px);overflow:auto;box-shadow:var(--shadow-lg)}
.qsc-dialog h3{margin:0 0 12px;font-size:19px;color:var(--text)}
.qsc-video-box{position:relative;background:#000;border-radius:var(--r-md);overflow:hidden;aspect-ratio:4/3;max-height:52vh;display:none;margin-top:12px}
.qsc-video-box video{width:100%;height:100%;object-fit:cover}
.qsc-frame{position:absolute;inset:18%;border:3px solid #fff;border-radius:14px;box-shadow:0 0 0 9999px rgba(0,0,0,.4)}
.qsc-status{margin:12px 0;font-size:14px;color:var(--text-2)}
.qsc-status:empty{display:none}
.qsc-status.err{color:var(--danger)}.qsc-status.ok{color:var(--ok)}
.qsc-kv{display:flex;justify-content:space-between;gap:16px;padding:8px 0;border-bottom:1px solid var(--line);font-size:14px}
.qsc-prog{display:flex;flex-direction:column;gap:2px;margin:10px 0;padding:10px 12px;border-radius:8px;border:1px solid var(--line);background:var(--surface-2);font-size:13px;color:var(--text-2)}
.qsc-prog b{font-size:14px}
.qsc-prog.ok{background:var(--ok-bg);border-color:var(--ok-line)}.qsc-prog.ok b{color:var(--ok)}
.qsc-prog.warn{background:var(--warn-bg);border-color:var(--warn-line)}.qsc-prog.warn b{color:var(--warn)}
.qsc-prog.bad{background:var(--danger-bg);border-color:var(--danger-line)}.qsc-prog.bad b{color:var(--danger)}
.short-badge{margin-left:6px;min-height:22px;padding:0 9px;border-radius:999px;font-size:12px;font-weight:600;background:var(--danger-bg);color:var(--danger);border:1px solid var(--danger-line);cursor:pointer}
.data-toolbar{flex-wrap:wrap}
.data-toolbar select{flex:0 1 160px;width:auto}
.data-date{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:500;color:var(--text-2);flex-direction:row}
.data-date input{width:auto;flex:0 0 auto}
.data-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}
.data-card{display:flex;gap:12px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);cursor:pointer}
.data-card:hover{background:var(--surface-2);border-color:var(--line-strong)}
.data-card-img{flex:0 0 64px}.data-card-img img{width:64px;height:64px;object-fit:contain;border-radius:8px}
.data-card-body{min-width:0;display:flex;flex-direction:column;gap:4px}.data-card-body b{overflow-wrap:anywhere}
.data-chips{display:flex;gap:6px;flex-wrap:wrap;margin:4px 0}
.data-meta{font-size:13px;color:var(--text-2)}
.data-detail h3{margin:18px 0 8px}
.tl{padding:0 12px 12px}
.tl-row{display:flex;gap:12px;padding:8px 0;border-top:1px solid var(--line)}.tl-row:first-child{border-top:0}
.tl-time{flex:0 0 112px;font-size:12px;color:var(--text-3)}
.tl-main{min-width:0;font-size:14px}.tl-qty{margin-left:6px;font-size:12px;font-weight:700;color:var(--brand)}
.tl-route,.tl-who{font-size:12px;color:var(--text-3)}.tl-note{font-size:13px;color:var(--text-2)}
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:10px}
.photo-grid a{display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--text-3);text-decoration:none}
.photo-grid img{width:100%;height:90px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
.pm-wrap{overflow-x:auto;margin:10px 0}
.pm-table{border-collapse:collapse;min-width:760px;width:100%;font-size:13.5px}
.pm-table th,.pm-table td{padding:8px 10px;border-bottom:1px solid var(--line);text-align:center}
.pm-table th:first-child,.pm-table td:first-child{text-align:left}
.pm-user small{display:block;color:var(--text-3);font-size:12px}
.pm-cell input{width:22px;height:22px}
.pm-legend{margin:8px 0;padding-left:18px;font-size:13px;color:var(--text-2);line-height:1.6}
@media (max-width:700px){.pm-table{min-width:0}.pm-table thead{display:none}.pm-table,.pm-table tbody,.pm-table tr,.pm-table td{display:block;width:100%}.pm-table tr{border:1px solid var(--line);border-radius:10px;margin-bottom:10px;padding:6px 10px}.pm-table td{border:0;padding:6px 0;text-align:left}.pm-table td.pm-cell{display:flex;justify-content:space-between;align-items:center}.pm-table td.pm-cell::before{content:attr(data-label);font-size:13px;color:var(--text-2)}}
@media (max-width:600px){.tl-row{flex-direction:column;gap:2px}.tl-time{flex:none}}
.photo-pick{display:flex;flex-direction:column;gap:8px;margin:12px 0}
.photo-pick button{align-self:flex-start}
.photo-need{font-size:13px;color:var(--danger)}.photo-need.ok{color:var(--ok)}
.photo-prev{max-width:100%;max-height:200px;object-fit:contain;border-radius:10px;border:1px solid var(--line);background:var(--surface-2)}
.history-photo{margin-top:6px;height:84px;border-radius:8px;border:1px solid var(--line);display:block}
.set-recv{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.set-recv-row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.set-recv-row span{flex:1;font-size:14px;overflow-wrap:anywhere}.set-recv-row small{display:block;color:var(--text-3);font-size:12px}
.set-recv-row input{width:110px;flex:none}
.bu-line{display:inline-flex;align-items:center;margin-left:6px;font-size:12px;font-weight:700;color:var(--danger)}
.bu-line:empty{display:none}
.recv-line{display:inline-flex;align-items:center;margin-left:6px;font-size:12px;font-weight:600;color:var(--text-3)}
.recv-line:empty{display:none}
.recv-line.ok{color:var(--ok)}.recv-line.warn{color:var(--warn)}.recv-line.bad{color:var(--danger)}
.recv-filters{display:flex;flex-wrap:wrap;gap:6px 18px;margin:4px 0 12px}
.recv-filters .recv-filter{display:flex;flex-direction:row;align-items:center;gap:8px;font-size:14px;cursor:pointer}
.recv-filter input{width:18px;height:18px;min-height:0;padding:0;margin:0;flex:none}
.recv-item{border:1px solid var(--line);border-radius:10px;margin-bottom:10px;background:var(--surface)}
.recv-item>summary{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;padding:10px 12px;cursor:pointer}
.recv-cust{color:var(--text-3);font-size:13px}
.recv-chips{display:flex;gap:6px;flex-wrap:wrap;margin-left:auto}
.recv-chip{display:inline-flex;align-items:center;height:22px;padding:0 9px;border-radius:999px;font-size:12px;font-weight:600;background:var(--surface-3);color:var(--text-2);white-space:nowrap}
.recv-chip.ok{background:var(--ok-bg);color:var(--ok)}.recv-chip.warn{background:var(--warn-bg);color:var(--warn)}.recv-chip.bad{background:var(--danger-bg);color:var(--danger)}.recv-chip.muted{color:var(--text-3)}
.recv-item .hint{margin:0 12px 8px}
.recv-scroll{overflow-x:auto;padding:0 12px 12px}
.recv-table{width:100%;border-collapse:collapse;font-size:13px}
.recv-table th,.recv-table td{padding:7px 8px;border-bottom:1px solid var(--line);text-align:left}
.recv-table .num{text-align:right;white-space:nowrap}
.qsc-kv span{color:var(--text-3)}.qsc-kv b{text-align:right;overflow-wrap:anywhere}
.qsc-qty-label{display:block;margin:16px 0 6px;font-weight:600;font-size:14px}
.qsc-dialog input[type=number]{font-size:24px;font-weight:700;padding:12px;text-align:center;min-height:56px}
.qsc-actions{display:flex;gap:10px;margin-top:16px}.qsc-actions button{flex:1}
.qsc-xk-img{display:block;max-width:100%;max-height:170px;margin:12px auto 4px;border-radius:var(--r-md);background:#fff;border:1px solid var(--line)}
.qsc-select{font-size:16px}
.qsc-dialog .meta{margin:8px 0 0}

/* ---------- 12. Trạng thái máy chủ (admin, trong thanh bên) ---------- */
.admin-system-health{margin-top:6px;padding:12px;background:var(--side-bg-2);border:1px solid var(--side-line);border-radius:12px;font-size:12.5px;color:var(--side-text)}
.ash-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.ash-head b{color:#fff;font-size:13.5px}.ash-kicker{display:block;font-size:10px;letter-spacing:.12em;color:var(--side-muted)}
.admin-system-health .ash-refresh{width:30px;min-height:30px;padding:0;background:transparent;color:var(--side-muted)}
.admin-system-health .ash-refresh.spin .ico{animation:uxspin .8s linear infinite}
@keyframes uxspin{to{transform:rotate(360deg)}}
.ash-overall{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;font-weight:600}
.ash-overall i,.ash-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:7px;background:var(--side-muted)}
.ash-overall.ok i,.ash-dot.ok{background:#43c286}.ash-overall.warn i,.ash-dot.warn{background:#f0a04a}.ash-overall.bad i,.ash-dot.bad{background:#ff7a6e}
.ash-overall small{color:var(--side-muted);font-weight:500}
.ash-states{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;margin-bottom:10px}
.ash-state{display:flex;flex-direction:column;gap:2px;padding:7px 9px;background:rgba(255,255,255,.04);border-radius:8px}
.ash-state span{color:var(--side-muted);font-size:11px}.ash-state b{color:#fff;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ash-resource{display:grid;grid-template-columns:36px 1fr 34px;align-items:center;gap:8px;margin:5px 0;color:var(--side-muted);font-size:11px}
.ash-resource i{display:block;height:5px;border-radius:5px;background:rgba(255,255,255,.1);overflow:hidden}
.ash-resource em{display:block;height:100%;border-radius:5px;background:#43c286}.ash-resource em.warn{background:#f0a04a}.ash-resource em.bad{background:#ff7a6e}
.ash-resource b{color:#fff;text-align:right;font-size:11px}
.ash-meta{display:flex;justify-content:space-between;gap:8px;margin-top:6px;color:var(--side-muted);font-size:11.5px}.ash-meta b{color:#fff}
.ash-loading,.ash-error{color:var(--side-muted);font-size:12px}

/* Sao lưu & LAN, QR điện thoại */
.system-maintenance-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;margin-top:12px}
.maintenance-card{border:1px solid var(--line);border-radius:var(--r-md);padding:16px;background:var(--surface-2)}
.maintenance-title{display:flex;gap:12px;align-items:flex-start;margin-bottom:10px}
.maintenance-title h3{margin:0 0 2px;color:var(--text)}.maintenance-title p{margin:0;color:var(--text-2);font-size:13.5px}
.maintenance-icon{width:38px;height:38px;border-radius:10px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center;flex:0 0 auto;font-size:0}
.phone-qr-box{display:grid;grid-template-columns:auto 1fr;gap:20px;align-items:start;margin-top:12px}
.phone-qr{width:176px;height:176px;border-radius:var(--r-md);background:#fff;padding:8px;border:1px solid var(--line)}
.mobile-link-title{font-weight:600;margin-bottom:6px}
.mobile-link-line{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;margin:6px 0;border:1px solid var(--line);background:var(--surface-2);border-radius:var(--r-sm);overflow-wrap:anywhere}
.mobile-link-line button{min-height:32px;padding:0 10px;font-size:13px;background:var(--surface);color:var(--text);border-color:var(--line-strong)}


.maintenance-icon .ico{width:20px;height:20px}
.maintenance-danger{margin-top:14px;border-color:var(--danger-line);background:var(--danger-bg)}
.maintenance-danger .maintenance-icon{background:var(--surface);color:var(--danger)}
.lan-share-grid{display:grid;gap:10px;margin:10px 0}
.lan-share-preview{display:flex;flex-direction:column;gap:4px;margin:6px 0 10px;font-size:13px;color:var(--text-3)}
.lan-share-preview code{display:block;padding:8px 10px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-sm);font-family:ui-monospace,Consolas,monospace;color:var(--text);overflow-wrap:anywhere}
.clear-data-confirm{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}.clear-data-confirm input{flex:1 1 200px;width:auto}
input[type=file]::file-selector-button{font:inherit;font-weight:600;font-size:13px;margin-right:12px;padding:7px 12px;border:1px solid var(--line-strong);border-radius:var(--r-sm);background:var(--surface-2);color:var(--text);cursor:pointer}
.field-wrap{display:flex;flex-direction:column}

/* ---------- 13. Đăng nhập ---------- */
body.login{background:var(--bg)}
.login-shell{min-height:100vh;min-height:100dvh;display:grid;grid-template-columns:minmax(320px,44%) 1fr}
.login-aside{background:var(--side-bg);color:#fff;padding:44px 48px;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}
.login-aside::after{content:"";position:absolute;right:-90px;bottom:-90px;width:320px;height:320px;border-radius:50%;border:56px solid rgba(200,16,46,.55)}
.login-aside-brand{display:flex;align-items:center;gap:14px}
.login-aside-brand img{width:46px;height:46px;border-radius:12px;background:#fff;padding:5px;object-fit:contain}
.login-aside-brand b{letter-spacing:.18em;font-size:16px}
.login-aside-copy h2{font-size:40px;line-height:1.08;margin-bottom:14px;letter-spacing:-.02em}
.login-aside-copy p{max-width:340px;color:var(--side-text);font-size:15.5px}
.login-aside-foot{font-size:12.5px;color:var(--side-muted);position:relative;z-index:1}
.login-main{display:grid;place-items:center;padding:28px}
.login-box{width:min(400px,100%);display:flex;flex-direction:column;gap:6px}
.login-brand{display:none;align-items:center;gap:12px;margin-bottom:18px}
.login-logo{width:44px;height:44px;border-radius:12px;background:#fff;padding:5px;object-fit:contain;border:1px solid var(--line)}
.login-brand b{letter-spacing:.16em}
.login-box h1{font-size:28px;margin-bottom:2px}
.login-sub{color:var(--text-3);margin-bottom:14px}
.login-box label{margin-top:10px}
.login-box input{font-size:16px;min-height:48px}
.pw-wrap{position:relative}
.pw-wrap input{padding-right:52px}
.pw-eye{position:absolute;right:4px;top:4px;width:40px;height:40px;border:0;background:transparent}
.login-msg{min-height:22px;margin:6px 0 4px;color:var(--danger);font-size:14px}
.login-box .primary{min-height:50px;font-size:16px}

/* Dòng lệnh thành thẻ khi bề ngang không đủ cho bảng (điện thoại, máy tính bảng, laptop rất nhỏ) */
@media (max-width:1179px){
  .order-list-head{display:none}
  .order-list-wrap{gap:14px}
  .order-po-header{padding:10px 14px}
  .order-list-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 8px;padding:14px;min-height:0}
  .order-row-image{flex:0 0 56px}
  .order-row-name{flex:1 1 calc(100% - 70px)}
  .order-row-name>b{font-size:15px}
  .order-row-value{flex:0 0 auto;max-width:100%;padding:3px 10px;border-radius:999px;background:var(--surface-3);font-size:12.5px;font-weight:600}
  .order-row-value.qty::before{content:"SL ";color:var(--text-3);font-weight:500}
  .order-row-value.po::before{content:"PO ";color:var(--text-3);font-weight:500}
  .order-row-value.date::before{content:"Giao ";color:var(--text-3);font-weight:500}
  .order-row-value.qty{font-size:13px}
  .order-list-row>.order-row-value.assignee,.order-list-row>.order-row-value.color,.order-row-value.is-empty{display:none}
  .order-row-actions{flex:1 1 100%;justify-content:stretch;margin-top:4px;gap:8px}
  .order-row-actions button{flex:1 1 auto;min-height:44px;font-size:14px}
  .order-row-actions{flex-wrap:wrap}
  .order-row-actions button.icon-only{flex:0 0 46px;width:46px}
  .order-set-head{box-shadow:none;border-left:4px solid var(--brand)}

}
/* Laptop 13-14 inch: thu gọn cột */
@media (min-width:1180px) and (max-width:1499px){
  .order-list-head,.order-list-row{grid-template-columns:56px minmax(170px,1.5fr) 56px 64px minmax(90px,.8fr) 78px minmax(345px,1fr);column-gap:10px;padding-inline:14px}
  .order-row-actions button{padding:0 9px}
}

/* ---------- 14. Màn hình vừa và nhỏ: thanh dưới + thẻ ---------- */
@media (max-width:1023px){
  .shell{display:block}
  .sidebar{position:fixed;top:auto;left:0;right:0;bottom:0;height:auto;flex-direction:row;gap:0;padding:6px 8px calc(6px + var(--sab));background:var(--surface);color:var(--text-2);border-top:1px solid var(--line);box-shadow:0 -6px 20px rgba(16,24,40,.08);overflow:visible;z-index:60}
  .brand,.side-foot,.admin-system-health{display:none}
  .nav-main{flex-direction:row;flex:1 1 0;width:auto;min-width:0;gap:2px}
  .nav-main>*{flex:1 1 0;min-width:0;position:relative}
  .grouped-menu-wrap,.system-menu-wrap{width:100%}
  .nav-admin{flex:0 0 64px;width:64px}
  .sidebar button{flex-direction:column;justify-content:center;gap:3px;min-height:54px;padding:6px 4px;font-size:11.5px;font-weight:600;color:var(--text-2);background:transparent;border-radius:12px}
  .sidebar button:hover{background:var(--surface-2);color:var(--text)}
  .sidebar button.active,.sidebar button[aria-expanded="true"]{background:var(--brand-soft);color:var(--brand)}
  .sidebar button.active::before{display:none}
  .system-submenu{position:absolute;right:0;bottom:calc(100% + 12px);min-width:230px;margin:0;padding:6px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);box-shadow:var(--shadow-md);border-left:1px solid var(--line)}
  .system-submenu button{flex-direction:row;justify-content:flex-start;gap:12px;min-height:46px;padding:0 12px;font-size:14.5px;font-weight:500;color:var(--text)}
  .topbar{padding:calc(8px + var(--sat)) 16px 8px;min-height:calc(56px + var(--sat));gap:10px}
  .topbar-brand{display:block}.topbar-brand img{width:34px;height:34px;border-radius:9px;background:#fff;padding:3px;border:1px solid var(--line);object-fit:contain;display:block}
  .topbar h1{font-size:18px}
  .user-box{padding:3px;border-radius:50%}.user-copy{display:none}
  .logout-btn{width:40px;padding:0;font-size:0;gap:0}.logout-btn .ico{width:19px;height:19px}
  main{padding:14px 14px calc(92px + var(--sab))}
  .toolbar{gap:8px}
  .toolbar .primary{flex:1 1 auto}
  .toolbar input:not([type=checkbox]){order:5;flex:1 1 100%}
  .modal{align-items:flex-end;padding:0}
  .modal-box{width:100%!important;max-height:92dvh;border-radius:20px 20px 0 0;padding:20px 18px calc(20px + var(--sab))}
  .qsc-overlay{align-items:flex-end;padding:0}
  .qsc-dialog{max-width:none;border-radius:20px 20px 0 0;max-height:94dvh;padding:20px 18px calc(20px + var(--sab))}
  .ux-confirm{align-items:flex-end;padding:0}.ux-confirm-card{width:100%;border-radius:20px 20px calc(0px) calc(0px);padding-bottom:calc(22px + var(--sab))}
  .ux-toast-stack{left:12px;right:12px;width:auto;top:calc(10px + var(--sat))}
  .img-modal-info,.order-detail-view .group-detail-head,.phone-qr-box{grid-template-columns:1fr}
  .img-modal-info .img,.order-detail-view .img{max-width:200px}
  .team-process-split{grid-template-columns:1fr}
  .modal-box .actions button{flex:1 1 auto;min-height:48px}
  .account-table td:last-child:has(.actions:empty){display:none}

  /* bảng -> thẻ */
  .account-table,.account-table tbody,.account-table tr,.account-table td{display:block;width:100%}
  .account-table thead{display:none}
  .account-table-wrap,.team-process-table-wrap{background:transparent;border:0;box-shadow:none;overflow:visible}
  .account-table tr{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);margin:0 0 10px;padding:6px 14px;box-shadow:var(--shadow-sm)}
  .account-table td{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:9px 0;border-bottom:1px solid var(--line);text-align:right}
  .account-table td:first-child{font-size:15.5px;text-align:left;justify-content:flex-start}
  .account-table td[data-label]::before{content:attr(data-label);color:var(--text-3);font-size:12.5px;font-weight:500;text-align:left;flex:0 0 auto}
  .account-table td:last-child{border-bottom:0;padding-top:12px}
  .account-table td:last-child .actions{width:100%}.account-table td:last-child .actions button{flex:1}
  .account-table td.empty-cell{justify-content:center}
  .account-password-cell{max-width:none;flex:1;justify-content:flex-end}.account-password-cell input{max-width:170px}
  input,select,textarea{font-size:16px}   /* iPhone không tự phóng to khi chạm vào ô nhập */
}
@media (max-width:420px){
  .order-row-actions button{padding:0 8px}
}
@media (max-width:860px){
  .login-shell{grid-template-columns:1fr}
  .login-aside{display:none}
  .login-brand{display:flex}
}
@media (min-width:1024px) and (max-width:1180px){
  main{padding-inline:18px}.topbar{padding-inline:18px}
  .team-process-split{grid-template-columns:1fr}
}
@media print{.sidebar,.topbar,.toolbar,.ux-toast-stack{display:none!important}.shell{display:block}main{padding:0}}
