:root {
      --ink: #17313a; --muted: #687b81; --line: #d9e3e4; --paper: #fff;
      --bg: #f2f6f4; --green: #176b55; --green-2: #0f5543; --mint: #e4f2ed;
      --amber: #dc8b26; --red: #b84040; --shadow: 0 16px 40px rgba(25, 64, 65, .09);
    }
    * { box-sizing: border-box; }
    html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    html.standalone-app { overscroll-behavior: none; }
    html.standalone-app button,
    html.standalone-app a,
    html.standalone-app input,
    html.standalone-app select,
    html.standalone-app textarea { touch-action: manipulation; }
    body { margin: 0; color: var(--ink); background: var(--bg); font: 15px/1.5 Inter, system-ui, sans-serif; }
    body.action-dialog-open { overflow: hidden; }
    body.login-mode { min-height: 100vh; background: linear-gradient(135deg, #eef7f3 0%, #f8fbfa 45%, #e5f1ee 100%); }
    body.app-booting { min-height: 100vh; overflow: hidden; }
    body.app-booting::after { content: "Đang tải dữ liệu..."; position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; color: #315e52; background: linear-gradient(135deg, #eef7f3 0%, #f8fbfa 45%, #e5f1ee 100%); font-weight: 800; letter-spacing: .01em; }
    button, input, select { font: inherit; }
    .login-screen { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px; }
    .login-card { width: min(420px, 100%); display: grid; gap: 12px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(25, 64, 65, .16); }
    .login-logo { width: 62px; height: 62px; justify-self: center; object-fit: cover; border-radius: 16px; border: 1px solid #d5e2df; box-shadow: 0 12px 28px rgba(25, 64, 65, .12); }
    .login-card h1 { color: var(--ink); font-size: 28px; text-align: center; }
    .login-card p { margin: -4px 0 4px; color: var(--muted); text-align: center; }
    .login-card label { color: var(--ink); font-weight: 800; }
    .login-card input { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
    .login-card .btn { width: 100%; justify-content: center; }
    .login-status { min-height: 20px; color: var(--muted); font-size: 13px; }
    .hero { color: white; background: linear-gradient(125deg, #123f37, #1b7960); padding: 18px max(20px, calc((100vw - 1420px)/2)); }
    .hero-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 0; }
    .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
    .hero-actions { position: relative; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
    .hero-btn { color: white; border-color: #ffffff55; background: rgba(255, 255, 255, .12); }
    .hero-btn:hover { border-color: #ffffffaa; background: rgba(255, 255, 255, .2); }
    .account-chip { display: flex; align-items: center; gap: 10px; max-width: min(320px, 44vw); border: 1px solid #ffffff55; border-radius: 12px; padding: 6px 10px 6px 7px; color: white; background: rgba(255, 255, 255, .14); cursor: pointer; box-shadow: 0 10px 24px rgba(7, 34, 30, .12); }
    .account-chip:hover { border-color: #ffffffaa; background: rgba(255, 255, 255, .22); }
    .account-avatar { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 10px; object-fit: cover; background: #fff; box-shadow: inset 0 0 0 1px #ffffff66; }
    .account-copy { min-width: 0; display: grid; gap: 1px; text-align: left; }
    .account-label { color: #d8eee7; font-size: 11px; font-weight: 700; text-transform: uppercase; }
    .account-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.2; }
    .account-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: min(280px, calc(100vw - 40px)); display: none; padding: 7px; border: 1px solid #cfe0dc; border-radius: 12px; background: #fff; box-shadow: 0 18px 44px rgba(7, 34, 30, .22); }
    .account-menu.open { display: block; }
    .account-menu button { width: 100%; border: 0; border-radius: 8px; padding: 10px 11px; color: var(--ink); background: transparent; text-align: left; font-weight: 750; cursor: pointer; }
    .account-menu button:hover { background: var(--mint); }
    .account-menu .danger-text { color: var(--red); }
    .logo { width: 42px; height: 42px; display: block; flex: 0 0 auto; object-fit: cover; border: 1px solid #ffffff44; border-radius: 12px; background: #ffffff; box-shadow: 0 10px 24px rgba(7, 34, 30, .16); }
    h1 { margin: 0; font-size: clamp(21px, 2.4vw, 30px); line-height: 1.15; }
    .subtitle { color: #d8eee7; margin-top: 5px; font-size: 13px; }
    .nav-wrap { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
    .tabs { width: 100%; margin: auto; padding: 0 clamp(12px, 1.6vw, 28px); display: flex; overflow-x: auto; scrollbar-width: thin; }
    .tab { flex: 0 0 auto; padding: 13px 16px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font-weight: 700; cursor: pointer; white-space: nowrap; }
    .tab.active { color: var(--green); border-bottom-color: var(--green); }
    main,
    main.app-shell { width: 100%; max-width: none; margin: 24px 0 48px; padding: 0 clamp(12px, 1.6vw, 28px); }
    .panel { display: none; }
    .panel.active { display: block; width: 100%; }

    /* ===== Phân luồng tài khoản: chế độ chỉ-xem ẩn nút thêm/sửa/xóa =====
       Mọi tài khoản đăng nhập vẫn XEM được các mục; body.can-edit-<area> chỉ được
       gắn cho khu vực thuộc nhóm vai trò (admin có tất cả), điều khiển ghi bên trong
       khu vực không được phép sẽ bị ẩn. */
    /* Menu tài khoản trên header */
    body:not(.can-edit-users) #manageEmployeeAccounts,
    body:not(.can-edit-ai-data) #manageAiData,
    /* 1. Quản lý đơn hàng */
    body:not(.can-edit-orders) #panel-saved-orders #createOrderFromList,
    body:not(.can-edit-orders) #panel-saved-orders .copy-order,
    body:not(.can-edit-orders) #panel-saved-orders .send-production-order,
    body:not(.can-edit-orders) #panel-saved-orders .delete-order,
    /* 4. Soạn đơn hàng */
    body:not(.can-edit-order) #panel-order #saveOrder,
    body:not(.can-edit-order) #panel-order #clearOrder,
    body:not(.can-edit-order) #panel-order #addOrderTableRow,
    body:not(.can-edit-order) #panel-order #calculate,
    body:not(.can-edit-order) #panel-order #openDrawingAi,
    body:not(.can-edit-order) #panel-order #analyzeDrawing,
    body:not(.can-edit-order) #panel-order #addDrawingManualItem,
    body:not(.can-edit-order) #panel-order #saveDrawingSuggestions,
    body:not(.can-edit-order) #panel-order #embedDrawingSuggestions,
    body:not(.can-edit-order) #panel-order #applyDrawingSuggestions,
    body:not(.can-edit-order) #panel-order .remove-row,
    /* 3. Quản lý sản xuất */
    body:not(.can-edit-production) #panel-production #confirmProductionSelection,
    body:not(.can-edit-production) #panel-production #sendProductionPlanToWarehouse,
    body:not(.can-edit-production) #panel-production #requestProductionWarehouseEntry,
    body:not(.can-edit-production) #panel-production #selectProductionOrders,
    body:not(.can-edit-production) #panel-production .production-order-check,
    /* 2. Quản lý kho */
    body:not(.can-edit-warehouse) #panel-warehouse #proposeWarehouseMaterialPurchase,
    body:not(.can-edit-warehouse) #panel-warehouse #proposeWarehouseWorkshopIssue,
    body:not(.can-edit-warehouse) #panel-warehouse #confirmWarehouseWorkshopIssue,
    body:not(.can-edit-warehouse) #panel-warehouse #confirmWarehouseDispatch,
    body:not(.can-edit-warehouse) #panel-warehouse #confirmWarehouseFinishedGoodsIn,
    body:not(.can-edit-warehouse) #panel-warehouse #openPurchaseOrderDialog,
    body:not(.can-edit-warehouse) #panel-warehouse .warehouse-plan-delete,
    body:not(.can-edit-warehouse) #panel-warehouse .warehouse-dispatch-select,
    body:not(.can-edit-warehouse) #panel-warehouse .warehouse-dispatch-confirm,
    body:not(.can-edit-warehouse) #panel-warehouse .workflow-progress,
    body:not(.can-edit-warehouse) #panel-warehouse .warehouse-proposal-check,
    body:not(.can-edit-warehouse) #panel-warehouse .po-apply,
    body:not(.can-edit-warehouse) #panel-warehouse .po-item-trigger,
    body:not(.can-edit-warehouse) #panel-warehouse .warehouse-finished-stock-row,
    body:not(.can-edit-warehouse) #panel-warehouse .warehouse-material-stock-row,
    /* 5. Bộ sản phẩm (giữ .product-image-preview để vẫn xem được ảnh) */
    body:not(.can-edit-products) #panel-products .toggle-add,
    body:not(.can-edit-products) #panel-products .row-action-trigger,
    body:not(.can-edit-products) #panel-products .product-image-manage,
    body:not(.can-edit-products) #panel-products .product-image-empty,
    body:not(.can-edit-products) #panel-products .manage-product-add-images,
    body:not(.can-edit-products) #saveProductImages,
    body:not(.can-edit-products) .set-product-representative,
    body:not(.can-edit-products) .product-image-remove,
    body:not(.can-edit-products) label[for="productImageFiles"],
    body:not(.can-edit-products-price) #panel-products label[for="importProductPricesFile"],
    /* 6. Chi tiết định mức (giữ .detail-image-preview để vẫn xem được ảnh) */
    body:not(.can-edit-details) #panel-details .toggle-add,
    body:not(.can-edit-details) #panel-details .row-action-trigger,
    body:not(.can-edit-details) #panel-details .detail-image-manage,
    body:not(.can-edit-details) #panel-details .detail-image-empty,
    body:not(.can-edit-details) #saveDetailImages,
    body:not(.can-edit-details) .set-detail-representative,
    body:not(.can-edit-details) .detail-image-remove,
    body:not(.can-edit-details) label[for="detailImageFiles"],
    body:not(.can-edit-details-price) #panel-details label[for="importDetailPricesFile"],
    /* Nguyên vật liệu (giữ .material-image-preview để vẫn xem được ảnh) */
    body:not(.can-edit-materials) #panel-materials .toggle-add,
    body:not(.can-edit-materials) #panel-materials .row-action-trigger,
    body:not(.can-edit-materials) #panel-materials .material-image-manage,
    body:not(.can-edit-materials) #panel-materials .material-image-empty,
    body:not(.can-edit-materials) #panel-materials .manage-material-add-images,
    body:not(.can-edit-materials) #saveMaterialImages,
    body:not(.can-edit-materials) .set-material-representative,
    body:not(.can-edit-materials) .material-image-remove,
    body:not(.can-edit-materials) label[for="materialImageFiles"],
    /* Tạo nhanh danh mục từ trang Quản lý dữ liệu AI */
    body:not(.can-edit-products) .ai-quick-create-products,
    body:not(.can-edit-details) .ai-quick-create-details,
    body:not(.can-edit-materials) .ai-quick-create-materials,
    /* Quản lý tài khoản (chỉ admin) */
    body:not(.can-edit-users) #panel-users #createUser,
    body:not(.can-edit-users) #panel-users .edit-user,
    body:not(.can-edit-users) #panel-users .delete-user,
    /* Dữ liệu AI */
    body:not(.can-edit-ai-data) #panel-ai-data #aiAddLearningItem,
    body:not(.can-edit-ai-data) #panel-ai-data #aiSaveLearningData,
    body:not(.can-edit-ai-data) #panel-ai-data #aiEmbedLearningData,
    body:not(.can-edit-ai-data) #panel-ai-data .ai-learning-delete,
    body:not(.can-edit-ai-data) #panel-ai-data .ai-history-version {
      display: none !important;
    }
    /* Ô nhập tự lưu ở mục chỉ-xem: khóa tương tác, giữ nguyên bố cục bảng */
    body:not(.can-edit-production) #panel-production .production-deduct-input,
    body:not(.can-edit-production) #panel-production .production-stage-output,
    body:not(.can-edit-production) #panel-production .production-warehouse-request,
    body:not(.can-edit-production) #panel-production .production-completed-input,
    body:not(.can-edit-ai-data) #panel-ai-data .ai-learning-quantity {
      pointer-events: none;
      opacity: .55;
    }
    /* Quyền xem riêng "Giá sản phẩm"/"Giá chi tiết": body.can-view-products-price /
       .can-view-details-price ẩn cả cột trong bảng lẫn ô nhập trong form khi nhóm vai trò
       không có quyền xem giá (mức "none") — không chỉ ẩn nút sửa như .can-edit-<area> ở trên. */
    body:not(.can-view-products-price) #panel-products .product-price-column,
    body:not(.can-view-products-price) #panel-products .col-product-price,
    body:not(.can-view-products-price) #panel-products .cell-product_price,
    body:not(.can-view-products-price) #productForm .product-price-field,
    body:not(.can-view-details-price) #panel-details .detail-price-column,
    body:not(.can-view-details-price) #panel-details .col-detail-price,
    body:not(.can-view-details-price) #panel-details .cell-detail_price,
    body:not(.can-view-details-price) #detailForm .detail-price-field {
      display: none !important;
    }
    /* Có quyền xem nhưng không có quyền sửa ("view"): vẫn thấy giá, khóa không cho gõ. */
    body:not(.can-edit-products-price) #panel-products .cell-product_price .inline-input,
    body:not(.can-edit-products-price) #productForm .product-price-field input,
    body:not(.can-edit-details-price) #panel-details .cell-detail_price .inline-input,
    body:not(.can-edit-details-price) #detailForm .detail-price-field input {
      pointer-events: none;
      opacity: .55;
    }
    .section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
    h2 { margin: 0; font-size: 23px; }
    .hint { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
    .card { width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
    .card-pad { padding: 18px; }
    .toolbar { display: flex; gap: 9px; flex-wrap: wrap; }
    .catalog-view-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
    .catalog-view-tab { padding: 7px 12px; font-size: 13px; border-radius: 999px; }
    .catalog-view-tab.active { color: #fff; border-color: var(--green); background: var(--green); }
    .catalog-view-tab-count { font-weight: 800; }
    .catalog-view-tab:not(.active) .catalog-view-tab-count { color: #9a2727; }
    .btn { border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; }
    .btn:hover { border-color: #aac4bc; }
    .btn.primary { color: white; border-color: var(--green); background: var(--green); }
    .btn.primary:hover { background: var(--green-2); }
    .btn.primary.is-waiting { color: #6f8f84; border-color: #d3e3dd; background: #eaf2ef; }
    .btn.primary.is-waiting:disabled { opacity: 1; }
    .btn.danger { padding: 7px 10px; color: var(--red); background: #fff7f7; }
    .btn.primary.danger { padding: 9px 14px; color: #fff; border-color: #b45309; background: #b45309; }
    .btn.primary.danger:hover { border-color: #92400e; background: #92400e; }
    /* Hai nút đề xuất dùng hai màu khác nhau để dễ phân biệt: mua NVL (cam), vật tư xưởng (xanh). */
    .btn.primary.btn-propose-purchase { color: #fff; border-color: #b45309; background: #b45309; }
    .btn.primary.btn-propose-purchase:hover { border-color: #92400e; background: #92400e; }
    .btn.primary.btn-propose-workshop { color: #fff; border-color: var(--green); background: var(--green); }
    .btn.primary.btn-propose-workshop:hover { border-color: var(--green-2); background: var(--green-2); }
    .ai-drawing-button { color: #57400d; border-color: #e3bd63; background: #fff7dc; }
    .order-review-mode #openDrawingAi,
    .order-review-mode #saveOrder,
    .order-review-mode .drawing-ai-card { display: none; }
    .drawing-ai-card { margin: 0 0 18px; overflow: hidden; border: 1px solid #c6dbd5; border-radius: 18px; background: #f7fbf9; box-shadow: 0 18px 46px rgba(25, 64, 65, .11); }
    .drawing-ai-card[hidden], .drawing-ai-result[hidden] { display: none; }
    .drawing-ai-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px 16px; border-bottom: 1px solid #dce9e5; background: #fff; }
    .drawing-ai-title { min-width: 0; display: flex; align-items: center; }
    .drawing-ai-title > strong { font-size: 17px; line-height: 1.3; }
    .drawing-head-actions { display: flex; gap: 7px; flex: 0 0 auto; }
    .drawing-close-button { color: var(--muted); background: #f7faf9; }
    .drawing-ai-controls { display: grid; grid-template-columns: minmax(360px, 1fr) auto; gap: 14px; align-items: end; padding: 16px 20px 12px; }
    .drawing-ai-controls label { display: grid; gap: 6px; color: #31534b; font-size: 12px; font-weight: 850; }
    .drawing-ai-controls select, .drawing-ai-controls input:not([type="hidden"]) { min-width: 0; width: 100%; height: 44px; padding: 8px 11px; border: 1px solid #c9dad6; border-radius: 10px; color: var(--ink); background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
    .drawing-ai-controls select:focus, .drawing-ai-controls input:focus { outline: 0; border-color: #65a391; box-shadow: 0 0 0 3px rgba(23, 107, 85, .11); }
    .drawing-ai-controls input[type="file"] { padding: 5px 7px; color: var(--muted); }
    .drawing-ai-controls input[type="file"]::file-selector-button { height: 32px; margin-right: 10px; padding: 0 12px; border: 0; border-radius: 7px; color: #fff; background: var(--green); font-weight: 800; cursor: pointer; }
    .drawing-file-control { min-width: 0; }
    .drawing-ai-control-actions { display: flex; gap: 8px; align-items: stretch; }
    .drawing-ai-control-actions .btn { min-height: 44px; padding-inline: 16px; white-space: nowrap; }
    .drawing-pdf-button { color: #204f44; border-color: #80ab9f; background: #eaf6f2; }
    .drawing-pdf-button:hover { border-color: var(--green); background: #dff1eb; }
    .drawing-learning-hint { display: block; margin-top: 8px; color: var(--muted); line-height: 1.45; }
    .drawing-ai-status { min-height: 0; margin: 0 20px 12px; color: #46645d; font-size: 12px; }
    .drawing-ai-status:not(:empty) { padding: 8px 10px; border: 1px solid #d6e6e1; border-radius: 9px; background: rgba(255, 255, 255, .8); }
    .drawing-ai-status.busy { color: #7a570c; border-color: #ead6ad; background: #fff9ec; font-weight: 750; }
    .drawing-ai-compare { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; padding: 0 20px 18px; }
    .drawing-ai-compare.has-preview.has-result { grid-template-columns: minmax(480px, 1.05fr) minmax(480px, .95fr); }
    .drawing-preview-pane[hidden] { display: none; }
    .drawing-preview-pane, .drawing-ai-result { min-width: 0; overflow: hidden; border: 1px solid #cbded8; border-radius: 13px; background: #fff; box-shadow: 0 8px 24px rgba(25, 64, 65, .06); }
    .drawing-preview-pane { position: sticky; top: 68px; }
    .drawing-pane-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #dbe6e3; background: #eef6f3; }
    .drawing-pane-head > div { min-width: 0; display: grid; }
    .drawing-pane-head small { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
    .drawing-pane-head .disabled { opacity: .45; pointer-events: none; }
    .drawing-preview-pane iframe { width: 100%; height: clamp(900px, 130vh, 1200px); display: block; border: 0; background: #e8eeec; }
    .drawing-ai-result-body { padding: 14px; }
    .drawing-ai-result .table-wrap { overflow: auto; border: 1px solid #d8e5e1; border-radius: 10px; }
    .drawing-manual-panel { margin-top: 12px; padding: 10px; border: 1px solid #d5e3df; border-radius: 10px; background: #f8fbfa; }
    .drawing-manual-add { display: grid; grid-template-columns: minmax(260px, 1fr) 100px auto; gap: 9px; align-items: center; }
    .drawing-manual-add > div { min-width: 0; }
    .drawing-manual-add input { width: 100%; height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .drawing-manual-badge { display: block; width: max-content; margin-top: 4px; padding: 2px 6px; border-radius: 999px; color: #315e52; background: #dff1eb; font-size: 10px; font-weight: 800; }
    .drawing-ai-table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 13px; }
    .drawing-ai-table th, .drawing-ai-table td { padding: 9px 10px; border: 1px solid #dbe6e3; text-align: left; vertical-align: top; }
    .drawing-ai-table th { position: sticky; top: 0; z-index: 1; color: #173f36; background: #e4f0ec; }
    .drawing-ai-table tbody tr:nth-child(even) { background: #fbfdfc; }
    .drawing-ai-table tbody tr:hover { background: #f1f8f5; }
    .drawing-ai-table input[type="number"] { width: 90px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 7px; }
    .drawing-confidence { white-space: nowrap; font-weight: 800; }
    .drawing-ai-unmatched { margin-top: 10px; color: #805215; font-size: 13px; }
    .drawing-ai-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e1ebe8; }
    .drawing-action-status { min-width: 0; display: flex; align-items: center; margin-right: auto; color: var(--muted); font-size: 11px; font-weight: 750; }
    .drawing-action-status.busy { color: #805a10; }
    .drawing-action-status.success { color: #176044; }
    .drawing-action-status.error { color: var(--red); }
    .btn.small { padding: 5px 9px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
    .row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
    .inline-input { width: 100%; min-width: 72px; padding: 7px 8px; font-size: 12px; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
    .inline-input.wide { min-width: 130px; }
    tr { transition: background-color .18s ease; }
    td { transition: background-color .18s ease, border-color .18s ease; }
    .editing-row td { background: #fbfdfc; box-shadow: inset 0 1px 0 #d7e5e1, inset 0 -1px 0 #d7e5e1; }
    .editing-row .inline-input { background: #fff; border-color: #b7d2ca; }
    .stock-editor { display: flex; gap: 6px; align-items: center; }
    .stock-editor input { width: 110px; }
    .stock-editor-status { color: var(--muted); font-size: 11px; font-weight: 750; white-space: nowrap; }
    .stock-editor-status.error { color: var(--red); }
    .btn:disabled { opacity: .5; cursor: not-allowed; }
    .order-section-nav { position: sticky; top: 54px; z-index: 12; display: flex; justify-content: center; margin: -2px 0 14px; pointer-events: none; }
    .order-section-menu { display: flex; gap: 6px; max-width: 100%; padding: 7px; overflow-x: auto; border: 1px solid #cddddb; border-radius: 12px; background: rgba(255, 255, 255, .95); box-shadow: 0 12px 30px rgba(25, 64, 65, .14); pointer-events: auto; }
    .order-section-menu .btn { flex: 0 0 auto; padding: 7px 11px; border-radius: 8px; font-size: 13px; transition: color .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease; }
    .order-section-menu .btn.active { color: #fff; border-color: var(--green); background: var(--green); box-shadow: 0 4px 12px rgba(23, 107, 85, .2); }
    .order-workspace { display: grid; grid-template-columns: minmax(672px, 1.12fr) minmax(618px, .93fr) minmax(514px, .88fr); gap: 8px; align-items: start; overflow-x: auto; padding: 0 2px 10px; overscroll-behavior-inline: contain; scrollbar-width: thin; scrollbar-color: #8eb8ac #e4eeeb; }
    .order-workspace::-webkit-scrollbar { height: 12px; }
    .order-workspace::-webkit-scrollbar-track { border-radius: 999px; background: #e4eeeb; }
    .order-workspace::-webkit-scrollbar-thumb { border: 3px solid #e4eeeb; border-radius: 999px; background: #78a99b; }
    .order-card { min-width: 0; overflow: hidden; scroll-margin-top: 112px; }
    .order-workspace > .warnings { grid-column: 1 / -1; }
    .order-card-title { padding: 8px 10px; color: #173f36; background: #cfe2dc; border-bottom: 1px solid #b9d1ca; font-size: 12px; font-weight: 900; text-align: center; text-transform: uppercase; letter-spacing: .02em; }
    .order-card-title-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
    .order-weight-badge { padding: 3px 9px; color: #6b4f00; background: #ffe27a; border: 1px solid #e0bf3a; border-radius: 6px; font-size: 11px; font-weight: 800; text-transform: none; letter-spacing: normal; white-space: nowrap; }
    .order-weight-badge strong { font-size: 12px; }
    .excel-shell { overflow: visible; background: #fff; }
    .excel-table { min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; }
    .order-entry-table { min-width: 670px; table-layout: fixed; }
    .detail-result-table { min-width: 616px; table-layout: fixed; }
    .material-result-table { min-width: 512px; table-layout: fixed; }
    .order-entry-table .col-index, .detail-result-table .col-index, .material-result-table .col-index { width: 36px; }
    .order-entry-table .col-code { width: 148px; }
    .order-entry-table .col-name { width: 192px; }
    .order-entry-table .col-unit { width: 48px; }
    .order-entry-table .col-quantity { width: 64px; }
    .order-entry-table .col-category { width: 82px; }
    .order-entry-table .col-actions { width: 78px; }
    .detail-result-table .col-code { width: 126px; }
    .detail-result-table .col-name { width: 168px; }
    .detail-result-table .col-unit { width: 48px; }
    .detail-result-table .col-quantity { width: 66px; }
    .detail-result-table .col-weight { width: 76px; }
    .detail-result-table .col-category { width: 86px; }
    .material-result-table .col-material { width: 196px; }
    .material-result-table .col-unit { width: 64px; }
    .material-result-table .col-quantity, .material-result-table .col-stock { width: 68px; }
    .excel-table th { background: #dfece8; border-right: 1px solid #c7d8d3; border-bottom: 1px solid #bed2cc; }
    .excel-table .group-head { text-align: center; background: #cfe2dc; font-weight: 900; }
    .excel-table .sub-head { background: #e8f1ee; }
    .excel-table th:last-child, .excel-table td:last-child { border-right: 0; }
    .excel-table td { height: 34px; padding: 4px 5px; border-right: 1px solid #e4ecea; border-bottom: 1px solid #edf1f0; background: #fff; vertical-align: middle; }
    .excel-table tbody tr:hover td { background: #f8fbfa; }
    .excel-table .row-no { width: 42px; text-align: center; color: var(--muted); background: #f3f7f5; font-weight: 800; }
    .excel-cell-input { width: 100%; height: 32px; border: 0; border-radius: 6px; padding: 6px 8px; background: transparent; }
    .excel-cell-input:focus { background: #fff; box-shadow: 0 0 0 2px #176b5522; }
    .excel-readonly { min-height: 32px; display: flex; align-items: center; color: var(--ink); }
    .excel-readonly.muted { color: var(--muted); }
    .order-add-row td { padding: 9px; background: #f8fbfa; text-align: center; }
    .order-table-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
    .order-table-actions .btn { width: min(260px, 100%); }
    .result-empty td { padding: 26px 14px; color: var(--muted); text-align: center; }
    .picker { position: relative; }
    input, select { width: 100%; border: 1px solid #cbd9d7; border-radius: 9px; padding: 9px 11px; color: var(--ink); background: #fff; outline: none; }
    input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px #176b5518; }
    .suggestions { position: fixed; z-index: 120; max-height: 320px; overflow: auto; display: none; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 18px 42px #153f3530; }
    .suggestions.open { display: block; }
    .suggestion { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #eef2f1; }
    .suggestion:hover { background: var(--mint); }
    .suggestion strong, .suggestion span { display: block; }
    .suggestion strong { font-size: 13px; }
    .suggestion span { margin-top: 2px; color: var(--muted); font-size: 12px; white-space: normal; }
    .store-picker .store-suggestions { position: absolute; top: calc(100% + 6px); left: 0; width: min(540px, calc(100vw - 32px)); text-align: left; }
    .order-store-name-picker .store-suggestions { right: 0; left: auto; }
    .store-suggestion { width: 100%; border: 0; border-bottom: 1px solid #eef2f1; border-radius: 0; background: #fff; text-align: left; }
    .store-suggestion:first-child { border-radius: 9px 9px 0 0; }
    .store-suggestion:last-child { border-bottom: 0; border-radius: 0 0 9px 9px; }
    .store-suggestion:hover, .store-suggestion.is-active { background: var(--mint); }
    .store-suggestion strong { color: var(--ink); }
    .store-suggestion-empty { padding: 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
    .store-suggestion-empty .btn { width: auto; margin-top: 9px; }
    .empty { padding: 34px 18px; text-align: center; color: var(--muted); }
    .table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; max-height: 520px; }
    table { width: 100%; border-collapse: collapse; min-width: 720px; font-size: 13px; }
    th { position: sticky; top: 0; z-index: 8; padding: 10px; text-align: left; color: #335b55; background: #eaf3f0; border-bottom: 1px solid #ccdbd7; white-space: nowrap; }
    td { padding: 9px 10px; border-bottom: 1px solid #edf1f0; vertical-align: top; }
    tbody tr:hover { background: #f8fbfa; }
    .stock-shortage-row td { background: #fff3bf; }
    .detail-cashier-row td { color: #002060; }
    .product-catalog-table tbody tr:hover,
    .detail-catalog-table tbody tr:hover { background: transparent; }
    .product-catalog-table tbody tr:hover td:not(.group-cell),
    .detail-catalog-table tbody tr:hover td:not(.group-cell) { background: #f8fbfa; }
    .stock-shortage-row:hover td { background: #ffeaa0; }
    .group-start td { border-top: 2px solid #d7e5e1; }
    .group-cell { background: #fff !important; border-right: 1px solid #e6eeee; color: var(--ink); font-weight: 700; vertical-align: middle; }
    tr[data-group-index] > .group-cell { cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
    tr.group-hovered > .group-cell { background: var(--mint) !important; }
    .group-action-anchor { position: relative; padding-right: 40px !important; padding-bottom: 40px !important; }
    .group-action-trigger { position: absolute; z-index: 1; right: 6px; bottom: 6px; width: 27px; height: 27px; display: grid; place-items: center; padding: 0; border: 1px solid #8db8ac; border-radius: 8px; color: #fff; background: var(--green); box-shadow: 0 4px 12px rgba(23, 107, 85, .2); font-size: 19px; font-weight: 800; line-height: 1; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(3px); transition: opacity .14s ease, transform .14s ease, background-color .14s ease; }
    tr.group-hovered > .group-action-anchor .group-action-trigger,
    .group-action-anchor.group-action-active-cell .group-action-trigger { opacity: 1; pointer-events: auto; transform: translateY(0); }
    .row-action-anchor { position: relative; padding-right: 40px !important; }
    .row-action-trigger { position: absolute; z-index: 1; right: 6px; bottom: 6px; width: 27px; height: 27px; display: grid; place-items: center; padding: 0; border: 1px solid #8db8ac; border-radius: 8px; color: #fff; background: var(--green); box-shadow: 0 4px 12px rgba(23, 107, 85, .2); font-size: 19px; font-weight: 800; line-height: 1; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(3px); transition: opacity .14s ease, transform .14s ease, background-color .14s ease; }
    tr:hover > .row-action-anchor .row-action-trigger,
    .row-action-anchor.group-action-active-cell .row-action-trigger { opacity: 1; pointer-events: auto; transform: translateY(0); }
    /* Desktop: hiện đúng dấu + của bộ/dòng chi tiết khi hover. */
    body.can-edit-products #productTable tr[data-row-id]:hover > .row-action-anchor .product-detail-action-trigger,
    body.can-edit-products #productTable .group-action-anchor.group-action-active-cell .product-group-action-trigger,
    body.can-edit-products #productTable .row-action-anchor.group-action-active-cell .product-detail-action-trigger {
      z-index: 3;
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }
    /* Màn hình cảm ứng không có hover: luôn để dấu + ở trạng thái có thể bấm. */
    @media (hover: none), (pointer: coarse) {
      body.can-edit-products #productTable .product-group-action-trigger,
      body.can-edit-products #productTable .product-detail-action-trigger {
        z-index: 3;
        opacity: .82;
        pointer-events: auto;
        transform: translateY(0);
      }
    }
    tr.editing-row td:has(.detail-row-edit-actions) { position: relative; padding-bottom: 44px; }
    .detail-row-edit-actions { position: absolute; right: 6px; bottom: 6px; left: 6px; display: flex; gap: 5px; flex-wrap: nowrap; justify-content: center; }
    .detail-row-edit-actions .btn { padding: 5px 7px; font-size: 11px; }
    .detail-group-editing td:has(.detail-group-edit-actions),
    .product-group-editing td:has(.detail-group-edit-actions) { position: relative; padding-bottom: 44px; }
    .detail-group-edit-actions { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 5px; }
    .detail-group-edit-actions .btn { padding: 4px 7px; font-size: 11px; }
    .detail-group-add-row td { background: #f5faf8; border-top: 1px dashed #a9c8bf; vertical-align: middle; }
    .detail-group-add-row .inline-input { min-width: 64px; }
    .detail-group-add-row td:has(.detail-group-add-actions) { position: relative; padding-bottom: 44px; }
    .detail-group-add-actions { position: absolute; right: 6px; bottom: 6px; left: 6px; flex-wrap: nowrap; justify-content: center; }
    .detail-group-add-actions .btn { padding: 5px 7px; }
    .group-action-menu { position: fixed; z-index: 210; display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 18px 42px rgba(21, 63, 53, .18); }
    .group-action-menu button { display: block; width: 100%; padding: 8px 16px; border: 0; border-radius: 7px; background: none; color: var(--ink); font: inherit; font-weight: 700; text-align: left; white-space: nowrap; cursor: pointer; }
    .group-action-menu button:hover { background: var(--mint); }
    .group-action-menu .group-action-delete { color: var(--red); }
    .group-action-menu .group-action-delete:hover { background: #fdeaea; }
    .inline-edit-cell { display: flex; align-items: center; gap: 6px; }
    .inline-edit-cell .inline-input { flex: 1 1 auto; min-width: 0; }
    .inline-edit-actions { display: flex; gap: 6px; flex: 0 0 auto; }
    .inline-edit-actions .btn { padding: 5px 8px; }
    .num { text-align: right; font-variant-numeric: tabular-nums; }
    .balanced-table { table-layout: fixed; }
    .balanced-table th, .balanced-table td { vertical-align: middle; }
    .balanced-table th { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
    .balanced-table td { line-height: 1.35; overflow-wrap: anywhere; }
    .balanced-table th:first-child, .balanced-table td:first-child { text-align: center; }
    .balanced-table th:last-child { text-align: center; }
    .balanced-table td:last-child .row-actions { justify-content: center; }
    .balanced-table td.num { white-space: nowrap; }
    .saved-order-table { min-width: 2000px; }
    .saved-order-table .col-index { width: 52px; }
    .saved-order-table .col-order-code { width: 150px; }
    .saved-order-table .col-person { width: 190px; }
    .saved-order-table .col-store-code { width: 110px; }
    .saved-order-table .col-store-name { width: 160px; }
    .saved-order-table .col-datetime { width: 160px; }
    .saved-order-table .col-priority { width: 126px; }
    .saved-order-table .col-progress { width: 175px; }
    .saved-order-table .col-saved-date { width: 145px; }
    .saved-order-table .col-actions-wide { width: 380px; }
    .workflow-order-table { min-width: 1260px; }
    .workflow-order-table .col-index { width: 52px; }
    .workflow-order-table .col-select { width: 58px; }
    .workflow-order-table .col-order-name { width: 260px; }
    .workflow-order-table .col-order-code { width: 150px; }
    .workflow-order-table .col-person { width: 190px; }
    .workflow-order-table .col-datetime { width: 165px; }
    .workflow-order-table .col-progress { width: 190px; }
    .workflow-order-table .col-actions { width: 253px; }
    .store-address-table .col-index, .customer-table .col-index, .settlement-address-table .col-index { width: 52px; }
    .store-address-table { min-width: 900px; }
    .store-address-table .col-store-code { width: 130px; }
    .store-address-table .col-store-name { width: 220px; }
    .store-address-table .col-address { width: auto; }
    .store-address-table .col-system { width: 160px; }
    .customer-table { min-width: 760px; }
    .customer-table .col-customer-name { width: auto; }
    .customer-table .col-customer-code { width: 160px; }
    .customer-table .col-phone { width: 160px; }
    .customer-table .col-position { width: 180px; }
    .settlement-address-table { min-width: 760px; }
    .settlement-address-table .col-tax-code { width: 160px; }
    .settlement-address-table .col-branch-name { width: 220px; }
    .settlement-address-table .col-branch-address { width: auto; }
    .store-address-table th:last-child, .store-address-table td:last-child,
    .customer-table th:last-child, .customer-table td:last-child,
    .settlement-address-table th:last-child, .settlement-address-table td:last-child { text-align: left; }
    .warehouse-sheet-tabs { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
    .warehouse-sheet-tab { flex: 0 0 auto; min-height: 42px; padding: 10px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; color: var(--muted); background: transparent; font-weight: 850; cursor: pointer; white-space: nowrap; }
    .warehouse-sheet-tab:hover { color: var(--green); background: #f5faf8; }
    .warehouse-sheet-tab.active { color: var(--green); border-color: var(--line); background: #fff; box-shadow: 0 -1px 0 #fff inset; }
    .warehouse-sheet-panel { display: none; }
    .warehouse-sheet-panel.active { display: block; }
    .warehouse-table-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
    .warehouse-table-title h3 { margin: 0; font-size: 18px; line-height: 1.2; }
    .warehouse-table-title .hint { margin: 3px 0 0; }
    .warehouse-title-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .warehouse-io-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 12px 0 16px; }
    .warehouse-io-stat { min-width: 0; border: 1px solid var(--line); background: #f8fbfa; border-radius: 8px; padding: 10px 12px; }
    .warehouse-io-stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .warehouse-io-stat strong { display: block; margin-top: 4px; font-size: 22px; line-height: 1; color: var(--green); }
    .warehouse-io-stat.danger strong { color: #b45309; }
    .order-summary-card { margin-bottom: 16px; }
    .order-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
    .order-summary-head h3 { margin: 0; font-size: 18px; line-height: 1.2; }
    .order-summary-head .hint { margin: 3px 0 0; }
    .order-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
    .order-store-directory-warning { grid-column: span 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid #e7c47a; border-radius: 9px; color: #80561a; background: #fff8e8; font-size: 12px; line-height: 1.4; }
    .order-store-directory-warning[hidden] { display: none; }
    .order-store-directory-warning .btn { flex: 0 0 auto; border-color: #d8ab53; color: #704914; background: #fff; }
    .order-code-badge { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 999px; background: #eaf6f0; color: var(--green); font-size: 13px; font-weight: 800; }
    .order-code-badge[hidden] { display: none; }
    .warehouse-io-tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 4px 0 14px; scrollbar-width: thin; }
    .warehouse-io-tab { flex: 0 0 auto; min-height: 38px; padding: 8px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: transparent; color: var(--muted); font-weight: 850; cursor: pointer; white-space: nowrap; }
    .warehouse-io-tab:hover { color: var(--green); background: #f5faf8; }
    .warehouse-io-tab.active { color: var(--green); border-color: var(--line); background: #fff; }
    .warehouse-flow-stack { display: grid; gap: 14px; }
    .warehouse-flow-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
    .warehouse-flow-section { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 12px; min-width: 0; }
    .warehouse-flow-section.warehouse-flow-primary { background: #fbfdfc; }
    .warehouse-flow-section.warehouse-flow-muted { background: #fafafa; }
    .warehouse-io-panels > .warehouse-flow-section { display: none; }
    .warehouse-io-panels > .warehouse-flow-section.active { display: block; }
    .warehouse-flow-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 10px; }
    .warehouse-flow-head h4 { margin: 0; font-size: 16px; line-height: 1.25; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .warehouse-flow-head h4 small { color: var(--muted); font-size: 11px; font-weight: 850; border: 1px solid var(--line); background: #f6f8f7; border-radius: 999px; padding: 3px 8px; }
    #warehouseMaterialPurchaseStatus { border: 0; background: none; padding: 0; font-size: 12px; font-weight: 700; }
    .warehouse-flow-head h4:has(#warehouseMaterialPurchaseStatus) { font-size: 17px; }
    .warehouse-flow-head .hint { margin: 3px 0 0; }
    .warehouse-dispatch-panel { margin-top: 14px; padding: 12px; border: 1px solid #cfe1dc; border-radius: 8px; background: #f8fbfa; }
    .warehouse-dispatch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
    .warehouse-dispatch-section { min-width: 0; }
    .warehouse-dispatch-section .warehouse-flow-head { margin-bottom: 6px; }
    .warehouse-dispatch-status { min-height: 20px; margin-bottom: 10px; color: #46645d; font-size: 12px; font-weight: 750; }
    .warehouse-dispatch-table { min-width: 760px; }
    .warehouse-placeholder { border: 1px dashed var(--line); background: #f8faf9; color: var(--muted); padding: 12px; border-radius: 8px; }
    @media (max-width: 980px) {
      .warehouse-dispatch-grid { grid-template-columns: 1fr; }
      .warehouse-dispatch-panel .warehouse-flow-head { align-items: stretch; flex-direction: column; }
    }
    .status-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 850; white-space: nowrap; }
    .status-chip.status-storage { color: #176b55; background: #e8f6ef; }
    .status-chip.status-shortage { color: #9a3412; background: #fff2e8; }
    .warehouse-row-shortage td { background: #fffaf5; }
    .warehouse-row-ready td { background: #fbfffd; }
    .compact-flow-table { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
    .compact-flow-table table { min-width: 820px; }
    .warehouse-product-table,
    .warehouse-production-product-table,
    .warehouse-material-stock-table { min-width: 880px; }
    .warehouse-production-product-table { min-width: 1040px; }
    .warehouse-material-stock-table { min-width: 1040px; }
    .warehouse-product-table .col-index,
    .warehouse-production-product-table .col-index,
    .warehouse-material-table .col-index,
    .warehouse-material-stock-table .col-index { width: 52px; }
    .warehouse-product-table .col-product-code,
    .warehouse-production-product-table .col-product-code,
    .warehouse-material-table .col-material-code,
    .warehouse-material-stock-table .col-material-code { width: 160px; }
    .warehouse-product-table .col-product-name,
    .warehouse-production-product-table .col-product-name { width: 280px; }
    .warehouse-product-table .col-unit,
    .warehouse-production-product-table .col-unit,
    .warehouse-material-stock-table .col-unit,
    .warehouse-material-table .col-unit { width: 90px; }
    .warehouse-product-table .col-quantity,
    .warehouse-production-product-table .col-quantity,
    .warehouse-material-table .col-stock,
    .warehouse-material-stock-table .col-stock { width: 130px; }
    .warehouse-production-product-table .col-product-category { width: 180px; }
    .warehouse-production-product-table .col-actions { width: 130px; }
    /* Kho thành phẩm dùng trọn chiều rộng theo một nhịp cột ổn định (tổng 100%).
       Mã/tên được ưu tiên; các cột dữ liệu ngắn cân đều và không tạo khoảng rỗng lớn. */
    .warehouse-production-product-table .col-index { width: 5%; }
    .warehouse-production-product-table .col-product-code { width: 20%; }
    .warehouse-production-product-table .col-product-name { width: 31%; }
    .warehouse-production-product-table .col-unit { width: 9%; }
    .warehouse-production-product-table .col-quantity { width: 11%; }
    .warehouse-production-product-table .col-product-category { width: 14%; }
    .warehouse-production-product-table .col-actions { width: 10%; }
    .warehouse-production-product-table th,
    .warehouse-production-product-table td { padding-right: 14px; padding-left: 14px; }
    .warehouse-production-product-table th:nth-child(4),
    .warehouse-production-product-table td:nth-child(4),
    .warehouse-production-product-table th:nth-child(6),
    .warehouse-production-product-table td:nth-child(6),
    .warehouse-production-product-table th:nth-child(7),
    .warehouse-production-product-table td:nth-child(7) { text-align: center; }
    .warehouse-production-product-table th:nth-child(5),
    .warehouse-production-product-table td:nth-child(5) { padding-right: 22px; text-align: right; }
    .warehouse-production-product-table .warehouse-finished-stock-row { min-width: 84px; }
    /* Kho nguyên vật liệu dùng cùng nhịp với kho thành phẩm nhưng dành thêm
       không gian cho tên và phân loại vật tư thường dài. */
    .warehouse-material-stock-table .col-index { width: 5%; }
    .warehouse-material-stock-table .col-material-code { width: 16%; }
    .warehouse-material-stock-table .col-material-name { width: 31%; }
    .warehouse-material-stock-table .col-unit { width: 9%; }
    .warehouse-material-stock-table .col-stock { width: 11%; }
    .warehouse-material-stock-table .col-material-category { width: 18%; }
    .warehouse-material-stock-table .col-actions { width: 10%; }
    .warehouse-material-stock-table th,
    .warehouse-material-stock-table td { padding-right: 14px; padding-left: 14px; }
    .warehouse-material-stock-table th:nth-child(4),
    .warehouse-material-stock-table td:nth-child(4),
    .warehouse-material-stock-table th:nth-child(6),
    .warehouse-material-stock-table td:nth-child(6),
    .warehouse-material-stock-table th:nth-child(7),
    .warehouse-material-stock-table td:nth-child(7) { text-align: center; }
    .warehouse-material-stock-table th:nth-child(5),
    .warehouse-material-stock-table td:nth-child(5) { padding-right: 22px; text-align: right; }
    .warehouse-material-stock-table .warehouse-material-stock-row { min-width: 84px; }
    .warehouse-stock-editing td { background: #f4faf7; }
    .warehouse-stock-editing td:nth-child(5) { padding: 6px 10px; }
    .warehouse-stock-inline { display: grid; gap: 3px; min-width: 0; }
    .warehouse-stock-inline-input { width: 100%; min-width: 0; height: 32px; padding: 5px 8px; border: 1px solid #8eb9ad; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-weight: 800; text-align: right; }
    .warehouse-stock-inline-input:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 85, .12); }
    .warehouse-stock-inline-input.is-invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(174, 52, 52, .1); }
    .warehouse-stock-inline-status { overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 700; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
    .warehouse-stock-inline-status.error { color: var(--red); }
    .warehouse-stock-inline-actions { display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
    .warehouse-stock-inline-actions .btn { min-width: 0; padding: 5px 8px; }
    .warehouse-product-table .col-order-count,
    .warehouse-production-product-table .col-order-count { width: 100px; }
    .warehouse-production-product-table .col-order-name { width: 260px; }
    .warehouse-product-table .col-datetime,
    .warehouse-production-product-table .col-datetime { width: 170px; }
    .warehouse-material-table { min-width: 1360px; }
    .warehouse-material-table .col-material-name { width: 300px; }
    .warehouse-material-table .col-material-category { width: 190px; }
    .warehouse-material-table .col-order-name { width: 270px; }
    .warehouse-material-table .col-actions { width: 145px; }
    .warehouse-material-purchase-table.warehouse-material-table { min-width: 1300px; }
    .warehouse-material-purchase-table.warehouse-material-table .col-material-name { width: 340px; }
    .warehouse-material-purchase-table.warehouse-material-table .col-material-category { width: 110px; }
    .warehouse-material-purchase-table.warehouse-material-table thead th { padding: 10px 8px; font-size: 12px; }
    .warehouse-material-purchase-table.warehouse-material-table thead th::first-letter { text-transform: uppercase; }
    .warehouse-material-purchase-table.warehouse-material-table tbody td:nth-child(4),
    .warehouse-material-purchase-table.warehouse-material-table thead th:nth-child(4) { text-align: center; }
    .warehouse-po-table { min-width: 1190px; }
    .warehouse-po-table .col-index { width: 52px; }
    .warehouse-po-table .col-material-code { width: 150px; }
    .warehouse-po-table .col-material-name { width: 270px; }
    .warehouse-po-table .col-material-category { width: 150px; }
    .warehouse-po-table .col-quantity { width: 118px; }
    .warehouse-po-table .col-datetime { width: 150px; }
    .warehouse-po-table .col-file { width: 170px; }
    .warehouse-po-table .col-actions { width: 190px; }
    .warehouse-po-table th, .warehouse-po-table td { border: 1px solid #cfe0da; }
    .warehouse-po-table td.po-code-cell { text-align: left; }
    .warehouse-po-table .po-group-cell { background: #fbfdfc; vertical-align: middle; text-align: center; }
    .po-applied-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 10px; border-radius: 8px; color: #176b55; background: #e8f6ef; font-size: 12px; font-weight: 850; white-space: nowrap; }
    .warehouse-po-table .po-add-row td { background: #f5faf8; padding: 6px 8px; vertical-align: middle; }
    .warehouse-po-table .po-add-row input { width: 100%; padding: 6px 8px; }
    .warehouse-po-table .po-add-row .po-add-actions { text-align: left; white-space: nowrap; }
    .warehouse-po-table .po-add-row .po-add-actions .btn { margin-right: 6px; }
    .warehouse-finished-in-table { min-width: 860px; }
    .warehouse-finished-in-table .col-index { width: 52px; }
    .warehouse-finished-in-table .col-product-code { width: 180px; }
    .warehouse-finished-in-table .col-product-name { width: 300px; }
    .warehouse-finished-in-table .col-product-category { width: 150px; }
    .warehouse-finished-in-table .col-unit { width: 95px; }
    .warehouse-finished-in-table .col-quantity { width: 150px; }
    .production-panel { background: #fbfdfc; }
    .production-summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 10px 0 14px; }
    .production-summary-strip div { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 10px 12px; min-width: 0; }
    .production-summary-strip span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .production-summary-strip strong { display: block; margin-top: 4px; font-size: 22px; line-height: 1; color: var(--green); font-variant-numeric: tabular-nums; }
    .production-order-select-table { min-width: 970px; }
    .production-order-select-table .col-actions { width: 92px; }
    .production-order-select-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }
    .production-order-select-table .production-view-order { min-width: 58px; justify-content: center; }
    .production-plan-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 14px; align-items: start; }
    .production-plan-list { min-height: 140px; border: 1px solid var(--line); border-radius: 8px; overflow: auto; background: #fff; max-height: 620px; }
    .production-plan-item { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; padding: 10px 12px; cursor: pointer; }
    .production-plan-item:hover { background: #f8fbfa; }
    .production-plan-item:last-child { border-bottom: 0; }
    .production-plan-item strong,
    .production-plan-item span,
    .production-plan-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .production-plan-item span { margin-top: 3px; color: var(--text); font-size: 13px; }
    .production-plan-item small { margin-top: 3px; color: var(--muted); }
    .production-plan-item.active { background: #f0f8f5; box-shadow: inset 3px 0 0 var(--green); }
    .production-plan-item em { display: inline-block; margin-top: 6px; padding: 2px 7px; border-radius: 999px; background: #eef7f4; color: var(--green); font-size: 11px; font-style: normal; font-weight: 850; }
    .production-plan-item.has-shortage em { background: #fff1f2; color: #be123c; }
    .production-plan-item.is-ready em { background: #ecfdf5; color: #047857; }
    .production-plan-item.is-issued em { background: #f1f5f9; color: #64748b; }
    .production-plan-item.is-proposed em { background: #eef2ff; color: #4338ca; }
    /* Danh sách kế hoạch (gửi về / mua NVL): hiển thị ~8 dòng rồi cuộn. */
    #warehouseProductionPlanRows,
    #warehouseMaterialPurchasePlanRows { max-height: 760px; }
    .warehouse-plan-item-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
    .warehouse-plan-item-row:last-child { border-bottom: 0; }
    .warehouse-plan-item-row > .production-plan-item { flex: 1 1 auto; min-width: 0; border-bottom: 0; }
    .warehouse-plan-item-row.is-checkable { background: #fffaf5; }
    .warehouse-plan-check { display: flex; align-items: flex-start; padding: 12px 12px 0 4px; background: transparent; cursor: pointer; }
    .warehouse-plan-check input { width: 17px; height: 17px; accent-color: var(--red); cursor: pointer; }
    .warehouse-plan-delete { flex: 0 0 auto; align-self: center; margin: 0 8px; padding: 6px 8px; border: 1px solid #fecaca; border-radius: 8px; color: #b91c1c; background: #fff7f7; font-size: 11px; font-weight: 850; cursor: pointer; }
    .warehouse-plan-delete:hover { border-color: #fca5a5; background: #fee2e2; }
    .warehouse-plan-delete:disabled { opacity: .65; cursor: wait; }
    .catalog-bar-action { margin-left: auto; white-space: nowrap; }
    .warehouse-production-plan-layout { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
    .warehouse-plan-list-column { min-width: 0; display: grid; gap: 8px; }
    .warehouse-plan-list-label { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
    .production-plan-detail { min-width: 0; display: grid; gap: 12px; }
    .production-detail-section { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 12px; min-width: 0; }
    .production-plan-table { min-width: 1180px; }
    .production-output-table { min-width: 920px; }
    .production-work-table { min-width: 1900px; border-collapse: separate; border-spacing: 0; }
    .production-work-table th { text-align: center; vertical-align: middle; background: #e6f1ed; border-right: 1px solid #c6d8d3; border-bottom: 1px solid #c6d8d3; box-shadow: inset 0 1px 0 #c6d8d3; }
    .production-work-table thead tr:first-child th { top: 0; z-index: 12; height: 42px; }
    .production-work-table thead tr:nth-child(2) th { top: 42px; z-index: 11; height: 42px; background: #f1f8f5; }
    .production-work-table thead tr:nth-child(3) th { top: 84px; z-index: 10; background: #fbfdfc; color: #466a63; font-size: 12px; }
    .production-work-table thead th[rowspan="3"] { z-index: 13; }
    .production-work-table th:first-child,
    .production-work-table td:first-child { border-left: 1px solid #c6d8d3; }
    .production-work-table td { border-right: 1px solid #dbe7e4; border-bottom: 1px solid #dbe7e4; }
    .production-work-table tbody tr:hover td { background-color: #eef7f4; border-top-color: #b8d2ca; border-bottom-color: #b8d2ca; box-shadow: inset 0 1px 0 #b8d2ca, inset 0 -1px 0 #b8d2ca; }
    .production-work-table .stage-cnc { --stage-bg: #eaf4ff; --stage-soft: #f5faff; --stage-border: #8bbce8; --stage-text: #1d4f86; }
    .production-work-table .stage-bend { --stage-bg: #f1edff; --stage-soft: #faf8ff; --stage-border: #b7a5f3; --stage-text: #5b3ba6; }
    .production-work-table .stage-weld { --stage-bg: #fff3e4; --stage-soft: #fffaf3; --stage-border: #f0a45d; --stage-text: #9a4b12; }
    .production-work-table .stage-paint { --stage-bg: #eaf8ef; --stage-soft: #f6fcf8; --stage-border: #78c995; --stage-text: #1f6f3d; }
    .production-work-table .stage-mica { --stage-bg: #fff0f7; --stage-soft: #fff8fb; --stage-border: #e99bc3; --stage-text: #9b2f67; }
    .production-work-table .stage-material { --stage-bg: #edf7f8; --stage-soft: #f7fbfb; --stage-border: #7bbec3; --stage-text: #22666d; }
    .production-work-table .production-stage-head { background: var(--stage-bg) !important; color: var(--stage-text); font-weight: 900; }
    .production-work-table .production-stage-subhead { background: var(--stage-soft) !important; color: var(--stage-text); font-weight: 850; }
    .production-work-table .stage-group-start { border-left: 3px solid var(--stage-border) !important; }
    .production-work-table .production-stage-cell { text-align: center; background: var(--stage-soft); color: var(--green); font-weight: 900; }
    .production-work-table .production-stage-empty { background: repeating-linear-gradient(-45deg, #f8fbfa 0, #f8fbfa 6px, #f1f5f3 6px, #f1f5f3 12px); color: var(--muted); }
    .production-work-table .production-stage-output { text-align: right; border: 1px solid var(--stage-border); background: #fff; min-width: 72px; padding-inline: 6px; color: var(--stage-text); font-weight: 800; }
    .production-work-table .production-stage-output.is-filled { background: color-mix(in srgb, var(--stage-bg) 55%, #fff); box-shadow: inset 3px 0 0 var(--stage-border); }
    .production-work-table .production-stage-output:focus { border-color: var(--stage-border); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-border) 26%, transparent); }
    .production-work-table .production-stage-remaining { text-align: right; background: var(--stage-bg); font-variant-numeric: tabular-nums; font-weight: 900; color: var(--stage-text); }
    .production-work-table tbody tr:hover .production-stage-cell,
    .production-work-table tbody tr:hover .production-stage-remaining { background-color: color-mix(in srgb, var(--stage-bg) 82%, #fff); }
    .production-work-table tbody tr:hover .production-stage-empty { background: repeating-linear-gradient(-45deg, #edf3f1 0, #edf3f1 6px, #e3ebe8 6px, #e3ebe8 12px); }
    .production-work-table .production-stage-remaining.is-open { color: #9a3412; }
    .production-work-table .production-stage-remaining.is-done { background: #ecfdf5; color: #047857; text-align: center; }
    .production-work-table .production-warehouse-request { text-align: right; border: 1px solid var(--line); background: #fff; }
    @media (max-width: 980px) {
      .production-plan-layout { grid-template-columns: 1fr; }
      .production-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    @media (max-width: 980px) {
      .warehouse-io-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .order-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .warehouse-flow-grid { grid-template-columns: 1fr; }
    }
    .product-catalog-table { min-width: max(100%, 1282px); }
    .product-catalog-table .col-index { width: 52px; }
    .product-catalog-table .col-product-code { width: 160px; }
    .product-catalog-table .col-product-name { width: 220px; }
    .product-catalog-table .col-product-image { width: 220px; }
    .product-catalog-table .col-product-price { width: 140px; }
    .product-catalog-table .col-detail-code { width: 170px; }
    .product-catalog-table .col-detail-name { width: 220px; }
    .product-catalog-table .col-part-kind { width: 150px; }
    .product-catalog-table .col-quantity { width: 90px; }
    .product-catalog-table td.cell-detail_code { text-align: left; }
    .product-catalog-table td.cell-detail_name { text-align: left; }
    .product-catalog-table td.cell-quantity { text-align: right; }
    .detail-catalog-table { min-width: max(100%, 1992px); }
    .detail-catalog-table .col-index { width: 52px; }
    .detail-catalog-table .col-detail-code { width: 170px; }
    .detail-catalog-table .col-detail-name { width: 220px; }
    .detail-catalog-table .col-material { width: 260px; }
    .detail-catalog-table .col-measure { width: 90px; }
    .detail-catalog-table .col-norm { width: 170px; }
    .detail-catalog-table .col-quantity-per-unit { width: 190px; }
    .detail-catalog-table .col-category { width: 150px; }
    .detail-catalog-table .col-stock { width: 120px; }
    .detail-catalog-table th { text-align: center; }
    .detail-catalog-table .cell-stt,
    .detail-catalog-table .cell-detail_code,
    .detail-catalog-table .cell-category,
    .detail-catalog-table .cell-production_stage,
    .detail-catalog-table .cell-material_category { text-align: center; }
    .detail-catalog-table .cell-detail_name,
    .detail-catalog-table td.cell-material { text-align: left; }
    .detail-catalog-table .cell-length,
    .detail-catalog-table .cell-width,
    .detail-catalog-table .cell-kg,
    .detail-catalog-table .cell-pieces,
    .detail-catalog-table .cell-stock,
    .detail-catalog-table .cell-norm { text-align: right; }
    .detail-catalog-table .cell-quantity_per_unit { text-align: center; white-space: nowrap; }
    .detail-catalog-table .inline-input { text-align: inherit; }
    .material-catalog-table { min-width: max(100%, 1222px); }
    .material-catalog-table .col-index { width: 52px; }
    .material-catalog-table .col-material-code { width: 150px; }
    .material-catalog-table .col-material { width: 280px; }
    .material-catalog-table .col-unit { width: 110px; }
    .material-catalog-table .col-measure { width: 100px; }
    .material-catalog-table .col-stock { width: 120px; }
    .material-catalog-table .col-category { width: 150px; }
    .warnings { margin: 12px 0 0; padding: 10px 12px; border: 1px solid #efd6ae; border-radius: 10px; color: #805215; background: #fff8ec; font-size: 12px; }
    .warnings:empty { display: none; }
    .order-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 8px; margin-bottom: 12px; }
    .stat-pill { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 46px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; cursor: pointer; }
    .stat-pill:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(25, 64, 65, .08); }
    .stat-pill.active { border-color: var(--green); box-shadow: 0 0 0 2px #176b5524; }
    .stat-pill span { min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.2; font-weight: 850; }
    .stat-pill strong { color: var(--ink); font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; }
    .stat-draft { background: #f4f6f7; border-color: #dce3e6; }
    .stat-pending { background: #fff5dc; border-color: #efd08d; }
    .stat-production { background: #e4f4ff; border-color: #abd8ef; }
    .stat-production-done { background: #e5f6fb; border-color: #a9dce8; }
    .stat-storage { background: #efedff; border-color: #cbc8f4; }
    .stat-shipping { background: #e1f8f0; border-color: #aee5d5; }
    .stat-done { background: #e7f7e0; border-color: #b8dfaa; }
    .stat-due { background: #fff0e7; border-color: #f0b894; }
    .stat-shortage { background: #fff1df; border-color: #eead67; }
    .catalog-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
    .catalog-list-bar { flex-wrap: wrap; }
    .page-size-control { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 750; }
    .page-size-control select { min-width: 74px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
    .pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
    .page-btn { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-weight: 800; cursor: pointer; }
    .page-btn:hover { border-color: #aac4bc; }
    .page-btn.active { color: #fff; border-color: var(--green); background: var(--green); }
    .page-btn:disabled { cursor: not-allowed; opacity: .45; }
    .page-gap { min-width: 18px; color: var(--muted); text-align: center; font-weight: 800; }
    .page-jump { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 750; }
    .page-jump-input { width: 82px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-weight: 800; }
    .search { max-width: 440px; }
    .count { color: var(--muted); font-size: 13px; white-space: nowrap; }
    .muted-text { margin-top: 2px; color: var(--muted); font-size: 12px; }
    .user-table { min-width: 980px; }
    .ai-page-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 12px; padding: 22px 24px; overflow: hidden; border-radius: 18px; color: #fff; background: linear-gradient(120deg, #123f37, #1d7c61); box-shadow: 0 16px 36px rgba(18, 63, 55, .16); }
    .ai-page-hero::after { content: "AI"; position: absolute; right: 160px; top: -34px; color: rgba(255,255,255,.06); font-size: 120px; font-weight: 950; line-height: 1; pointer-events: none; }
    .ai-page-hero-copy { position: relative; z-index: 1; max-width: 760px; }
    .ai-page-hero h2 { margin-top: 3px; font-size: clamp(24px, 3vw, 34px); }
    .ai-page-hero p { margin: 7px 0 0; color: #d9eee8; }
    .ai-eyebrow { color: #aee3d4; font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
    .ai-refresh-button { position: relative; z-index: 1; flex: 0 0 auto; color: #174b3f; border-color: #fff; background: #fff; }
    .ai-learning-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 12px; align-items: center; margin-bottom: 12px; padding: 14px 18px; border: 1px solid #d4e3df; border-radius: 15px; background: #fff; }
    .ai-flow-step { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .ai-flow-step > span { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--green); font-size: 13px; font-weight: 900; }
    .ai-flow-step div { min-width: 0; display: grid; }
    .ai-flow-step strong { font-size: 13px; }
    .ai-flow-step small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
    .ai-flow-arrow { color: #8eb5aa; font-size: 22px; }
    .ai-data-stats { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
    .ai-stat-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #dbe5e3; border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(25, 64, 65, .05); }
    .ai-stat-card > div:last-child { min-width: 0; display: grid; }
    .ai-stat-card span { color: #536a6d; font-size: 11px; font-weight: 900; text-transform: uppercase; }
    .ai-stat-card strong { margin: 2px 0; color: var(--ink); font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
    .ai-stat-card small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
    .ai-stat-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; font-size: 18px; font-weight: 950; }
    .ai-stat-card.total .ai-stat-icon { color: #315e75; background: #e6f2f7; }
    .ai-stat-card.learned .ai-stat-icon { color: #176044; background: #e1f4ec; }
    .ai-stat-card.testing .ai-stat-icon { color: #805a10; background: #fff2cf; }
    .ai-stat-card.pending .ai-stat-icon { color: #8a4747; background: #fbe9e9; }
    .ai-embedding-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 12px; border-color: #cfe0dc; }
    .ai-embedding-health { display: flex; align-items: center; gap: 11px; min-width: 250px; }
    .ai-embedding-health > div { display: grid; }
    .ai-embedding-health small { color: var(--muted); }
    .ai-health-dot { width: 14px; height: 14px; flex: 0 0 auto; border: 4px solid #fff0ca; border-radius: 50%; background: #d28b16; box-shadow: 0 0 0 1px #e5c47d; }
    .ai-health-dot.ready { border-color: #dff3ea; background: #269269; box-shadow: 0 0 0 1px #93cdb7; }
    .ai-embedding-meta { display: grid; grid-template-columns: repeat(4, auto); gap: 12px 24px; }
    .ai-embedding-meta > div { display: grid; }
    .ai-embedding-meta span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
    .ai-embedding-meta strong { font-size: 12px; }
    .ai-embedding-meta b { color: var(--green); }
    .ai-list-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
    .ai-list-heading h3 { margin: 0; font-size: 18px; }
    .ai-list-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
    .ai-list-count { padding: 5px 9px; border-radius: 999px; color: #315e52; background: #e8f3ef; font-weight: 850; }
    .ai-data-list-card .catalog-bar { margin-bottom: 8px; }
    .ai-data-list-card .catalog-bar .search { flex: 1 1 420px; max-width: none; min-height: 42px; }
    .ai-data-list-card .catalog-bar select { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-weight: 750; }
    .ai-status-guide { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; padding: 9px 11px; border-radius: 10px; background: #f5f8f7; color: var(--muted); font-size: 10px; }
    .ai-status-guide span { display: inline-flex; align-items: center; gap: 4px; }
    .ai-status-guide i { width: 8px; height: 8px; border-radius: 50%; background: #a9b2b4; }
    .ai-status-guide i.training { background: #269269; }
    .ai-status-guide i.test { background: #d69a22; }
    .ai-drawing-list { display: grid; gap: 10px; }
    .ai-drawing-row { overflow: hidden; border: 1px solid #d6e3df; border-left: 4px solid #a9b2b4; border-radius: 13px; background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
    .ai-drawing-row:hover { box-shadow: 0 10px 26px rgba(25, 64, 65, .08); }
    .ai-drawing-row.training { border-left-color: #269269; }
    .ai-drawing-row.test { border-left-color: #d69a22; }
    .ai-drawing-summary { display: grid; grid-template-columns: 46px minmax(260px, 1.35fr) minmax(190px, .8fr) 86px minmax(185px, .75fr) auto; gap: 13px; align-items: center; padding: 14px; }
    .ai-file-icon { position: relative; width: 40px; height: 48px; display: grid; place-items: end center; padding-bottom: 7px; border-radius: 6px; color: #9a3030; background: #fff0f0; font-size: 9px; font-weight: 950; }
    .ai-file-icon::after { content: ""; position: absolute; right: 0; top: 0; border-left: 10px solid #edc4c4; border-bottom: 10px solid transparent; }
    .ai-file-copy { min-width: 0; display: grid; gap: 2px; }
    .ai-file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
    .ai-file-copy span, .ai-latest-update span, .ai-latest-update small { color: var(--muted); font-size: 10px; }
    .ai-status-block { min-width: 0; display: grid; justify-items: start; gap: 4px; }
    .ai-status-block small { overflow: hidden; max-width: 100%; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
    .ai-dataset-badge { padding: 4px 8px; border: 1px solid #d7dee1; border-radius: 999px; color: #58656a; background: #f3f5f6; font-size: 10px; font-weight: 850; white-space: nowrap; }
    .ai-dataset-badge.training { color: #176044; border-color: #acd8c7; background: #e4f5ee; }
    .ai-dataset-badge.test { color: #735312; border-color: #e6cd8e; background: #fff6dd; }
    .ai-data-count { display: grid; justify-items: center; padding: 7px; border-left: 1px solid #e4ebe9; border-right: 1px solid #e4ebe9; }
    .ai-data-count strong { color: var(--green); font-size: 20px; line-height: 1; }
    .ai-data-count span { color: var(--muted); font-size: 9px; white-space: nowrap; }
    .ai-latest-update { min-width: 0; display: grid; }
    .ai-latest-update strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
    .ai-card-details { border-top: 1px solid #e2ebe8; background: #f8fbfa; }
    .ai-card-details > summary { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 12px; color: #315e52; font-size: 11px; font-weight: 850; cursor: pointer; list-style: none; }
    .ai-card-details > summary::-webkit-details-marker { display: none; }
    .ai-card-details > summary::after { content: "⌄"; transition: transform .16s ease; }
    .ai-card-details[open] > summary::after { transform: rotate(180deg); }
    .ai-card-details > summary b { color: var(--muted); font-size: 10px; }
    .ai-drawing-detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .7fr); gap: 14px; padding: 14px; border-top: 1px solid #e2ebe8; }
    .ai-drawing-detail h3 { margin: 0; font-size: 13px; }
    .ai-detail-hint { margin: 2px 0 9px; color: var(--muted); font-size: 10px; }
    .ai-learning-items { display: grid; grid-template-columns: repeat(2, minmax(250px, 1fr)); gap: 7px; }
    .ai-learning-item { min-width: 0; display: flex; gap: 9px; padding: 8px 9px; border: 1px solid #dce7e4; border-radius: 9px; background: #fff; }
    .ai-learning-item code { align-self: start; padding: 2px 5px; border-radius: 5px; color: #185844; background: #e3f2ed; font-size: 10px; font-weight: 850; white-space: nowrap; }
    .ai-learning-item div { min-width: 0; display: grid; }
    .ai-learning-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
    .ai-learning-item span { color: var(--muted); font-size: 10px; }
    .ai-empty-state { display: grid; gap: 2px; padding: 14px; border: 1px dashed #c8d6d3; border-radius: 9px; color: #526a66; background: #fff; }
    .ai-empty-state span { color: var(--muted); font-size: 10px; }
    .ai-update-history { padding: 9px 10px; border: 1px solid #dce7e4; border-radius: 9px; background: #fff; }
    .ai-update-history summary { color: #315e52; font-size: 11px; font-weight: 850; cursor: pointer; }
    .ai-update-history > div { display: grid; gap: 6px; margin-top: 8px; }
    .ai-update-entry { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding-top: 6px; border-top: 1px solid #edf1f0; font-size: 10px; }
    .ai-update-entry strong { font-size: 11px; }
    .ai-update-entry span, .ai-update-entry small { color: var(--muted); }
    .ai-update-entry time { grid-column: 1; color: #315e52; }
    .ai-simple-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 10px; }
    .ai-simple-head p { margin: 3px 0 0; color: var(--muted); }
    .ai-quick-create { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 11px; border: 1px dashed #cfe0dc; border-radius: 10px; background: #f7faf9; }
    .ai-quick-create span { color: var(--muted); font-size: 11px; }
    .ai-quick-create .btn { flex: 0 0 auto; }
    .ai-compact-summary { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
    .ai-compact-summary > span { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 5px 9px; border: 1px solid #dce5e3; border-radius: 8px; color: #53686a; background: #fff; font-size: 11px; }
    .ai-compact-summary > span b { color: var(--ink); font-size: 13px; }
    .ai-compact-summary .learned { color: #176044; border-color: #b9ddcf; background: #edf8f4; }
    .ai-compact-summary .testing { color: #795710; border-color: #ead69d; background: #fff9e8; }
    .ai-compact-summary .pending { color: #874545; border-color: #eccaca; background: #fff4f4; }
    .ai-compact-summary .ai-system-state { margin-left: auto; }
    .ai-compact-summary .ai-health-dot { width: 10px; height: 10px; border-width: 3px; }
    .ai-review-workspace { min-height: 740px; display: grid; grid-template-columns: 292px minmax(0, 1fr); overflow: hidden; border: 1px solid #cfded9; border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
    .ai-drawing-sidebar { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); border-right: 1px solid #dbe5e2; background: #f7faf9; }
    .ai-sidebar-head { display: grid; gap: 8px; padding: 13px; border-bottom: 1px solid #dbe5e2; background: #fff; }
    .ai-sidebar-head > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .ai-sidebar-head .search { width: 100%; max-width: none; height: 38px; }
    .ai-sidebar-head select { width: 100%; height: 36px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; }
    .ai-drawing-sidebar .ai-drawing-list { min-height: 0; display: block; overflow-y: auto; padding: 7px; }
    .ai-drawing-option { position: relative; width: 100%; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 9px; align-items: center; margin-bottom: 5px; padding: 11px 9px; border: 1px solid transparent; border-radius: 9px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
    .ai-drawing-option:hover { background: #fff; }
    .ai-drawing-option.active { border-color: #9cc8ba; background: #fff; box-shadow: 0 5px 14px rgba(25, 64, 65, .08); }
    .ai-option-dot { width: 7px; height: 7px; border-radius: 50%; background: #a9b2b4; }
    .ai-drawing-option.training .ai-option-dot { background: #269269; }
    .ai-drawing-option.test .ai-option-dot { background: #d69a22; }
    .ai-option-copy { min-width: 0; display: grid; }
    .ai-option-copy strong { display: -webkit-box; overflow: hidden; font-size: 11px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
    .ai-option-copy small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
    .ai-option-count { min-width: 42px; display: grid; justify-items: center; padding-left: 7px; border-left: 1px solid #e1e8e6; }
    .ai-option-count b { color: var(--green); font-size: 14px; }
    .ai-option-count small { color: var(--muted); font-size: 8px; white-space: nowrap; }
    .ai-selected-drawing { min-width: 0; background: #edf2f0; }
    .ai-selected-content[hidden] { display: none !important; }
    .ai-selected-head { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 14px; border-bottom: 1px solid #d6e1de; background: #fff; }
    .ai-selected-head > div { min-width: 0; display: grid; justify-items: start; gap: 2px; }
    .ai-selected-head h3 { max-width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
    .ai-selected-head small { color: var(--muted); }
    .ai-side-by-side { height: 666px; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(280px, .95fr) minmax(300px, .95fr); gap: 8px; padding: 8px; }
    .ai-pdf-pane, .ai-text-pane, .ai-learned-pane { min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #d5e0dd; border-radius: 10px; background: #fff; }
    .ai-pdf-pane, .ai-text-pane { display: grid; grid-template-rows: 42px minmax(0, 1fr); }
    .ai-pane-title { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; border-bottom: 1px solid #dde6e3; background: #f8faf9; }
    .ai-pane-title > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
    .ai-pane-title span { color: var(--muted); font-size: 10px; }
    .ai-pane-title-actions { flex: 0 0 auto; width: auto !important; gap: 6px; }
    .ai-pane-title-actions .btn { padding: 3px 8px; font-size: 9px; }
    .ai-pdf-pane iframe { width: 100%; height: 100%; display: block; border: 0; background: #dfe5e3; }
    .ai-extracted-text { overflow-y: auto; padding: 10px 12px; color: var(--ink); font-size: 11px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
    .ai-extracted-text mark { padding: 0 2px; border-radius: 3px; color: #123f37; background: #ffe27a; }
    .ai-extracted-text .muted-text { color: var(--muted); }
    .ai-side-by-side.ai-text-collapsed .ai-text-pane { display: none; }
    .ai-side-by-side.ai-text-collapsed { grid-template-columns: minmax(0, 1.3fr) minmax(300px, .95fr); }
    .ai-learned-pane { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto auto; }
    .ai-selected-updater { display: grid; padding: 10px 11px; border-bottom: 1px solid #e2e9e7; background: #f1f8f5; }
    .ai-selected-updater span, .ai-selected-updater small { color: var(--muted); font-size: 9px; }
    .ai-selected-updater strong { font-size: 11px; }
    .ai-learning-editor { display: grid; grid-template-columns: minmax(0, 1fr) 72px auto; gap: 6px; padding: 8px; border-bottom: 1px solid #e2e9e7; }
    .ai-learning-editor input { min-width: 0; height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 10px; }
    .ai-learning-editor .btn { padding: 5px 8px; white-space: nowrap; }
    .ai-selected-items { min-height: 0; overflow-y: auto; padding: 8px; }
    .ai-learning-table-head { display: grid; grid-template-columns: minmax(0, 1fr) 72px 34px; gap: 8px; padding: 4px 8px; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
    .ai-selected-item { padding: 9px 8px; border-top: 1px solid #e7edeb; }
    .ai-selected-item-main { display: grid; grid-template-columns: minmax(0, 1fr) 72px 34px; gap: 8px; align-items: center; }
    .ai-selected-item code { overflow-wrap: anywhere; color: #176044; font-size: 9px; font-weight: 850; }
    .ai-selected-item-main > div { min-width: 0; display: grid; }
    .ai-selected-item strong { margin-top: 2px; font-size: 10px; line-height: 1.3; }
    .ai-confidence-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 8px; font-weight: 900; text-transform: uppercase; }
    .ai-confidence-badge.high { color: #176044; background: #e1f4ec; }
    .ai-confidence-badge.medium { color: #805a10; background: #fff2cf; }
    .ai-confidence-badge.low { color: #8a4747; background: #fbe9e9; }
    .ai-selected-item-evidence { margin-top: 6px; padding: 6px 8px; border-radius: 7px; color: var(--muted); background: #f7faf9; font-size: 9px; line-height: 1.5; }
    .ai-selected-item-evidence b { color: var(--ink); font-weight: 850; }
    .ai-learning-quantity { width: 72px; height: 31px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 10px; }
    .ai-learning-delete { padding: 4px 0; border: 0; color: #a93434; background: transparent; font-size: 9px; font-weight: 850; cursor: pointer; }
    .ai-learning-delete:hover { text-decoration: underline; }
    .ai-learning-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; border-top: 1px solid #dce6e3; background: #f8faf9; }
    .ai-learning-actions span { color: var(--muted); font-size: 9px; }
    .ai-learning-actions > div { display: flex; gap: 6px; }
    .ai-learning-actions .btn { flex: 0 0 auto; padding: 6px 9px; }
    .ai-embed-button { color: #315e52; border-color: #9fc7bb; background: #edf8f4; }
    .ai-load-more-hint { padding: 10px; color: var(--muted); font-size: 9px; text-align: center; }
    .ai-learned-pane > .ai-update-history { margin: 8px; max-height: 240px; overflow-y: auto; }
    .ai-history-version { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 3px; border: 0; border-top: 1px solid #e3ebe8; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
    .ai-history-version:first-child { border-top: 0; }
    .ai-history-version:hover { background: #f1f8f5; }
    .ai-history-version > span { min-width: 0; display: grid; }
    .ai-history-version > span strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
    .ai-history-version time { color: var(--muted); font-size: 9px; }
    .ai-history-version > b { padding: 2px 5px; border-radius: 999px; color: #315e52; background: #e8f3ef; font-size: 9px; white-space: nowrap; }
    .ai-history-version > i { color: var(--green); font-style: normal; font-weight: 900; }
    .avatar-col { width: 88px; text-align: center; vertical-align: middle; }
    .person-cell { display: flex; align-items: center; gap: 9px; min-width: 170px; }
    .person-avatar { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; object-fit: cover; border: 1px solid #d9e3e4; background: #fff; }
    .person-avatar.large { width: 46px; height: 46px; border-radius: 14px; box-shadow: 0 8px 18px rgba(25, 64, 65, .1); }
    .avatar-field { align-self: end; }
    .avatar-picker { display: flex; align-items: center; gap: 12px; min-height: 54px; }
    .avatar-picker img, .account-info-avatar { width: 54px; height: 54px; flex: 0 0 auto; border-radius: 14px; object-fit: cover; border: 1px solid #d4e1de; background: #fff; box-shadow: 0 8px 18px rgba(25, 64, 65, .1); }
    .avatar-file-input { display: block; width: 100%; max-width: 240px; padding: 7px 8px; border: 1px solid #d5e1df; border-radius: 8px; background: #fff; font-size: 12px; color: var(--text); }
    .avatar-status { margin-top: 4px; color: var(--muted); font-size: 12px; }
    .product-image-column { min-width: 220px; text-align: center; }
    .product-image-group-cell { width: 220px; padding: 10px !important; }
    .product-image-cell { width: 198px; display: grid; justify-items: stretch; gap: 7px; margin: auto; }
    .product-image-preview { position: relative; width: 198px; height: 158px; padding: 0; overflow: hidden; border: 1px solid #cbdad6; border-radius: 11px; background: #edf3f1; cursor: zoom-in; box-shadow: 0 5px 14px rgba(25, 64, 65, .1); }
    .product-image-preview:hover .product-image-thumb { transform: scale(1.05); }
    .product-image-thumb { width: 100%; height: 100%; display: block; object-fit: contain; background: #fff; transition: transform .2s ease; }
    .product-image-representative, .product-image-total { position: absolute; bottom: 7px; padding: 4px 7px; border-radius: 999px; color: #fff; background: rgba(18, 55, 48, .82); font-size: 10px; font-weight: 850; backdrop-filter: blur(3px); }
    .product-image-representative { left: 7px; }
    .product-image-total { right: 7px; }
    .product-image-empty { width: 198px; height: 158px; display: grid; place-items: center; align-content: center; gap: 4px; padding: 10px; border: 1px dashed #aac4bc; border-radius: 11px; color: #41645d; background: linear-gradient(145deg, #f9fbfa, #edf5f2); cursor: pointer; text-align: center; }
    .product-image-empty:hover { border-color: var(--green); background: #edf8f4; }
    .product-image-empty-icon { font-size: 28px; line-height: 1; color: var(--green); }
    .product-image-empty strong { font-size: 12px; }
    .product-image-empty small { color: var(--muted); font-size: 10px; }
    .product-image-manage { width: 100%; }
    .product-price-column { min-width: 140px; text-align: center; }
    .product-group-cell { vertical-align: top !important; }
    .product-group-anchor { position: sticky; top: 44px; z-index: 1; padding-block: 3px; }
    .product-image-group-cell .product-group-anchor { display: grid; justify-items: center; }
    .product-add-image-cell { color: var(--muted); font-size: 12px; text-align: center; vertical-align: middle; }
    .product-image-dialog.open { width: min(1040px, calc(100vw - 28px)); max-height: 92vh; }
    .product-image-upload { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 10px 12px; border: 1px solid #d7e3e0; border-radius: 11px; background: #f7faf9; }
    .product-image-gallery { min-height: 250px; display: grid; gap: 14px; }
    .product-image-main { display: grid; place-items: center; gap: 0; min-height: 390px; padding: 14px; overflow: hidden; border: 1px solid #d2dfdc; border-radius: 14px; background: repeating-conic-gradient(#f2f6f5 0 25%, #fff 0 50%) 50% / 22px 22px; }
    .product-image-main > img { width: 100%; height: 360px; object-fit: contain; }
    .product-image-main-meta { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 12px; border: 1px solid #cfe0dc; border-radius: 10px; color: var(--ink); background: #f4f9f7; }
    .product-image-main-meta span { color: var(--green); font-size: 12px; font-weight: 850; }
    .product-image-strip { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 10px; overflow-x: auto; padding: 2px 2px 6px; }
    .product-image-card { position: relative; min-width: 110px; padding: 5px; border: 2px solid transparent; border-radius: 11px; background: #f2f6f5; }
    .product-image-card.selected { border-color: var(--green); box-shadow: 0 0 0 2px #176b5520; }
    .product-image-card.representative { background: #e9f6f1; }
    .product-image-select { position: relative; width: 100%; padding: 0; overflow: hidden; border: 0; border-radius: 7px; background: #fff; cursor: pointer; }
    .product-image-select img { width: 100%; height: 88px; display: block; object-fit: cover; }
    .product-image-select span, .product-image-select strong { position: absolute; padding: 3px 6px; border-radius: 999px; color: #fff; background: rgba(18, 55, 48, .82); font-size: 9px; }
    .product-image-select span { top: 5px; left: 5px; }
    .product-image-select strong { left: 5px; bottom: 5px; }
    .product-image-remove { width: 100%; margin-top: 5px; padding: 5px 7px; border: 0; border-radius: 7px; color: #9a2727; background: #fff0f0; font-weight: 800; cursor: pointer; }
    .product-image-remove:hover { color: #fff; background: #a93434; }
    .product-image-gallery-empty { display: grid; place-items: center; min-height: 250px; border: 1px dashed #aac4bc; border-radius: 14px; color: var(--muted); background: linear-gradient(145deg, #fafcfb, #edf5f2); }
    .material-catalog-table .col-material-image { width: 220px; }
    .material-image-cell { width: 198px; display: grid; justify-items: stretch; gap: 7px; margin: auto; }
    .material-image-preview { position: relative; width: 198px; height: 158px; padding: 0; overflow: hidden; border: 1px solid #cbdad6; border-radius: 11px; background: #edf3f1; cursor: zoom-in; box-shadow: 0 5px 14px rgba(25, 64, 65, .1); }
    .material-image-preview:hover .material-image-thumb { transform: scale(1.05); }
    .material-image-thumb { width: 100%; height: 100%; display: block; object-fit: contain; background: #fff; transition: transform .2s ease; }
    .material-image-representative, .material-image-total { position: absolute; bottom: 7px; padding: 4px 7px; border-radius: 999px; color: #fff; background: rgba(18, 55, 48, .82); font-size: 10px; font-weight: 850; backdrop-filter: blur(3px); }
    .material-image-representative { left: 7px; }
    .material-image-total { right: 7px; }
    .material-image-empty { width: 198px; height: 158px; display: grid; place-items: center; align-content: center; gap: 4px; padding: 10px; border: 1px dashed #aac4bc; border-radius: 11px; color: #41645d; background: linear-gradient(145deg, #f9fbfa, #edf5f2); cursor: pointer; text-align: center; }
    .material-image-empty:hover { border-color: var(--green); background: #edf8f4; }
    .material-image-empty-icon { font-size: 28px; line-height: 1; color: var(--green); }
    .material-image-empty strong { font-size: 12px; }
    .material-image-empty small { color: var(--muted); font-size: 10px; }
    .material-image-manage { width: 100%; }
    .material-add-image-cell { color: var(--muted); font-size: 12px; text-align: center; vertical-align: middle; }
    .material-image-dialog.open { width: min(1040px, calc(100vw - 28px)); max-height: 92vh; }
    .material-image-upload { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 10px 12px; border: 1px solid #d7e3e0; border-radius: 11px; background: #f7faf9; }
    .material-image-gallery { min-height: 250px; display: grid; gap: 14px; }
    .material-image-main { display: grid; place-items: center; gap: 0; min-height: 390px; padding: 14px; overflow: hidden; border: 1px solid #d2dfdc; border-radius: 14px; background: repeating-conic-gradient(#f2f6f5 0 25%, #fff 0 50%) 50% / 22px 22px; }
    .material-image-main > img { width: 100%; height: 360px; object-fit: contain; }
    .material-image-main-meta { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 12px; border: 1px solid #cfe0dc; border-radius: 10px; color: var(--ink); background: #f4f9f7; }
    .material-image-main-meta span { color: var(--green); font-size: 12px; font-weight: 850; }
    .material-image-strip { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 10px; overflow-x: auto; padding: 2px 2px 6px; }
    .material-image-card { position: relative; min-width: 110px; padding: 5px; border: 2px solid transparent; border-radius: 11px; background: #f2f6f5; }
    .material-image-card.selected { border-color: var(--green); box-shadow: 0 0 0 2px #176b5520; }
    .material-image-card.representative { background: #e9f6f1; }
    .material-image-select { position: relative; width: 100%; padding: 0; overflow: hidden; border: 0; border-radius: 7px; background: #fff; cursor: pointer; }
    .material-image-select img { width: 100%; height: 88px; display: block; object-fit: cover; }
    .material-image-select span, .material-image-select strong { position: absolute; padding: 3px 6px; border-radius: 999px; color: #fff; background: rgba(18, 55, 48, .82); font-size: 9px; }
    .material-image-select span { top: 5px; left: 5px; }
    .material-image-select strong { left: 5px; bottom: 5px; }
    .material-image-remove { width: 100%; margin-top: 5px; padding: 5px 7px; border: 0; border-radius: 7px; color: #9a2727; background: #fff0f0; font-weight: 800; cursor: pointer; }
    .material-image-remove:hover { color: #fff; background: #a93434; }
    .material-image-gallery-empty { display: grid; place-items: center; min-height: 250px; border: 1px dashed #aac4bc; border-radius: 14px; color: var(--muted); background: linear-gradient(145deg, #fafcfb, #edf5f2); }
    .detail-catalog-table .col-detail-image { width: 220px; }
    .detail-catalog-table .col-detail-price { width: 140px; }
    .detail-catalog-table .col-detail-weight { width: 140px; }
    .detail-image-column { min-width: 220px; text-align: center; }
    .detail-price-column { min-width: 140px; text-align: center; }
    .detail-weight-column { min-width: 140px; text-align: center; }
    .detail-image-group-cell { width: 220px; padding: 10px !important; vertical-align: top !important; }
    .detail-image-cell { width: 198px; display: grid; justify-items: stretch; gap: 7px; margin: auto; }
    .detail-image-preview { position: relative; width: 198px; height: 158px; padding: 0; overflow: hidden; border: 1px solid #cbdad6; border-radius: 11px; background: #edf3f1; cursor: zoom-in; box-shadow: 0 5px 14px rgba(25, 64, 65, .1); }
    .detail-image-preview:hover .detail-image-thumb { transform: scale(1.05); }
    .detail-image-thumb { width: 100%; height: 100%; display: block; object-fit: contain; background: #fff; transition: transform .2s ease; }
    .detail-image-representative, .detail-image-total { position: absolute; bottom: 7px; padding: 4px 7px; border-radius: 999px; color: #fff; background: rgba(18, 55, 48, .82); font-size: 10px; font-weight: 850; backdrop-filter: blur(3px); }
    .detail-image-representative { left: 7px; }
    .detail-image-total { right: 7px; }
    .detail-image-empty { width: 198px; height: 158px; display: grid; place-items: center; align-content: center; gap: 4px; padding: 10px; border: 1px dashed #aac4bc; border-radius: 11px; color: #41645d; background: linear-gradient(145deg, #f9fbfa, #edf5f2); cursor: pointer; text-align: center; }
    .detail-image-empty:hover { border-color: var(--green); background: #edf8f4; }
    .detail-image-empty-icon { font-size: 28px; line-height: 1; color: var(--green); }
    .detail-image-empty strong { font-size: 12px; }
    .detail-image-empty small { color: var(--muted); font-size: 10px; }
    .detail-image-manage { width: 100%; }
    .detail-image-dialog.open { width: min(1040px, calc(100vw - 28px)); max-height: 92vh; }
    .detail-image-upload { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 10px 12px; border: 1px solid #d7e3e0; border-radius: 11px; background: #f7faf9; }
    .detail-image-gallery { min-height: 250px; display: grid; gap: 14px; }
    .detail-image-main { display: grid; place-items: center; gap: 0; min-height: 390px; padding: 14px; overflow: hidden; border: 1px solid #d2dfdc; border-radius: 14px; background: repeating-conic-gradient(#f2f6f5 0 25%, #fff 0 50%) 50% / 22px 22px; }
    .detail-image-main > img { width: 100%; height: 360px; object-fit: contain; }
    .detail-image-main-meta { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 12px; border: 1px solid #cfe0dc; border-radius: 10px; color: var(--ink); background: #f4f9f7; }
    .detail-image-main-meta span { color: var(--green); font-size: 12px; font-weight: 850; }
    .detail-image-strip { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 10px; overflow-x: auto; padding: 2px 2px 6px; }
    .detail-image-card { position: relative; min-width: 110px; padding: 5px; border: 2px solid transparent; border-radius: 11px; background: #f2f6f5; }
    .detail-image-card.selected { border-color: var(--green); box-shadow: 0 0 0 2px #176b5520; }
    .detail-image-card.representative { background: #e9f6f1; }
    .detail-image-select { position: relative; width: 100%; padding: 0; overflow: hidden; border: 0; border-radius: 7px; background: #fff; cursor: pointer; }
    .detail-image-select img { width: 100%; height: 88px; display: block; object-fit: cover; }
    .detail-image-select span, .detail-image-select strong { position: absolute; padding: 3px 6px; border-radius: 999px; color: #fff; background: rgba(18, 55, 48, .82); font-size: 9px; }
    .detail-image-select span { top: 5px; left: 5px; }
    .detail-image-select strong { left: 5px; bottom: 5px; }
    .detail-image-remove { width: 100%; margin-top: 5px; padding: 5px 7px; border: 0; border-radius: 7px; color: #9a2727; background: #fff0f0; font-weight: 800; cursor: pointer; }
    .detail-image-remove:hover { color: #fff; background: #a93434; }
    .detail-image-gallery-empty { display: grid; place-items: center; min-height: 250px; border: 1px dashed #aac4bc; border-radius: 14px; color: var(--muted); background: linear-gradient(145deg, #fafcfb, #edf5f2); }
    tr.row-missing-norm td { background: #ffe3e3; color: #9a2727; }
    tr.row-missing-norm td.group-cell { background: #ffe3e3 !important; }
    tr.row-missing-norm:hover td { background: #ffd0d0; }
    tr.row-missing-norm:hover td.group-cell { background: #ffd0d0 !important; }
    .progress-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 5px 9px; border-radius: 999px; border: 1px solid transparent; font-size: 12px; font-weight: 800; white-space: nowrap; }
    .progress-don-nhap { color: #555f68; background: #eef1f3; border-color: #d8dee4; }
    .progress-dang-cho-san-xuat { color: #8a5606; background: #fff3d7; border-color: #efd08d; }
    .progress-san-xuat { color: #0e5e86; background: #dff3ff; border-color: #abd8ef; }
    .progress-san-xuat-xong { color: #1d627c; background: #e5f6fb; border-color: #a9dce8; }
    .progress-luu-kho { color: #4f4a97; background: #ecebff; border-color: #cbc8f4; }
    .progress-du-hang { color: #047857; background: #ecfdf5; border-color: #9bd8bd; }
    .progress-thieu-hang { color: #b45309; background: #fff7ed; border-color: #fed7aa; }
    .progress-van-chuyen { color: #0a6a5b; background: #dff8ef; border-color: #aee5d5; }
    .progress-hoan-thanh-don { color: #1f6b35; background: #e4f7df; border-color: #b8dfaa; }
    .priority-badge { display: inline-grid; gap: 1px; min-width: 94px; padding: 5px 9px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; line-height: 1.15; font-weight: 850; text-align: left; white-space: nowrap; }
    .priority-badge small { font-size: 10px; font-weight: 800; opacity: .78; }
    .status-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 5px 9px; border-radius: 999px; border: 1px solid transparent; font-size: 12px; font-weight: 800; white-space: nowrap; }
    .status-active { color: #047857; background: #ecfdf5; border-color: #9bd8bd; }
    .status-locked { color: #6b7280; background: #f1f2f4; border-color: #d8dee4; }
    .permission-matrix-wrap { min-width: 0; }
    .permission-matrix-table { min-width: 980px; border-collapse: separate; border-spacing: 0; }
    .permission-matrix-table th { position: sticky; top: 0; z-index: 5; text-align: center; vertical-align: middle; background: #eaf3f0; border-right: 1px solid #ccdbd7; border-bottom: 1px solid #ccdbd7; padding: 10px 8px; font-size: 12px; }
    .permission-matrix-table th:first-child, .permission-matrix-table td:first-child { position: sticky; left: 0; z-index: 4; background: #f6f9f8; text-align: left; font-weight: 800; border-right: 1px solid #ccdbd7; min-width: 190px; }
    .permission-matrix-table th:first-child { z-index: 6; }
    .permission-matrix-table td { border-right: 1px solid #edf1f0; border-bottom: 1px solid #edf1f0; padding: 8px; text-align: center; vertical-align: middle; }
    .permission-matrix-table tr.permission-row-admin td:not(:first-child) { color: var(--muted); font-weight: 700; background: #f8fbfa; }
    .permission-select { min-width: 132px; }
    /* Toàn quyền = xanh lá, Chỉ xem = hổ phách, Không có quyền = xám — tô cả nút chọn lẫn
       từng lựa chọn trong menu xổ xuống để quét mắt nhanh trên ma trận nhiều cột/nhiều dòng. */
    .permission-select .single-select-toggle { font-size: 12px; padding: 6px 8px; font-weight: 700; border-width: 1px; }
    .permission-select-full .single-select-toggle { color: #047857; background: #e7f7f0; border-color: #b7e4cf; }
    .permission-select-view .single-select-toggle { color: #8a5606; background: #fdf1de; border-color: #f0d4a0; }
    .permission-select-none .single-select-toggle { color: #6b7280; background: #f1f3f4; border-color: #dfe3e6; }
    .permission-select-full .single-select-value { color: #047857; }
    .permission-select-view .single-select-value { color: #8a5606; }
    .permission-select-none .single-select-value { color: #6b7280; }
    .permission-select-menu .single-select-option.permission-level-full { color: #047857; }
    .permission-select-menu .single-select-option.permission-level-view { color: #8a5606; }
    .permission-select-menu .single-select-option.permission-level-none { color: #6b7280; }
    .permission-select-menu .single-select-option.permission-level-full:hover,
    .permission-select-menu .single-select-option.permission-level-full.active { background: #e7f7f0; }
    .permission-select-menu .single-select-option.permission-level-view:hover,
    .permission-select-menu .single-select-option.permission-level-view.active { background: #fdf1de; }
    .permission-select-menu .single-select-option.permission-level-none:hover,
    .permission-select-menu .single-select-option.permission-level-none.active { background: #f1f3f4; }
    .priority-uu-tien-1 { color: #8a1020; background: #ffe5e8; border-color: #f2a6af; }
    .priority-uu-tien-2 { color: #865006; background: #fff3cf; border-color: #e6c064; }
    .priority-uu-tien-3 { color: #315a46; background: #e9f6ef; border-color: #b9dec9; }
    .progress-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .shortage-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 5px 9px; border: 1px solid #e69a4b; border-radius: 999px; color: #8a4308; background: #fff0d8; font-size: 12px; font-weight: 850; white-space: nowrap; }
    .part-kind-badge { display: inline-flex; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #f3f5f6; font-size: 11px; font-weight: 800; white-space: nowrap; }
    .part-kind-badge.detail { color: var(--green-2); background: var(--mint); border-color: #b9dec9; }
    .part-kind-badge.material { color: #8a4308; background: #fff0d8; border-color: #e69a4b; }
    .modal-backdrop { position: fixed; inset: 0; z-index: 80; display: none; background: rgba(14, 43, 38, .42); backdrop-filter: blur(2px); }
    .modal-backdrop.open { display: block; }
    .action-dialog-backdrop { position: fixed; inset: 0; z-index: 180; display: none; background: rgba(10, 35, 31, .54); backdrop-filter: blur(4px); }
    .action-dialog-backdrop.open { display: block; animation: actionBackdropIn .16s ease-out; }
    .action-dialog { position: fixed; left: 50%; top: 50%; z-index: 190; width: min(490px, calc(100vw - 28px)); display: none; padding: 0; overflow: hidden; border: 1px solid #c8ddd7; border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 30px 90px rgba(7, 34, 30, .32); transform: translate(-50%, -50%); }
    .action-dialog.open { display: block; animation: actionDialogIn .18s ease-out; }
    .action-dialog-head { display: flex; align-items: center; gap: 13px; padding: 18px 20px 15px; border-bottom: 1px solid #dbe8e4; background: linear-gradient(135deg, #f5faf8, #eaf5f1); }
    .action-dialog-icon { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; color: #fff; background: var(--green); font-size: 23px; font-weight: 900; box-shadow: 0 8px 20px rgba(23, 107, 85, .2); }
    .action-dialog-eyebrow { display: block; margin-bottom: 2px; color: #52736b; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
    .action-dialog h3 { margin: 0; color: #173f36; font-size: 18px; line-height: 1.25; }
    .action-dialog-message { margin: 0; padding: 18px 20px 8px; color: #3f5853; font-size: 14px; line-height: 1.55; white-space: pre-line; }
    .action-dialog-input-wrap { display: grid; gap: 6px; margin: 8px 20px 4px; }
    .action-dialog-input-wrap[hidden] { display: none; }
    .action-dialog-input-wrap > span { color: #315e52; font-size: 11px; font-weight: 850; text-transform: uppercase; }
    .action-dialog-input-wrap input { width: 100%; padding: 11px 12px; border: 1px solid #bcd2cc; border-radius: 10px; color: var(--ink); background: #fff; outline: none; }
    .action-dialog-input-wrap input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 85, .12); }
    .action-dialog-input-wrap small { min-height: 16px; color: var(--muted); font-size: 11px; }
    .action-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 20px 19px; }
    .action-dialog-actions .btn { min-width: 92px; justify-content: center; }
    .action-dialog.tone-danger .action-dialog-head { border-bottom-color: #efd5d5; background: linear-gradient(135deg, #fffafa, #fceeee); }
    .action-dialog.tone-danger .action-dialog-icon { background: var(--red); box-shadow: 0 8px 20px rgba(184, 64, 64, .2); }
    .action-dialog.tone-danger #actionDialogConfirm { border-color: var(--red); background: var(--red); }
    .action-dialog.tone-danger #actionDialogConfirm:hover { border-color: #963333; background: #963333; }
    .action-dialog.tone-warning .action-dialog-head { border-bottom-color: #eadcbc; background: linear-gradient(135deg, #fffdf7, #fbf2df); }
    .action-dialog.tone-warning .action-dialog-icon { background: var(--amber); box-shadow: 0 8px 20px rgba(220, 139, 38, .2); }
    .action-dialog.shake { animation: actionDialogShake .22s ease-in-out; }
    @keyframes actionBackdropIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes actionDialogIn { from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
    @keyframes actionDialogShake { 0%, 100% { transform: translate(-50%, -50%); } 35% { transform: translate(calc(-50% - 5px), -50%); } 70% { transform: translate(calc(-50% + 5px), -50%); } }
    @media (max-width: 520px) {
      .action-dialog-head { align-items: flex-start; padding: 16px; }
      .action-dialog-message { padding: 16px 16px 7px; }
      .action-dialog-input-wrap { margin-inline: 16px; }
      .action-dialog-actions { padding: 14px 16px 17px; }
      .action-dialog-actions .btn { flex: 1; }
    }
    .add-card { display: none; padding: 18px; border: 1px solid #bcd4cd; border-radius: 16px; background: #fff; }
    .add-card.open { position: fixed; left: 50%; top: 50%; z-index: 90; display: block; width: min(920px, calc(100vw - 28px)); max-height: min(86vh, 720px); overflow: auto; transform: translate(-50%, -50%); box-shadow: 0 28px 70px rgba(20, 55, 52, .24); animation: modalIn .16s ease-out; }
    .add-card h3 { margin: 0 0 12px; font-size: 16px; }
    .export-dialog.open { width: min(460px, calc(100vw - 28px)); }
    .export-dialog .form-grid { grid-template-columns: 1fr; }
    .save-order-dialog.open { width: min(920px, calc(100vw - 28px)); }
    .save-order-sections { display: grid; gap: 12px; }
    .save-order-section { padding: 12px; border: 1px solid #d7e7e2; border-radius: 12px; background: #f8fbfa; }
    .save-order-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
    .save-order-section-head h4 { margin: 0; color: #173f36; font-size: 14px; line-height: 1.2; }
    .save-order-section-head span { color: var(--muted); font-size: 12px; line-height: 1.35; text-align: right; }
    .user-dialog.open { width: min(720px, calc(100vw - 28px)); }
    .account-info-dialog.open, .forgot-password-dialog.open { width: min(640px, calc(100vw - 28px)); }
    @keyframes modalIn { from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)) scale(.985); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
    .form-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 10px; }
    .form-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
    .form-field.span-2 { grid-column: span 2; }
    .form-field input.input-compact, .inline-input.input-compact { width: auto; max-width: 100px; }
    .form-field label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
    .form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
    .product-builder-dialog.open { width: min(1020px, calc(100vw - 28px)); max-height: min(90vh, 820px); padding: 0; overflow-x: hidden; overflow-y: auto; }
    .product-builder-heading { display: flex; align-items: center; gap: 13px; padding: 18px 20px 15px; border-bottom: 1px solid #dce9e5; background: linear-gradient(135deg, #f7fbf9, #eef7f3); }
    .product-builder-heading h3 { margin: 0 0 3px; color: #173f36; font-size: 18px; }
    .product-builder-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
    .product-builder-icon { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--green); font-size: 24px; box-shadow: 0 7px 18px rgba(28, 107, 84, .2); }
    .product-builder-info { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(300px, 1.7fr); gap: 12px; padding: 16px 20px; }
    .product-builder-images { margin: 0 20px 14px; overflow: hidden; border: 1px solid #cfe0da; border-radius: 12px; background: #fbfdfc; }
    .product-builder-images-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #dbe8e4; background: #f1f8f5; }
    .product-builder-images-head > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
    .product-builder-images-head strong { color: #214d45; font-size: 13px; text-transform: uppercase; }
    .product-builder-images-head span { padding: 3px 8px; border-radius: 999px; color: #2f6d5b; background: #dceee7; font-size: 11px; font-weight: 850; white-space: nowrap; }
    .product-builder-image-add { flex: 0 0 auto; border-style: dashed; color: var(--green); background: #fff; cursor: pointer; }
    .product-builder-image-gallery { min-height: 84px; display: flex; align-items: stretch; gap: 9px; padding: 10px 12px; overflow-x: auto; }
    .product-builder-image-empty { width: 100%; min-height: 64px; display: grid; place-items: center; border: 1px dashed #aac4bc; border-radius: 9px; color: var(--muted); background: linear-gradient(145deg, #fafcfb, #edf5f2); font-size: 12px; }
    .product-builder-image-card { position: relative; flex: 0 0 126px; padding: 4px; border: 2px solid transparent; border-radius: 10px; background: #edf3f1; }
    .product-builder-image-card.representative { border-color: var(--green); background: #e5f4ee; box-shadow: 0 0 0 2px rgba(23, 107, 85, .1); }
    .product-builder-image-select { position: relative; width: 100%; height: 76px; display: block; padding: 0; overflow: hidden; border: 0; border-radius: 7px; background: #fff; cursor: pointer; }
    .product-builder-image-select img { width: 100%; height: 100%; display: block; object-fit: cover; }
    .product-builder-image-select span { position: absolute; right: 5px; bottom: 5px; padding: 3px 6px; border-radius: 999px; color: #fff; background: rgba(18, 55, 48, .82); font-size: 9px; font-weight: 850; }
    .product-builder-image-remove { width: 100%; margin-top: 4px; padding: 4px 6px; border: 0; border-radius: 7px; color: #9a2727; background: #fff0f0; font-size: 11px; font-weight: 800; cursor: pointer; }
    .product-builder-image-remove:hover { color: #fff; background: #a93434; }
    .product-builder-image-hint { margin: 0; padding: 0 12px 9px; color: var(--muted); font-size: 11px; }
    .product-components-editor { margin: 0 20px; border: 1px solid #cfe0da; border-radius: 12px; background: #fbfdfc; overflow: hidden; }
    .product-components-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-bottom: 1px solid #dbe8e4; background: #f1f8f5; }
    .product-components-head > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
    .product-components-head strong { color: #214d45; font-size: 13px; text-transform: uppercase; }
    .product-components-head span { padding: 3px 8px; border-radius: 999px; color: #2f6d5b; background: #dceee7; font-size: 11px; font-weight: 850; white-space: nowrap; }
    .product-component-add { flex: 0 0 auto; border-style: dashed; color: var(--green); background: #fff; }
    .product-components-wrap { max-height: 360px; overflow: auto; }
    .product-components-table { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: fixed; }
    .product-components-table .component-index { width: 54px; }
    .product-components-table .component-code { width: 210px; }
    .product-components-table .component-name { width: auto; }
    .product-components-table .component-quantity { width: 120px; }
    .product-components-table .component-remove { width: 54px; }
    .product-components-table th { position: sticky; top: 0; z-index: 1; padding: 9px 8px; color: #335b55; background: #e7f1ed; border-bottom: 1px solid #cbded8; font-size: 12px; text-align: left; white-space: nowrap; }
    .product-components-table td { padding: 6px; border-bottom: 1px solid #e8efec; vertical-align: middle; }
    .product-components-table tr:last-child td { border-bottom: 0; }
    .product-components-table td:first-child { color: var(--muted); font-size: 12px; font-weight: 800; text-align: center; }
    .product-components-table input { width: 100%; padding: 8px 9px; }
    .product-components-table .product-component-quantity { text-align: right; }
    .product-component-remove { width: 32px; height: 32px; display: grid; place-items: center; margin: 0 auto; padding: 0; border: 1px solid #efc6c6; border-radius: 8px; color: var(--red); background: #fff7f7; font-size: 17px; cursor: pointer; }
    .product-component-remove:hover { border-color: #dfa7a7; background: #fdeaea; }
    .product-components-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-top: 1px solid #e1ebe8; background: #fff; }
    .product-components-hint { margin: 0; color: var(--muted); font-size: 12px; }
    .product-builder-actions { margin: 0; padding: 15px 20px 18px; }
    .detail-classification-editor { margin-bottom: 14px; }
    .detail-builder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; }
    .detail-builder-rows-wrap { max-height: 360px; }
    .detail-builder-rows-table { min-width: 1215px; }
    .detail-builder-rows-table .detail-row-index { width: 48px; }
    .detail-builder-rows-table .detail-row-material { width: 230px; }
    .detail-builder-rows-table .detail-row-category { width: 160px; }
    .detail-builder-rows-table .detail-row-measure { width: 86px; }
    .detail-builder-rows-table .detail-row-pieces { width: 78px; }
    .detail-builder-rows-table .detail-row-yield { width: 155px; }
    .detail-builder-rows-table .detail-row-norm { width: 160px; }
    .detail-builder-rows-table .detail-row-remove { width: 52px; }
    .detail-builder-rows-table select { width: 100%; min-height: 36px; padding: 8px 9px; border: 1px solid #cbd9d7; border-radius: 9px; color: var(--ink); background: #fff; font: inherit; }
    .detail-builder-rows-table input[type="number"] { text-align: right; }
    .detail-builder-rows-table .detail-builder-norm { color: #155c4a; background: #eaf7f1; font-weight: 900; }
    .material-builder-dialog.open { width: min(900px, calc(100vw - 28px)); max-height: min(90vh, 760px); }
    .material-builder-icon { background: linear-gradient(145deg, #176b55, #2d8b72); }
    .material-builder-info { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(250px, 1.35fr) minmax(210px, 1fr); gap: 12px; padding: 16px 20px; }
    .material-builder-spec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px; }
    .material-spec-field { padding: 10px; border: 1px solid #e0eae7; border-radius: 10px; background: #f9fbfa; }
    .material-spec-field > small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.35; }
    .material-stock-field { border-color: #abd2c5; background: #eaf7f1; }
    .material-stock-field input { color: #155c4a; background: #fff; font-weight: 850; }
    .material-builder-note { display: flex; align-items: flex-start; gap: 9px; margin: 0 14px 14px; padding: 10px 12px; border: 1px dashed #adcfc5; border-radius: 10px; color: #315c52; background: #f3faf7; }
    .material-builder-note > span { flex: 0 0 auto; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: #377d6a; font-size: 12px; font-weight: 900; }
    .material-builder-note p { margin: 2px 0 0; font-size: 11px; line-height: 1.45; }
    @media (max-width: 680px) {
      .product-builder-dialog.open { width: calc(100vw - 18px); }
      .product-builder-heading { align-items: flex-start; padding: 14px; }
      .product-builder-heading p { font-size: 12px; }
      .product-builder-icon { width: 38px; height: 38px; font-size: 20px; }
      .product-builder-info { grid-template-columns: 1fr; padding: 13px 14px; }
      .product-builder-images { margin: 0 14px 12px; }
      .product-builder-images-head { align-items: flex-start; }
      .product-components-editor { margin: 0 14px; }
      .product-components-footer { align-items: flex-end; flex-direction: column; }
      .product-builder-actions { padding: 13px 14px 15px; }
      .detail-classification-editor { margin-bottom: 12px; }
      .detail-builder-grid { gap: 10px; padding: 12px; }
      .material-builder-info { grid-template-columns: 1fr; padding: 13px 14px; }
      .material-builder-spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
    }
    @media (max-width: 440px) {
      .detail-builder-grid { grid-template-columns: 1fr; }
      .material-builder-spec-grid { grid-template-columns: 1fr; }
      .product-builder-actions .btn { flex: 1; }
    }
    .po-dialog.open { width: min(760px, calc(100vw - 28px)); }
    .dispatch-document-dialog.open { width: min(860px, calc(100vw - 28px)); }
    .po-dialog-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 16px; }
    .po-dialog-icon { flex: 0 0 auto; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; background: var(--mint); font-size: 23px; }
    .po-dialog-head h3 { margin: 0; font-size: 17px; line-height: 1.25; }
    .po-dialog-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
    .po-dialog-body { display: grid; gap: 14px; }
    .po-dialog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .po-file-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin-bottom: 0; padding: 20px 16px; border: 2px dashed #b8d2ca; border-radius: 13px; background: #f7fbf9; text-align: center; text-transform: none; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
    .po-file-drop:hover { border-color: var(--green); background: #eef8f3; }
    .po-file-drop.has-file { border-style: solid; border-color: var(--green); background: #eaf6f0; }
    .po-file-drop-icon { font-size: 22px; line-height: 1; }
    .po-file-drop-text { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 13px; font-weight: 700; text-transform: none; }
    .po-file-drop input[type="file"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
    .dispatch-document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .dispatch-document-section { display: grid; gap: 12px; min-width: 0; padding: 12px; border: 1px solid #d8e5e1; border-radius: 12px; background: #f8fbfa; }
    .dispatch-document-title { color: #214d45; font-size: 13px; font-weight: 900; text-transform: uppercase; }
    .dispatch-document-status { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 12px; font-weight: 750; }
    .dispatch-document-dialog .po-file-drop { min-height: 112px; padding: 16px 12px; }
    .dispatch-document-dialog .po-file-drop-icon { min-width: 42px; padding: 5px 8px; border-radius: 999px; color: #fff; background: #2f6f63; font-size: 10px; font-weight: 900; text-transform: uppercase; }
    .po-items-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
    .po-items-title { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
    .po-items-wrap { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
    .po-items-table { width: 100%; min-width: 560px; border-collapse: collapse; }
    .po-items-table th { position: sticky; top: 0; z-index: 1; padding: 8px 8px; text-align: left; font-size: 12px; font-weight: 800; color: #335b55; background: #eaf3f0; border-bottom: 1px solid #ccdbd7; white-space: nowrap; }
    .po-items-table th.num { text-align: right; }
    .po-items-table td { padding: 5px 6px; border-bottom: 1px solid #eef1f0; vertical-align: middle; }
    .po-items-table tr:last-child td { border-bottom: 0; }
    .po-items-table input { padding: 7px 9px; }
    .po-items-table .po-item-qty { text-align: right; }
    .po-col-code { width: 128px; } .po-col-cat { width: 128px; } .po-col-qty { width: 92px; } .po-col-x { width: 44px; }
    .po-item-remove { width: 30px; height: 30px; display: grid; place-items: center; margin: 0 auto; padding: 0; border: 1px solid #f0c9c9; border-radius: 8px; color: var(--red); background: #fff6f6; font-size: 13px; line-height: 1; cursor: pointer; }
    .po-item-remove:hover { background: #fdeaea; border-color: #e3aeae; }
    .po-add-item { margin-top: 10px; width: 100%; justify-content: center; border-style: dashed; color: var(--green); }
    .po-add-item:hover { border-color: var(--green); background: #eef8f3; }
    .multi-select { position: relative; }
    .multi-select-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid #cbd9d7; border-radius: 9px; padding: 9px 11px; color: var(--ink); background: #fff; text-align: left; font-weight: 500; cursor: pointer; }
    .multi-select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .multi-select-caret { flex: 0 0 auto; color: var(--muted); transition: transform .15s ease; }
    .multi-select.open .multi-select-caret { transform: rotate(180deg); }
    .multi-select-menu { z-index: 200; display: none; flex-direction: column; gap: 2px; min-width: 260px; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 18px 42px rgba(21, 63, 53, .18); }
    .multi-select-menu.open { display: flex; }
    .multi-select-option { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; font-weight: 500; cursor: pointer; }
    .multi-select-option:hover { background: var(--mint); }
    .multi-select-option input { width: auto; flex: 0 0 auto; }
    .single-select { position: relative; }
    .single-select-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid #cbd9d7; border-radius: 9px; padding: 9px 11px; color: var(--ink); background: #fff; text-align: left; font-weight: 500; cursor: pointer; }
    .single-select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .single-select.open .multi-select-caret { transform: rotate(180deg); }
    .single-select-menu { z-index: 200; display: none; flex-direction: column; gap: 2px; min-width: 200px; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 18px 42px rgba(21, 63, 53, .18); }
    .single-select-menu.open { display: flex; }
    .single-select-option { display: block; width: 100%; padding: 7px 8px; border: 0; border-radius: 7px; background: none; color: var(--ink); font-weight: 500; font: inherit; text-align: left; cursor: pointer; }
    .single-select-option:hover { background: var(--mint); }
    .single-select-option.active { background: var(--green); color: #fff; }
    .error { position: fixed; right: 18px; bottom: 18px; z-index: 210; max-width: 430px; display: none; padding: 12px 15px; border-radius: 10px; color: white; background: var(--red); box-shadow: var(--shadow); }
    .error.show { display: block; }
    .error.success { background: var(--green); }
    .loading { opacity: .6; pointer-events: none; }
    @media (max-width: 1100px) {
      .drawing-ai-controls { grid-template-columns: minmax(300px, 1fr) auto; }
    }
    @media (max-width: 980px) {
      .hero-row { align-items: flex-start; flex-direction: column; }
      .hero-actions { width: 100%; justify-content: flex-start; }
      .account-menu { left: 0; right: auto; }
      .account-chip { max-width: 100%; }
      .ai-learning-flow { grid-template-columns: 1fr 1fr 1fr; }
      .ai-flow-arrow { display: none; }
      .ai-data-stats { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
      .ai-embedding-card { align-items: flex-start; flex-direction: column; }
      .ai-embedding-meta { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); }
      .ai-drawing-summary { grid-template-columns: 46px minmax(0, 1fr) 86px auto; }
      .ai-status-block { grid-column: 2; }
      .ai-data-count { grid-column: 3; grid-row: 1 / span 2; }
      .ai-latest-update { grid-column: 2; }
      .ai-drawing-summary > .btn { grid-column: 4; grid-row: 1 / span 2; }
      .ai-drawing-detail { grid-template-columns: 1fr; }
      .ai-review-workspace { grid-template-columns: 245px minmax(0, 1fr); }
      .ai-side-by-side { grid-template-columns: minmax(280px, 1fr) minmax(240px, .9fr) minmax(260px, .9fr); }
      .order-stats { grid-template-columns: repeat(3, minmax(136px, 1fr)); }
      .form-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
      .order-page-head { align-items: stretch; flex-direction: column; gap: 12px; }
      .order-toolbar { width: 100%; display: flex; flex-wrap: nowrap; gap: 7px; overflow-x: auto; padding: 1px 1px 5px; scrollbar-width: thin; overscroll-behavior-inline: contain; }
      .order-toolbar .btn { flex: 0 0 auto; min-height: 40px; padding: 7px 11px; font-size: 13px; line-height: 1.2; white-space: nowrap; }
      .order-section-nav { justify-content: stretch; }
      .order-section-menu { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .order-section-menu .btn { min-width: 0; white-space: normal; line-height: 1.25; }
      .drawing-ai-compare.has-preview.has-result { grid-template-columns: 1fr; }
      .drawing-preview-pane { position: static; }
      .drawing-manual-add { grid-template-columns: 1fr 110px; }
      .drawing-manual-add .btn { grid-column: 1 / -1; }
    }
    @media (max-width: 820px) {
      .ai-review-workspace { grid-template-columns: 1fr; }
      .ai-drawing-sidebar { max-height: 300px; border-right: 0; border-bottom: 1px solid #dbe5e2; }
      .ai-drawing-sidebar .ai-drawing-list { max-height: 180px; }
      .ai-side-by-side { height: auto; grid-template-columns: 1fr 1fr; }
      .ai-pdf-pane { grid-column: 1 / -1; height: 460px; }
      .ai-text-pane { height: 320px; }
      .ai-learned-pane { max-height: 640px; }
    }
    @media (max-width: 640px) {
      .ai-page-hero { align-items: flex-start; flex-direction: column; padding: 18px; }
      .ai-page-hero::after { right: -10px; }
      .ai-refresh-button { width: 100%; }
      .ai-learning-flow { grid-template-columns: 1fr; gap: 10px; }
      .ai-flow-step small { white-space: normal; }
      .ai-data-stats { grid-template-columns: repeat(2, 1fr); }
      .ai-stat-card { align-items: flex-start; padding: 12px; }
      .ai-stat-icon { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
      .ai-stat-card strong { font-size: 23px; }
      .ai-stat-card small { display: none; }
      .ai-embedding-card { align-items: flex-start; flex-direction: column; gap: 10px; }
      .ai-embedding-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .dispatch-document-grid { grid-template-columns: 1fr; }
      .ai-list-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
      .ai-status-guide { display: grid; gap: 5px; }
      .ai-drawing-summary { grid-template-columns: 38px minmax(0, 1fr) auto; }
      .ai-file-icon { width: 36px; height: 42px; }
      .ai-status-block { grid-column: 2 / -1; }
      .ai-data-count { grid-column: 3; grid-row: 1; border-right: 0; }
      .ai-latest-update { grid-column: 2 / -1; }
      .ai-drawing-summary > .btn { grid-column: 2 / -1; grid-row: auto; width: 100%; }
      .ai-learning-items { grid-template-columns: 1fr; }
      .ai-simple-head { align-items: stretch; flex-direction: column; }
      .ai-simple-head .btn { width: 100%; }
      .ai-quick-create .btn { flex: 1 1 auto; }
      .ai-compact-summary .ai-system-state { margin-left: 0; }
      .ai-review-workspace { min-height: 0; grid-template-columns: 1fr; overflow: visible; }
      .ai-drawing-sidebar { max-height: 310px; border-right: 0; border-bottom: 1px solid #dbe5e2; }
      .ai-drawing-sidebar .ai-drawing-list { max-height: 190px; }
      .ai-selected-head { align-items: stretch; flex-direction: column; }
      .ai-selected-head .btn { width: 100%; }
      .ai-side-by-side, .ai-side-by-side.ai-text-collapsed { height: auto; grid-template-columns: 1fr; }
      .ai-pdf-pane { grid-column: auto; height: 64vh; min-height: 460px; }
      .ai-text-pane { height: 320px; }
      .ai-learned-pane { max-height: 560px; }
      .ai-selected-items { max-height: 360px; }
      .hero { padding: 14px 16px; }
      .hero-row { align-items: center; flex-direction: row; justify-content: space-between; gap: 10px; }
      .hero-actions { width: auto; justify-content: flex-end; }
      .brand { width: auto; gap: 10px; }
      .brand > div { min-width: 0; }
      .brand > div { display: none; }
      .logo { width: 38px; height: 38px; border-radius: 10px; }
      .account-chip { width: auto; max-width: min(260px, calc(100vw - 76px)); }
      .account-menu { left: auto; right: 0; width: min(280px, calc(100vw - 32px)); }
      main { margin-top: 16px; padding: 0 12px; }
      .tabs { padding: 0 7px; }
      .tab { padding: 13px 11px; font-size: 13px; }
      .section-head { align-items: start; flex-direction: column; }
      .card-pad { padding: 13px; }
      .order-stats { display: flex; gap: 7px; margin: -2px -13px 10px; padding: 0 13px 4px; overflow-x: auto; scrollbar-width: thin; }
      .stat-pill { grid-template-columns: auto auto; flex: 0 0 auto; min-width: 118px; min-height: 38px; padding: 6px 8px; }
      .stat-pill span { font-size: 10px; }
      .stat-pill strong { font-size: 18px; }
      .excel-shell { margin-inline: -2px; }
      .toolbar { width: 100%; }
      .toolbar .btn { flex: 1; }
      .order-page-head { gap: 10px; margin-bottom: 12px; }
      .order-page-head h2 { font-size: 21px; }
      .order-toolbar { gap: 6px; margin-inline: -1px; padding-bottom: 5px; }
      .order-toolbar #openDrawingAi { grid-column: auto; }
      .order-toolbar .btn { width: auto; flex: 0 0 auto; min-height: 38px; padding: 7px 10px; font-size: 12px; }
      .order-section-nav { top: 48px; justify-content: stretch; margin-bottom: 12px; }
      .order-section-menu { width: 100%; display: flex; justify-content: flex-start; gap: 5px; padding: 6px; }
      .order-section-menu .btn { min-height: 42px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
      .order-workspace { grid-template-columns: 672px 618px 514px; gap: 10px; padding-inline: 0; }
      .order-card { border-radius: 12px; box-shadow: 0 10px 26px rgba(25, 64, 65, .08); }
      .order-card-title { padding: 8px 10px; font-size: 12px; }
      .order-entry-table { min-width: 670px; }
      .detail-result-table { min-width: 616px; }
      .material-result-table { min-width: 512px; }
      .order-entry-table .col-index, .detail-result-table .col-index, .material-result-table .col-index { width: 36px; }
      .order-entry-table .col-code { width: 148px; }
      .order-entry-table .col-name { width: 192px; }
      .order-entry-table .col-unit { width: 48px; }
      .order-entry-table .col-quantity { width: 64px; }
      .order-entry-table .col-category { width: 82px; }
      .order-entry-table .col-actions { width: 78px; }
      .detail-result-table .col-code { width: 126px; }
      .detail-result-table .col-name { width: 168px; }
      .detail-result-table .col-unit { width: 48px; }
      .detail-result-table .col-quantity { width: 66px; }
      .detail-result-table .col-category { width: 86px; }
      .material-result-table .col-material { width: 196px; }
      .material-result-table .col-unit { width: 64px; }
      .material-result-table .col-quantity, .material-result-table .col-stock { width: 68px; }
      .drawing-ai-card { border-radius: 14px; }
      .drawing-ai-controls { grid-template-columns: 1fr; }
      .drawing-file-control { grid-template-columns: 1fr; }
      .drawing-ai-control-actions { grid-column: auto; }
      .drawing-ai-head { align-items: center; }
      .drawing-ai-head, .drawing-ai-controls { padding-inline: 14px; }
      .drawing-ai-status { margin-inline: 14px; }
      .drawing-ai-compare { padding: 0 14px 14px; }
      .drawing-ai-control-actions { flex-direction: column; }
      .drawing-ai-compare.has-preview.has-result { grid-template-columns: 1fr; }
      .drawing-preview-pane { position: static; }
      .drawing-pane-head { align-items: flex-start; }
      .drawing-pane-head .btn { flex: 0 0 auto; }
      .drawing-preview-pane iframe { height: 68vh; min-height: 480px; }
      .drawing-manual-add { grid-template-columns: 1fr; }
      .drawing-ai-actions .btn { flex: 1 1 100%; }
      .form-grid { grid-template-columns: 1fr; }
      .form-grid.compact { grid-template-columns: 1fr; }
      .form-field.span-2 { grid-column: auto; }
      .save-order-section-head { align-items: flex-start; flex-direction: column; gap: 4px; }
      .save-order-section-head span { text-align: left; }
      .row-actions { flex-wrap: nowrap; gap: 5px; }
      .row-actions .btn.small { padding: 7px 8px; }
      .inline-input { min-width: 96px; padding: 8px 9px; font-size: 13px; }
      .inline-input.wide { min-width: 150px; }
      .stock-editor { min-width: 260px; }
      .order-table-actions .btn { flex: 1 1 220px; }
      .add-card.open { width: calc(100vw - 18px); max-height: 88vh; padding: 14px; }
      .product-image-main { min-height: 270px; padding: 8px; }
      .product-image-main > img { height: 250px; }
      .product-image-main-meta { margin-top: 8px; }
      .product-image-strip { grid-template-columns: repeat(5, 108px); }
      .product-image-upload { align-items: flex-start; flex-wrap: wrap; }
      .material-image-main { min-height: 270px; padding: 8px; }
      .material-image-main > img { height: 250px; }
      .material-image-main-meta { margin-top: 8px; }
      .material-image-strip { grid-template-columns: repeat(5, 108px); }
      .material-image-upload { align-items: flex-start; flex-wrap: wrap; }
    }
