/* ═══ Apple UI — lớp hoàn thiện cuối cùng (nạp sau mọi CSS khác) ═══ */

/* ── Menu tài khoản ── */
.profile-dropdown { top: 58px !important; left: 8px !important; right: 8px !important; width: auto !important; max-width: none !important; box-sizing: border-box; padding: 6px !important; border: 1px solid rgba(0,0,0,.06) !important; border-radius: 14px !important; background: rgba(255,255,255,.96) !important; box-shadow: 0 12px 40px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.06) !important; -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Be Vietnam Pro", Inter, sans-serif; animation: pm-in .16s ease-out; }
@keyframes pm-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.profile-dropdown .pm-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid #ececf0; }
.profile-dropdown .pm-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #0a84ff, #5e5ce6); color: #fff; font: 600 14px/1 -apple-system, Inter, sans-serif; letter-spacing: .02em; }
.profile-dropdown .pm-id { min-width: 0; display: grid; gap: 2px; }
.profile-dropdown .pm-id strong { color: #1d1d1f; font-size: 15px !important; font-weight: 600 !important; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
.profile-dropdown .pm-id small { margin: 0 !important; color: #86868b !important; font-size: 12.5px !important; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.profile-dropdown .pm-item { display: flex !important; align-items: center; gap: 10px; width: 100%; min-height: 36px; margin: 0 !important; padding: 0 10px !important; border: 0 !important; border-radius: 8px !important; background: transparent; color: #1d1d1f; font: 400 14px/1.2 -apple-system, BlinkMacSystemFont, "Be Vietnam Pro", Inter, sans-serif !important; text-align: left; cursor: pointer; }
.profile-dropdown .pm-item:hover { background: #f2f2f7 !important; }
.profile-dropdown .pm-item[hidden] { display: none !important; }
.profile-dropdown .pm-item svg { flex: 0 0 auto; width: 17px; height: 17px; fill: none; stroke: #6e6e73; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.profile-dropdown .pm-sep { height: 1px; margin: 4px 6px; border: 0; background: #ececf0; }
.profile-dropdown .pm-item.logout { color: #ff3b30 !important; }
.profile-dropdown .pm-item.logout svg { stroke: #ff3b30; }

/* ── Trang Cài đặt ── */
.st { max-width: 720px; margin: 0 auto; padding: 8px 4px 48px; color: #1d1d1f; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Be Vietnam Pro", Inter, sans-serif; }
.st-head h2 { margin: 6px 4px 18px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.st-group { margin-bottom: 26px; }
.st-group > h4 { margin: 0 16px 7px; color: #6e6e73; font-size: 12.5px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; }
.st-card { overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04); }
.st-foot { margin: 7px 16px 0; color: #86868b; font-size: 12.5px; }
.st-row { position: relative; display: flex !important; align-items: center; gap: 12px; width: 100%; min-height: 50px; margin: 0; padding: 9px 14px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; color: inherit; font: inherit; text-align: left; }
.st-row[hidden] { display: none !important; }
.st-row + .st-row::before { content: ""; position: absolute; top: 0; right: 0; left: 56px; height: 1px; background: #ececf0; }
.st-tap { cursor: pointer; }
.st-tap:hover { background: #f5f5f7 !important; }
.st-tap:active { background: #ececf0 !important; }
.st-ic { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; }
.st-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.st-blue { background: #0a84ff; } .st-indigo { background: #5e5ce6; } .st-gray { background: #8e8e93; } .st-orange { background: #ff9f0a; } .st-green { background: #30d158; } .st-red { background: #ff453a; } .st-teal { background: #40c8e0; }
.st-txt { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.st-txt b { font-size: 15px; font-weight: 500; line-height: 1.3; }
.st-txt small { color: #86868b; font-size: 12.5px; line-height: 1.35; }
.st-right { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; max-width: 46%; }
.st-right em { overflow: hidden; color: #86868b; font-size: 14px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.st-chev { width: 14px; height: 14px; fill: none; stroke: #c7c7cc; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.st-status.on { color: #248a3d !important; font-weight: 500; }
.st-status.off { color: #c93400 !important; font-weight: 500; }
.st-profile { display: flex; align-items: center; gap: 14px; padding: 16px; }
.st-avatar { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(135deg, #0a84ff, #5e5ce6); color: #fff; font-size: 21px; font-weight: 600; }
.st-profile .st-txt b { font-size: 19px; font-weight: 600; }
.st-profile .st-txt small { font-size: 13.5px; }
.st-seg { display: inline-flex; padding: 2px; border-radius: 9px; background: #e9e9ee; }
.st-seg-btn { min-height: 0 !important; height: 28px; padding: 0 12px !important; border: 0 !important; border-radius: 7px !important; background: transparent !important; color: #1d1d1f; font: 500 13px -apple-system, Inter, sans-serif !important; cursor: pointer; }
.st-seg-btn.on { background: #fff !important; box-shadow: 0 1px 3px rgba(0,0,0,.14), 0 0 0 .5px rgba(0,0,0,.04); font-weight: 600 !important; }
@media (max-width: 640px) {
  .st-head h2 { font-size: 26px; }
  .st-row { flex-wrap: wrap; }
  .st-right { max-width: 100%; }
  .st-row .st-seg { margin-left: 42px; }
}
/* Chế độ tối: ô màu (avatar, icon cài đặt) giữ đúng màu như ảnh */
html[data-theme="dark"] .pm-avatar, html[data-theme="dark"] .st-avatar, html[data-theme="dark"] .st-ic { filter: hue-rotate(180deg) url(#apple-dark-img); }
@media (max-width: 760px) { .st-head { display: none; } }

/* ═══════════ Lớp thiết kế Apple cho mọi trang trong #workspace (.ws-apple) ═══════════
   Một bộ chữ, một thang cỡ chữ, một kiểu nút / bảng / thẻ / ô nhập cho tất cả các menu.
   Chế độ tối dùng bộ lọc tone-map (theme.js) nên chỉ cần thiết kế đúng ở chế độ sáng. */
:root {
  --ap-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Be Vietnam Pro", Inter, "Segoe UI", sans-serif;
  --ap-ink: #1d1d1f; --ap-ink2: #424245; --ap-sub: #6e6e73; --ap-faint: #86868b;
  --ap-line: #e5e5ea; --ap-hair: #f0f0f3; --ap-card: #fff;
  --ap-blue: #0071e3; --ap-red: #d70015;
  --ap-r: 14px; --ap-r-sm: 9px;
  --ap-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.05);
}
#workspace.ws-apple { padding: 22px 28px 48px !important; color: var(--ap-ink); font-family: var(--ap-font) !important; font-size: 14px; line-height: 1.45; }
#workspace.ws-apple * { font-family: inherit; }
#workspace.ws-apple :is(input, select, textarea, button) { font-family: var(--ap-font) !important; }

/* Tiêu đề trang */
#workspace.ws-apple .workspace-head { display: flex !important; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 18px !important; padding: 0 !important; border: 0 !important; background: none !important; }
#workspace.ws-apple :is(.workspace-head h3, .listing-head h3, .extension-header h3) { margin: 0 auto 0 0 !important; color: var(--ap-ink) !important; font-size: 26px !important; font-weight: 700 !important; line-height: 1.2 !important; letter-spacing: -.02em !important; }
#workspace.ws-apple :is(.workspace-head h3, .listing-head h3, .extension-header h3) { flex: 1 1 auto; min-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#workspace.ws-apple h4 { color: var(--ap-ink); font-size: 15px; font-weight: 600; }
/* Tiêu đề thanh trên: 1 dòng, không bẻ dọc */
.topbar h1, main > header h1, h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Nút dạng link trong thẻ số liệu */
#workspace.ws-apple button.cost-link { min-height: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; color: var(--ap-blue) !important; font-size: 12.5px !important; font-weight: 500 !important; text-decoration: none; white-space: normal; }
#workspace.ws-apple button.cost-link:hover { background: none !important; text-decoration: underline; }
/* Thẻ số liệu báo cáo */
#workspace.ws-apple .report-metric { padding: 16px 18px !important; border: 0 !important; border-radius: var(--ap-r) !important; background: #fff !important; box-shadow: var(--ap-shadow) !important; }
#workspace.ws-apple .report-metric > small { color: var(--ap-sub) !important; font-size: 12.5px !important; font-weight: 500; }
#workspace.ws-apple .report-metric strong, #workspace.ws-apple .report-metric strong span { display: block; margin: 6px 0 4px; color: var(--ap-ink); font-size: 24px !important; font-weight: 700 !important; letter-spacing: -.02em; line-height: 1.15; }
#workspace.ws-apple .report-metric > span { color: var(--ap-faint); font-size: 12px; line-height: 1.4; }
/* Trang Reports tổng: thẻ lớn */
#workspace.ws-apple .report-intro { margin: 0 0 14px; color: var(--ap-sub); font-size: 14px; }
#workspace.ws-apple .report-links { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
#workspace.ws-apple .report-links > button { display: grid !important; align-content: start; justify-content: stretch !important; justify-items: start; text-align: left !important; gap: 4px; min-height: 92px !important; padding: 18px !important; border: 0 !important; border-radius: var(--ap-r) !important; background: #fff !important; box-shadow: var(--ap-shadow) !important; text-align: left; white-space: normal !important; }
#workspace.ws-apple .report-links > button:hover { box-shadow: 0 0 0 1px rgba(0,113,227,.35), 0 4px 14px rgba(0,0,0,.06) !important; }
#workspace.ws-apple .report-links > button b { font-size: 16px; font-weight: 600; }
#workspace.ws-apple .report-links > button span { color: var(--ap-faint); font-size: 13px; font-weight: 400; }
/* Nút nổi (ghi chú nhanh): góc phải dưới, phía trên nút lên đầu trang — không đè nút trên tiêu đề */
.floating { top: auto !important; right: 22px !important; bottom: 80px !important; width: 46px !important; height: 46px !important; box-shadow: 0 6px 18px rgba(237,121,30,.35) !important; }
#workspace.ws-apple :is(.muted, small) { color: var(--ap-faint); font-size: 12.5px; }

/* Nút */
#workspace.ws-apple button:not(.close):not(.qty-step):not(.cost-link):not([class*="lg-"]):not(.trk-copy):not(.copy-sku):not(.square):not(.st-row),
#workspace.ws-apple a.push {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 14px !important;
  border: 1px solid var(--ap-line) !important; border-radius: var(--ap-r-sm) !important; background: #fff !important; color: var(--ap-ink) !important;
  font-size: 13.5px !important; font-weight: 500 !important; line-height: 1.1 !important; text-transform: none !important; white-space: nowrap; box-shadow: 0 1px 1px rgba(0,0,0,.03) !important; cursor: pointer; transition: background .15s, border-color .15s;
}
#workspace.ws-apple button:not(:disabled):hover { border-color: #d2d2d7 !important; background: #fafafa !important; }
#workspace.ws-apple button:is(.primary, .dark-button) { border-color: var(--ap-blue) !important; background: var(--ap-blue) !important; color: #fff !important; }
#workspace.ws-apple button:is(.primary, .dark-button):not(:disabled):hover { border-color: #0077ed !important; background: #0077ed !important; }
#workspace.ws-apple button.danger { border-color: #ffd6d9 !important; background: #fff5f5 !important; color: var(--ap-red) !important; }
#workspace.ws-apple button.mini { min-height: 28px !important; padding: 0 10px !important; font-size: 12.5px !important; }
#workspace.ws-apple button:disabled { opacity: .45; cursor: default; }
#workspace.ws-apple :is(input, select, textarea):focus { outline: none !important; border-color: var(--ap-blue) !important; box-shadow: 0 0 0 3px rgba(0,113,227,.18) !important; }

/* Ô nhập */
#workspace.ws-apple :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea) {
  min-height: 36px; padding: 0 12px !important; border: 1px solid #d2d2d7 !important; border-radius: var(--ap-r-sm) !important; background: #fff !important; color: var(--ap-ink) !important; font-size: 14px !important; box-shadow: none;
}
#workspace.ws-apple textarea { padding: 9px 12px !important; line-height: 1.45; }
#workspace.ws-apple ::placeholder { color: #a1a1a6; }

/* Thẻ & khung */
#workspace.ws-apple :is(.card, .wide-card, .config-table-wrap, .report-table-wrap, .etsy-table-wrap, .task-category) {
  border: 0 !important; border-radius: var(--ap-r) !important; background: var(--ap-card) !important; box-shadow: var(--ap-shadow) !important;
}
#workspace.ws-apple .card-grid { gap: 12px !important; }
#workspace.ws-apple .card { padding: 16px 18px !important; }
#workspace.ws-apple .card h4 { margin: 0; color: var(--ap-sub) !important; font-size: 12.5px !important; font-weight: 500 !important; text-transform: none !important; }
#workspace.ws-apple .card .metric { display: block; margin-top: 6px; color: var(--ap-ink) !important; font-size: 26px !important; font-weight: 700 !important; letter-spacing: -.02em; }
#workspace.ws-apple .wide-card .item { padding: 14px 16px !important; border-color: var(--ap-hair) !important; font-size: 14px; }

/* Bảng */
#workspace.ws-apple :is(.config-table-wrap, .report-table-wrap, .etsy-table-wrap) { overflow: auto !important; }
#workspace.ws-apple table { table-layout: auto !important; min-width: 0; }
#workspace.ws-apple :is(thead th, tbody td) { width: auto; max-width: none; }
#workspace.ws-apple table { width: 100%; border-collapse: separate !important; border-spacing: 0; border: 0 !important; background: transparent !important; font-size: 13.5px !important; }
#workspace.ws-apple thead th { height: 40px !important; padding: 0 14px !important; border: 0 !important; border-bottom: 1px solid var(--ap-line) !important; background: #fbfbfd !important; color: var(--ap-sub) !important; font-size: 12px !important; font-weight: 500 !important; letter-spacing: 0 !important; text-align: left; text-transform: none !important; white-space: nowrap; }
#workspace.ws-apple tbody td { height: 48px; padding: 10px 14px !important; border: 0 !important; border-bottom: 1px solid var(--ap-hair) !important; background: transparent !important; color: var(--ap-ink) !important; font-size: 13.5px !important; vertical-align: middle; }
#workspace.ws-apple tbody tr:last-child td { border-bottom: 0 !important; }
#workspace.ws-apple tbody tr:hover td { background: #fafafc !important; }
#workspace.ws-apple .empty-cell { padding: 36px 14px !important; color: var(--ap-faint) !important; text-align: center; }

/* Nhãn, công tắc, segmented */
#workspace.ws-apple :is(.badge, .vendor-pill, .connection-pill, .shop-badge) { display: inline-flex; align-items: center; height: 22px; padding: 0 9px !important; border: 0 !important; border-radius: 999px !important; background: #f2f2f7 !important; color: var(--ap-ink2) !important; font-size: 12px !important; font-weight: 500 !important; }
#workspace.ws-apple :is(.api-pill, .active-pill) { display: inline-flex; align-items: center; height: 22px; padding: 0 9px !important; border: 0 !important; border-radius: 999px !important; background: #f2f2f7 !important; color: var(--ap-ink2) !important; font-size: 12px !important; font-weight: 500 !important; }
#workspace.ws-apple .active-pill { background: #e3f5e8 !important; color: var(--ap-green, #248a3d) !important; }
#workspace.ws-apple .toggle { width: 42px !important; height: 26px !important; }
#workspace.ws-apple .toggle i { border-radius: 999px !important; background: #e9e9ea !important; transition: background .2s; }
#workspace.ws-apple .toggle i::after { top: 2px !important; left: 2px !important; width: 22px !important; height: 22px !important; box-shadow: 0 2px 4px rgba(0,0,0,.18); }
#workspace.ws-apple .toggle input:checked + i { background: #34c759 !important; }
#workspace.ws-apple .toggle input:checked + i::after { transform: translateX(16px) !important; }
#workspace.ws-apple :is(.segmented, .report-tabs, .listing-tabs) { display: inline-flex !important; gap: 2px; padding: 2px !important; border: 0 !important; border-radius: 9px !important; background: #ececf0 !important; }
#workspace.ws-apple :is(.segmented, .report-tabs, .listing-tabs) > :is(button, a) { min-height: 30px !important; padding: 0 12px !important; border: 0 !important; border-radius: 7px !important; background: transparent !important; box-shadow: none !important; color: var(--ap-ink) !important; }
#workspace.ws-apple :is(.segmented, .report-tabs, .listing-tabs) > :is(.selected, .active, [aria-selected="true"]) { background: #fff !important; box-shadow: 0 1px 3px rgba(0,0,0,.12) !important; font-weight: 600 !important; }

/* Hộp thoại (form thêm / sửa ở mọi trang) */
dialog.dialog { padding: 0 !important; border: 0 !important; border-radius: 16px !important; background: #fff !important; box-shadow: 0 24px 70px rgba(0,0,0,.28) !important; color: var(--ap-ink); font-family: var(--ap-font) !important; }
dialog.dialog::backdrop { background: rgba(0,0,0,.32); }
dialog.dialog form > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px !important; border-bottom: 1px solid var(--ap-hair) !important; }
dialog.dialog header h3 { margin: 0; font-size: 18px !important; font-weight: 600 !important; letter-spacing: -.01em; }
dialog.dialog .close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: #f2f2f7 !important; color: var(--ap-sub) !important; font-size: 18px !important; line-height: 1 !important; cursor: pointer; }
dialog.dialog .form-grid { gap: 14px !important; padding: 18px 20px !important; }
dialog.dialog .form-grid label { display: grid; gap: 6px; color: var(--ap-sub); font-size: 12.5px !important; font-weight: 500 !important; }
dialog.dialog :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { min-height: 38px; padding: 0 12px !important; border: 1px solid #d2d2d7 !important; border-radius: 9px !important; background: #fff !important; color: var(--ap-ink) !important; font-size: 14px !important; font-family: var(--ap-font) !important; }
dialog.dialog :is(input, select, textarea):focus { outline: none; border-color: var(--ap-blue) !important; box-shadow: 0 0 0 3px rgba(0,113,227,.18); }
dialog.dialog menu { display: flex; justify-content: flex-end; gap: 8px; margin: 0 !important; padding: 14px 20px !important; border-top: 1px solid var(--ap-hair); }
dialog.dialog menu button { min-height: 36px; padding: 0 16px !important; border: 1px solid var(--ap-line) !important; border-radius: 9px !important; background: #fff !important; color: var(--ap-ink) !important; font-size: 14px !important; font-weight: 500 !important; cursor: pointer; }
dialog.dialog menu :is(.primary, [type=submit]) { border-color: var(--ap-blue) !important; background: var(--ap-blue) !important; color: #fff !important; }

/* Mobile */
@media (max-width: 760px) {
  #workspace.ws-apple { padding: 14px 14px 96px !important; }
  #workspace.ws-apple :is(.workspace-head h3, .listing-head h3, .extension-header h3) { font-size: 22px !important; }
  #workspace.ws-apple .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #workspace.ws-apple .card .metric { font-size: 21px !important; }
  #workspace.ws-apple table { min-width: 640px; }
  dialog.dialog { width: calc(100vw - 24px) !important; max-width: none !important; }
}

@media (max-width: 760px) { #workspace.ws-apple .workspace-head h3 { display: none; } #workspace.ws-apple .report-metric strong, #workspace.ws-apple .report-metric strong span { font-size: 20px !important; } }

/* ── Ô tài khoản trên thanh bên (kiểu macOS) ── */
#profileMenu.profile-trigger.pt-apple { gap: 10px !important; min-height: 50px; padding: 7px 8px !important; border: 0 !important; border-radius: 12px !important; background: transparent !important; box-shadow: none !important; transition: background .15s; }
#profileMenu.pt-apple:hover, #profileMenu.pt-apple[aria-expanded="true"] { background: rgba(0,0,0,.045) !important; }
.profile-trigger.pt-apple::before { content: none !important; display: none !important; }
.pt-apple .pt-id { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; text-align: left; }
.pt-apple .pt-id small { overflow: hidden; color: #1d1d1f !important; font-size: 14px !important; font-weight: 600 !important; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.pt-apple .pt-id em { overflow: hidden; color: #86868b; font-size: 12px; font-style: normal; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.pt-apple .pt-chevron { width: 18px !important; height: 18px !important; background: transparent !important; color: #a1a1a6 !important; }
/* Ảnh đại diện (thanh bên, menu, cài đặt, danh sách nhân viên) */
.pt-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; overflow: hidden; border-radius: 50%; background: linear-gradient(135deg, #0a84ff, #5e5ce6); color: #fff; font: 600 13px/1 -apple-system, Inter, sans-serif; }
:is(.pt-avatar, .pm-avatar, .st-avatar, .um-avatar) img { display: block; width: 100%; height: 100%; object-fit: cover; }
:is(.pt-avatar, .pm-avatar, .st-avatar, .um-avatar).has-photo { background: #e5e5ea !important; }
.pm-avatar, .um-avatar { overflow: hidden; }
.um-avatar { background: linear-gradient(135deg, #0a84ff, #5e5ce6) !important; }
.um-photo-row { display: flex; gap: 8px; }
/* Trang Cài đặt: bấm avatar để đổi ảnh */
.st-avatar { position: relative; overflow: hidden; padding: 0 !important; border: 0 !important; cursor: pointer; }
.st-avatar i { position: absolute; right: 0; bottom: 0; left: 0; padding: 3px 0 4px; background: rgba(0,0,0,.45); color: #fff; font: 600 10.5px/1 -apple-system, Inter, sans-serif; font-style: normal; opacity: 0; transition: opacity .15s; }
.st-avatar:hover i { opacity: 1; }
html[data-theme="dark"] .pt-avatar { filter: hue-rotate(180deg) url(#apple-dark-img); }
html[data-theme="dark"] :is(.pt-avatar, .pm-avatar, .st-avatar) img { filter: none !important; } /* khung đã giữ màu thật, tránh đảo màu 2 lần */
.st .st-avatar { width: 58px !important; height: 58px !important; min-height: 0 !important; flex: 0 0 58px; border-radius: 50% !important; background: linear-gradient(135deg, #0a84ff, #5e5ce6) !important; box-shadow: none !important; }
.st .st-avatar.has-photo, .st .st-avatar:has(img) { background: #e5e5ea !important; }
dialog.dialog menu button.close { display: inline-flex !important; width: auto !important; height: auto !important; min-height: 36px; padding: 0 16px !important; border: 1px solid var(--ap-line) !important; border-radius: 9px !important; background: #fff !important; color: var(--ap-ink) !important; font-size: 14px !important; font-weight: 500 !important; }

/* ── Trang Cài đặt: hoàn thiện (desktop + mobile) ── */
.st { max-width: 680px; padding-top: 28px; }
.st-head { display: none; } /* tiêu đề đã có ở thanh trên */
.st .st-row { height: auto !important; min-height: 58px !important; padding: 12px 16px !important; gap: 14px; line-height: 1.3; }
.st .st-row + .st-row::before { left: 60px; background: #e8e8ed; }
.st .st-txt { gap: 3px; }
.st .st-txt b { font-size: 15px; font-weight: 500; }
.st .st-txt small { font-size: 13px; line-height: 1.4; }
.st .st-right em { font-size: 15px; }
.st .st-card { border-radius: 14px; }
.st .st-profile { padding: 18px 18px; gap: 16px; }
.st .st-profile .st-txt b { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.st .st-profile .st-txt small { font-size: 14px; }
.st .st-group { margin-bottom: 30px; }
.st .st-group > h4 { margin: 0 18px 8px; font-size: 13px; letter-spacing: .03em; }
.st .st-foot { margin: 8px 18px 0; font-size: 13px; }
.st .st-seg { padding: 2px; border: 0 !important; border-radius: 9px; background: #e9e9ee; box-shadow: none !important; }
.st .st-seg-btn { height: 30px !important; min-height: 0 !important; padding: 0 14px !important; border: 0 !important; box-shadow: none; font-size: 13.5px !important; }
.st .st-seg-btn.on { box-shadow: 0 1px 3px rgba(0,0,0,.14), 0 0 0 .5px rgba(0,0,0,.04) !important; }
.st .st-status { font-size: 14px !important; }
@media (max-width: 760px) {
  .st { padding: 16px 0 110px; }
  .st .st-group { margin-bottom: 24px; }
  .st .st-card { border-radius: 12px; }
  .st .st-row { min-height: 56px !important; padding: 11px 14px !important; flex-wrap: nowrap; }
  .st .st-txt small { font-size: 12.5px; }
  .st .st-right em { display: none; } /* màn hẹp: bỏ giá trị bên phải, chỉ giữ mũi tên */
  .st .st-row:has(.st-seg) { flex-wrap: wrap; }
  .st .st-row:has(.st-seg) .st-right { flex: 1 0 100%; max-width: none; padding-left: 44px; }
  .st .st-row:has(.st-seg) .st-seg { display: flex; width: 100%; margin: 0 !important; }
  .st .st-row:has(.st-seg) .st-seg-btn { flex: 1; }
  .st .st-row:has(#stLark) .st-right em { display: inline; }
  .st .st-profile .st-txt b { font-size: 19px; }
}

/* ── Xưởng (List Vendor) ── */
#workspace.ws-apple .vr-intro { max-width: 760px; margin: -6px 0 16px; color: var(--ap-sub); font-size: 14px; line-height: 1.5; }
#workspace.ws-apple .vr-name { font-size: 14.5px; font-weight: 600; }
.vr-type { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font: 600 12px/1 -apple-system, Inter, sans-serif; font-style: normal; }
.vr-type.api { background: #e8f1fd; color: #0060c7; }
.vr-type.excel { background: #e3f5e8; color: #1d7a36; }
#workspace.ws-apple .vr-conn { color: var(--ap-sub); font-size: 13px; white-space: nowrap; }
.vr-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; vertical-align: middle; background: #c7c7cc; }
.vr-dot.on { background: #34c759; } .vr-dot.off { background: #ff9f0a; }
#workspace.ws-apple .vr-tplcell { display: table-cell; }
#workspace.ws-apple .vr-tplcell small { display: block; max-width: 220px; overflow: hidden; margin-top: 3px; text-overflow: ellipsis; white-space: nowrap; }
.vr-tpl { display: inline-flex; height: 22px; align-items: center; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.vr-tpl.ok { background: #e3f5e8; color: #1d7a36; } .vr-tpl.none { background: #fff4e5; color: #b45309; }
.vr-muted { color: var(--ap-faint, #86868b); font-size: 13px; }
#workspace.ws-apple .vr-actions { text-align: right; white-space: nowrap; } #workspace.ws-apple .vr-actions button { margin-left: 6px; }
#workspace.ws-apple .vr-table th:last-child { text-align: right; }
.vr-dialog { width: min(560px, calc(100vw - 24px)); }
.vr-dialog .vr-note { margin: 0; color: #86868b; font-size: 12.5px; line-height: 1.45; }
.vr-dialog .vr-map-body { padding: 16px 20px; }
.vr-dialog .vr-map-list { display: grid; gap: 8px; max-height: 56vh; margin-top: 12px; overflow: auto; padding-right: 4px; }
.vr-dialog .vr-map-list label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid #f0f0f3; font-size: 13.5px; color: #1d1d1f; }
.vr-dialog .vr-map-list label span { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.vr-dialog .vr-map-list select { min-height: 34px !important; }
.vr-dialog .vr-pick { display: grid; gap: 8px; padding: 16px 20px; }
.vr-dialog .vr-pick label { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #e5e5ea; border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.vr-dialog .vr-pick label:has(input:checked) { border-color: #0071e3; background: #f2f7fe; }
.vr-dialog .vr-pick label.off { opacity: .5; cursor: default; }
.vr-dialog .vr-pick span { flex: 1; display: grid; gap: 2px; }
.vr-dialog .vr-pick b { font-size: 14.5px; font-weight: 600; }
.vr-dialog .vr-pick small { color: #86868b; font-size: 12.5px; }
.vr-dialog .vr-pick input { accent-color: #0071e3; width: 17px; height: 17px; }
.vr-dialog:has(.vr-export) { width: min(680px, calc(100vw - 24px)); }
.vr-dialog .vr-export { max-height: min(64vh, 620px); overflow: auto; padding: 4px 0 12px; }
.vr-dialog .vr-export .vr-pick { padding: 4px 20px 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vr-dialog .vr-export .vr-pick label { padding: 10px 12px; }
.vr-dialog .vr-step { margin: 12px 20px 6px; color: #6e6e73; font-size: 13px; font-weight: 500; }
.vr-dialog .vr-last { margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: #e8f1fd; color: #0071e3; font: 600 10.5px -apple-system, Inter, sans-serif; font-style: normal; vertical-align: 2px; }
.vr-dialog .vr-split { margin: 8px 20px 0; border: 1px solid #e5e5ea; border-radius: 12px; }
.vr-dialog .vr-split summary { padding: 11px 14px; cursor: pointer; font-size: 14px; font-weight: 600; color: #1d1d1f; }
.vr-dialog .vr-split summary small { margin-left: 6px; color: #86868b; font-weight: 400; font-size: 12.5px; }
.vr-dialog .vr-orders { display: grid; border-top: 1px solid #f0f0f3; }
.vr-dialog .vr-orders label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 200px); align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid #f5f5f7; }
.vr-dialog .vr-orders label:last-child { border-bottom: 0; }
.vr-dialog .vr-orders span { display: grid; gap: 1px; min-width: 0; }
.vr-dialog .vr-orders b { font-size: 13.5px; font-weight: 600; }
.vr-dialog .vr-orders small { overflow: hidden; color: #86868b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.vr-dialog .vr-orders select { min-height: 32px !important; font-size: 13px; }
.vr-dialog .vr-tag { color: #bf5af2; font-style: normal; font-weight: 600; }
.vr-dialog .vr-resend { display: flex; align-items: flex-start; gap: 10px; margin: 10px 20px 0; padding: 10px 14px; border-radius: 12px; background: #f5f5f7; cursor: pointer; }
.vr-dialog .vr-resend input { margin-top: 2px; accent-color: #0071e3; width: 16px; height: 16px; }
.vr-dialog .vr-resend span { display: grid; gap: 2px; }
.vr-dialog .vr-resend b { font-size: 13.5px; font-weight: 600; }
.vr-dialog .vr-resend small { color: #86868b; font-size: 12px; }
.vr-dialog .vr-resend.warn { background: #fff8e6; }
.vr-dialog .vr-resend.warn small b { color: #b25000; font-size: 12px; }
.vr-dialog menu .vr-sum { flex: 1; align-self: center; margin-right: auto; color: #6e6e73; font-size: 12.5px; }
.vr-dialog menu button[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 600px) { .vr-dialog .vr-export .vr-pick { grid-template-columns: 1fr; } .vr-dialog .vr-orders label { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .vr-dialog .vr-map-list label { grid-template-columns: 1fr; gap: 4px; } }
.vr-dialog .vr-map-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vr-dialog .vr-reguess { flex: 0 0 auto; min-height: 32px; padding: 0 12px; border: 1px solid #d2d2d7; border-radius: 8px; background: #fff; color: #0071e3; font: 500 13px -apple-system, Inter, sans-serif; cursor: pointer; }
.vr-dialog .vr-reguess:hover { background: #f2f7fe; }

/* ── Teams Group ── */
#workspace.ws-apple .tg-search { width: min(360px, 100%); margin-bottom: 14px; }
#workspace.ws-apple .tg-list { display: grid; gap: 14px; }
#workspace.ws-apple .tg-team { overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.05); }
#workspace.ws-apple .tg-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
#workspace.ws-apple .tg-head .tg-toggle { width: 30px; min-height: 30px !important; padding: 0 !important; border-radius: 50% !important; font-size: 14px !important; }
#workspace.ws-apple .tg-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
#workspace.ws-apple .tg-title b { font-size: 16px; font-weight: 600; }
#workspace.ws-apple .tg-title small { color: #86868b; font-size: 13px; }
#workspace.ws-apple .tg-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#workspace.ws-apple .tg-members { border-radius: 0 !important; box-shadow: none !important; border-top: 1px solid #f0f0f3 !important; }
.tg-code { display: inline-flex; height: 22px; align-items: center; padding: 0 9px; border-radius: 6px; background: #f2f2f7; color: #1d1d1f; font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .03em; }
#workspace.ws-apple .tg-empty { padding: 36px; border-radius: 14px; background: #fff; color: #86868b; text-align: center; box-shadow: 0 0 0 1px rgba(0,0,0,.05); }
#workspace.ws-apple .vr-intro code { padding: 1px 6px; border-radius: 5px; background: #f2f2f7; font-size: 12.5px; }
@media (max-width: 760px) { #workspace.ws-apple .tg-head { flex-wrap: wrap; } #workspace.ws-apple .tg-acts { flex: 1 0 100%; justify-content: flex-start; padding-left: 42px; } }

/* ── Product Types ── */
#workspace.ws-apple .pt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
#workspace.ws-apple .pt-bar input { width: min(340px, 100%); }
#workspace.ws-apple .pt-sum { color: #6e6e73; font-size: 13.5px; }
#workspace.ws-apple .pt-unknown-link { min-height: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; color: #c93400 !important; font-size: 13.5px !important; text-decoration: underline; }
.pt-tech { display: inline-flex; height: 20px; align-items: center; margin: 1px 0; padding: 0 7px; border-radius: 999px; background: #f2f2f7; color: #424245; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
#workspace.ws-apple .pt-kw { max-width: 280px; color: #86868b; font-size: 12.5px !important; }
#workspace.ws-apple .pt-unknown { margin-top: 16px; padding: 16px 18px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.05); }
#workspace.ws-apple .pt-unknown header { display: grid; gap: 2px; margin-bottom: 8px; }
#workspace.ws-apple .pt-unknown h4 { margin: 0; }
#workspace.ws-apple .pt-unknown ul { margin: 0; padding-left: 18px; color: #424245; font-size: 13px; line-height: 1.7; }

/* ═══ Hộp thoại — chuẩn hoá toàn app (rà soát 18/11) ═══
   1) Nút × ở tiêu đề: luôn tròn 30×30 (trước bị quy tắc chung của button ép cao 38px → méo bầu dục), dấu × vẽ bằng nét mảnh.
   2) Nội dung không có lề riêng thì cách mép 20px (trước dính sát viền). */
dialog header button.close, dialog .x-close {
  flex: none; display: inline-grid !important; place-items: center;
  width: 30px !important; height: 30px !important; min-width: 30px !important; max-width: 30px; min-height: 0 !important; max-height: 30px;
  padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 50% !important;
  background: #f2f2f7 !important; color: #6e6e73 !important; box-shadow: none !important;
  font-size: 0 !important; line-height: 0 !important; cursor: pointer; transition: background .15s, color .15s;
}
dialog header button.close:hover, dialog .x-close:hover { background: #e5e5ea !important; color: #1d1d1f !important; }
dialog header button.close:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 113, 227, .3) !important; }
dialog header button.close:not(:has(svg))::before {
  content: ""; width: 12px; height: 12px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 1.5l9 9M10.5 1.5l-9 9' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 1.5l9 9M10.5 1.5l-9 9' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
dialog .x-close svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
dialog.dialog > form > header { gap: 12px; }
dialog.dialog > form > :where(:not(header):not(menu):not(.form-grid):not(.qs-body)) { margin-left: 20px; margin-right: 20px; }

/* ── Cài đặt nhanh: nhóm bo góc kiểu macOS ── */
@media (min-width: 761px) { dialog.dialog:has(.qs-form) { width: min(440px, calc(100vw - 24px)) !important; max-width: none !important; } }
.qs-body { padding: 16px 20px 6px; }
.qs-group { overflow: hidden; border-radius: 12px; background: #f5f5f7; }
dialog.dialog .qs-row { position: relative; display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; grid-template-columns: none !important; gap: 14px; min-height: 58px; margin: 0 !important; padding: 10px 14px !important; cursor: pointer; color: #1d1d1f !important; }
.qs-row + .qs-row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: #e3e3e8; }
.qs-row:active { background: #ececf0; }
dialog.dialog .qs-txt { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.qs-txt b { font-size: 14px; font-weight: 500; letter-spacing: -.01em; }
.qs-txt small { color: #86868b; font-size: 12px; }
.qs-row .toggle { position: relative; flex: none; width: 42px !important; height: 26px !important; margin: 0 !important; }
.qs-row .toggle input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.qs-row .toggle i { position: absolute; inset: 0; border-radius: 999px !important; background: #e3e3e8 !important; transition: background .2s; }
.qs-row .toggle i::after { content: ""; position: absolute; top: 2px !important; left: 2px !important; width: 22px !important; height: 22px !important; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s cubic-bezier(.3, .7, .4, 1); }
.qs-row .toggle input:checked + i { background: #34c759 !important; }
.qs-row .toggle input:checked + i::after { transform: translateX(16px) !important; }
.qs-row .toggle input:focus-visible + i { box-shadow: 0 0 0 3px rgba(0, 113, 227, .3); }
dialog.dialog .qs-row select.qs-select { flex: none; width: auto !important; min-width: 0 !important; height: 30px !important; min-height: 0 !important; padding: 0 28px 0 10px !important; border: 1px solid #d2d2d7 !important; border-radius: 8px !important; background-color: #fff !important; font-size: 13px !important; }
.qs-note { margin: 8px 4px 0; color: #86868b; font-size: 12px; }
dialog.dialog:has(.qs-form) menu { border-top: 0 !important; padding-top: 10px !important; }
#closeMobileMenu { display: inline-grid; place-items: center; width: 30px !important; height: 30px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: #f2f2f7 !important; color: #6e6e73 !important; font-size: 17px !important; line-height: 1 !important; }
/* Hộp thoại không bọc <form> (Gửi xưởng, Gửi hàng loạt, Khớp sản phẩm xưởng…): cùng khung tiêu đề + lề 20px */
dialog.dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px !important; border-bottom: 1px solid var(--ap-hair, #e8e8ed) !important; }
dialog.dialog > header h3 { margin: 0; font-size: 18px !important; font-weight: 600 !important; letter-spacing: -.01em; }
dialog.dialog > :where(:not(header):not(menu)) { margin-left: 20px !important; margin-right: 20px !important; }
dialog.dialog > header + * { margin-top: 16px !important; }
dialog.dialog > :where(:not(header):not(menu)):last-of-type { margin-bottom: 4px; }
dialog.dialog > menu { margin-top: 12px !important; }

/* ── Trang Cài đặt: mật độ chuẩn macOS (dòng ~48px, nhóm sát hơn) ── */
@media (min-width: 761px) {
  .st { padding-top: 20px !important; }
  .st .st-group { margin-top: 18px !important; }
  .st .st-group > h4 { margin: 0 0 6px 14px !important; font-size: 11.5px !important; letter-spacing: .04em; }
  .st .st-row { min-height: 48px !important; padding: 8px 14px !important; gap: 12px !important; }
  .st .st-row + .st-row::before { left: 54px !important; }
  .st .st-ic { width: 28px !important; height: 28px !important; border-radius: 7px !important; }
  .st .st-ic svg { width: 16px !important; height: 16px !important; }
  .st .st-txt { gap: 1px !important; }
  .st .st-txt b { font-size: 14px !important; }
  .st .st-txt small { font-size: 12px !important; line-height: 1.35 !important; color: #86868b; }
  .st .st-foot { margin: 6px 14px 0 !important; font-size: 12px !important; }
}
/* × chỉ vẽ 1 lần: ẩn ký tự "×" gốc trong nút (quy tắc cũ dialog.dialog .close ép font 18px làm hiện 2 dấu) */
dialog.dialog header button.close:not(:has(svg)), dialog[open] header button.close:not(:has(svg)) { font-size: 0 !important; line-height: 0 !important; color: #6e6e73 !important; text-indent: 0 !important; }
dialog.dialog header button.close:not(:has(svg)):hover { color: #1d1d1f !important; }
/* Cài đặt nhanh: liên kết sang trang Cài đặt */
.qs-links { overflow: hidden; margin-top: 12px; border-radius: 12px; background: #f5f5f7; }
dialog.dialog .qs-link { display: flex !important; align-items: center; justify-content: space-between; width: 100% !important; min-height: 44px !important; padding: 0 14px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; color: #0071e3 !important; font-size: 14px !important; font-weight: 500 !important; text-align: left; cursor: pointer; }
dialog.dialog .qs-link + .qs-link { box-shadow: inset 0 1px 0 #e3e3e8 !important; }
dialog.dialog .qs-link span { color: #c7c7cc; font-size: 20px; line-height: 1; }
dialog.dialog .qs-link:hover { background: #ececf0 !important; }
.ul-expired { color: #b42318; }

/* Xem ảnh đại diện cỡ lớn (settings-page.js → viewAvatar) */
.st .st-avatar { cursor: zoom-in; }
.st .st-avatar i { display: none !important; }
.av-view { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); opacity: 0; transition: opacity .18s ease; cursor: zoom-out; }
.av-view.in { opacity: 1; }
.av-view figure { display: grid; justify-items: center; gap: 14px; margin: 0; transform: scale(.92); transition: transform .24s cubic-bezier(.22, 1, .36, 1); }
.av-view.in figure { transform: none; }
.av-view img, .av-view .av-initial { width: min(78vw, 360px); height: min(78vw, 360px); border-radius: 50%; object-fit: cover; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); cursor: default; }
.av-view .av-initial { display: grid; place-items: center; background: linear-gradient(135deg, #0a84ff, #5e5ce6); color: #fff; font: 600 min(24vw, 110px)/1 -apple-system, BlinkMacSystemFont, Inter, sans-serif; }
.av-view figcaption { color: #fff; font: 600 17px -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif; letter-spacing: -.01em; }
.av-view .av-x { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 34px !important; height: 34px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: rgba(255, 255, 255, .18) !important; color: #fff !important; font-size: 20px !important; line-height: 1 !important; box-shadow: none !important; cursor: pointer; }
.av-view .av-x:hover { background: rgba(255, 255, 255, .3) !important; }
html[data-theme="dark"] .av-view img { filter: none !important; }
.av-view img.small { width: min(60vw, 220px); height: min(60vw, 220px); }

/* Ô tài khoản thanh bên: hiện đủ tên (bỏ mũi tên, tên dài xuống tối đa 2 dòng) */
.sidebar > .brand { padding-left: 12px !important; padding-right: 12px !important; }
#profileMenu.profile-trigger.pt-apple { gap: 10px !important; padding: 7px 8px !important; }
#profileMenu.pt-apple .pt-chevron { display: none !important; }
#profileMenu.pt-apple .pt-avatar { width: 36px; height: 36px; }
#profileMenu.pt-apple .pt-id small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal !important; overflow-wrap: anywhere; font-size: 14px !important; line-height: 1.22; letter-spacing: -.01em; }
#profileMenu.pt-apple .pt-id em { font-size: 12px; }

/* Edit Order: ô địa chỉ khoá, bấm "Sửa" mới sửa được */
dialog .form-grid .addr-lock-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(120, 120, 128, .08); }
dialog .form-grid .addr-lock-head span { display: grid; gap: 2px; }
dialog .form-grid .addr-lock-head b { font-size: 14px; font-weight: 600; }
dialog .form-grid .addr-lock-head small { color: #86868b; font-size: 12px; }
dialog .form-grid .addr-lock-head.editing { background: rgba(0, 113, 227, .08); }
dialog .form-grid .addr-lock-head.editing small { color: #0071e3; }
dialog .form-grid .addr-edit { flex: 0 0 auto; min-height: 32px; padding: 0 16px; border: 1px solid #0071e3; border-radius: 8px; background: transparent; color: #0071e3; font: 600 13px -apple-system, Inter, sans-serif; cursor: pointer; }
dialog .form-grid .addr-lock-head.editing .addr-edit { background: #0071e3; color: #fff; }
dialog.dialog .form-grid .addr-locked input:read-only { background: #f2f2f5 !important; border-color: #e5e5ea !important; color: #6e6e73 !important; cursor: not-allowed; box-shadow: none !important; }

/* ── Sàn mặc định: ô chọn trong Cài đặt nhanh + nhãn "Mặc định" trong menu ── */
dialog.dialog .qs-row.qs-market { flex-direction: column !important; flex-wrap: wrap !important; align-items: stretch !important; gap: 10px; }
dialog.dialog .qs-row.qs-market:active { background: transparent; }
.mk-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mk-pick label { position: relative; display: grid !important; gap: 2px; padding: 10px 12px; border: 1px solid #e5e5ea; border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.mk-pick label:has(input:checked) { border-color: #0071e3; background: #f2f7fe; box-shadow: inset 0 0 0 1px #0071e3; }
.mk-pick label.off { opacity: .45; cursor: not-allowed; }
.mk-pick input { position: absolute; opacity: 0; pointer-events: none; }
.mk-pick b { color: #1d1d1f; font-size: 14px; font-weight: 600; }
.mk-pick small { color: #86868b; font-size: 12px; }
.mk-pick label:has(input:checked) b::after { content: " ✓"; color: #0071e3; }
.quick-submenu .mk-default { margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: #e8f1fd; color: #0071e3; font-size: 10.5px; font-style: normal; font-weight: 600; }

/* ── Báo cáo lãi lỗ (P&L) kiểu báo cáo tài chính Mỹ — Reports → Etsy Orders Cost ── */
#workspace#workspace .pl-statement { margin: 0 0 16px; padding: 14px 16px 10px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .04); }
#workspace#workspace .pl-statement header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
#workspace#workspace .pl-statement h4 { margin: 0; color: #1d1d1f; font-size: 16px; font-weight: 700; }
#workspace#workspace .pl-statement header small { color: #86868b; font-size: 12px; }
#workspace#workspace .pl-statement table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
#workspace#workspace .pl-statement thead th { padding: 4px 0; color: #86868b; font-size: 11px; font-weight: 600; text-align: right; text-transform: uppercase; letter-spacing: .04em; }
#workspace#workspace .pl-statement tbody th { padding: 7px 0; color: #1d1d1f; font-size: 13.5px; font-weight: 500; text-align: left; }
#workspace#workspace .pl-statement tbody th small { display: block; margin-top: 1px; color: #86868b; font-size: 11.5px; font-weight: 400; }
#workspace#workspace .pl-statement tbody td { padding: 7px 0 7px 12px; font-size: 13.5px; text-align: right; white-space: nowrap; }
#workspace#workspace .pl-statement tbody td:last-child { width: 64px; color: #86868b; font-size: 12px; }
#workspace#workspace .pl-statement tr.muted th, .pl-statement tr.muted td { color: #86868b; font-size: 12.5px; }
#workspace#workspace .pl-statement tr.total th, .pl-statement tr.total td { border-top: 1px solid #d2d2d7; font-weight: 700; }
#workspace#workspace .pl-statement tr.grand th, .pl-statement tr.grand td { border-top: 2px solid #1d1d1f; border-bottom: 3px double #1d1d1f; font-size: 15px; }
#workspace#workspace .pl-statement .neg { color: #d70015; }
#workspace#workspace .pl-statement > p { margin: 8px 0 0; color: #86868b; font-size: 12px; line-height: 1.45; }
#workspace#workspace .pl-statement th, #workspace#workspace .pl-statement td { height: auto !important; border-left: 0 !important; border-right: 0 !important; background: transparent !important; box-shadow: none !important; }
#workspace#workspace .pl-statement tbody tr + tr th, #workspace#workspace .pl-statement tbody tr + tr td { border-top: 1px solid #f0f0f3; }
#workspace#workspace .pl-statement thead th { border-bottom: 1px solid #e5e5ea !important; }
#workspace#workspace .pl-statement tbody tr.pl-total th, #workspace#workspace .pl-statement tbody tr.pl-total td { border-top: 1px solid #c7c7cc; font-weight: 700; }
#workspace#workspace .pl-statement tbody tr.pl-grand th, #workspace#workspace .pl-statement tbody tr.pl-grand td { border-top: 2px solid #1d1d1f; border-bottom: 3px double #1d1d1f; font-size: 15px; }
#workspace#workspace .pl-statement table { table-layout: fixed; }
#workspace#workspace .pl-statement tbody th, #workspace#workspace .pl-statement tbody th small { white-space: normal !important; overflow-wrap: anywhere; }
#workspace#workspace .pl-statement thead th:nth-child(2) { width: 110px; }
#workspace#workspace .pl-statement thead th:nth-child(3) { width: 64px; }
@media (max-width: 760px) {
  #workspace#workspace .pl-statement { padding: 12px 12px 8px; }
  #workspace#workspace .pl-statement thead th:nth-child(2) { width: 92px; }
  #workspace#workspace .pl-statement thead th:nth-child(3) { width: 50px; }
  #workspace#workspace .pl-statement tbody th, #workspace#workspace .pl-statement tbody td { font-size: 13px; }
  #workspace#workspace .pl-statement tbody td:last-child { width: auto; font-size: 11.5px; }
}
#workspace#workspace .pl-statement table { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
#workspace#workspace .pl-statement thead th:first-child { width: auto !important; }
#workspace#workspace .pl-statement thead th:nth-child(2) { width: 112px !important; min-width: 0 !important; }
#workspace#workspace .pl-statement thead th:nth-child(3) { width: 64px !important; min-width: 0 !important; }
#workspace#workspace .pl-statement :is(th, td) { min-width: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }
#workspace#workspace .pl-statement tbody td { padding-left: 8px !important; }
@media (max-width: 760px) {
  #workspace#workspace .pl-statement thead th:nth-child(2) { width: 88px !important; }
  #workspace#workspace .pl-statement thead th:nth-child(3) { width: 48px !important; }
}
#workspace#workspace .pl-statement table { table-layout: fixed !important; }
#workspace#workspace .pl-statement col.pl-c2 { width: 112px; }
#workspace#workspace .pl-statement col.pl-c3 { width: 64px; }
@media (max-width: 760px) { #workspace#workspace .pl-statement col.pl-c2 { width: 30%; } #workspace#workspace .pl-statement col.pl-c3 { width: 16%; } }
#workspace#workspace .pl-statement tbody tr.pl-total > * { border-top: 1px solid #c7c7cc !important; }
#workspace#workspace .pl-statement tbody tr.pl-grand > * { border-top: 2px solid #1d1d1f !important; border-bottom: 3px double #1d1d1f !important; }

/* Báo cáo Etsy: dòng Tổng + ghi chú nguồn số */
#workspace .report-table tr.report-total td { border-top: 2px solid #1d1d1f !important; font-weight: 700 !important; background: #f5f5f7 !important; }
#workspace .report-table td.neg, #workspace .report-metric .neg { color: #d70015 !important; }
#workspace .report-note { margin: 0 0 12px; color: #6e6e73; font-size: 12.5px; line-height: 1.5; }

/* Hộp Xuất Excel: chọn định dạng file */
.vr-dialog .vr-format { display: flex; align-items: center; gap: 8px; margin: 10px 20px 0; }
.vr-dialog .vr-format > span { margin-right: 4px; color: #6e6e73; font-size: 13px; font-weight: 500; }
.vr-dialog .vr-format label { position: relative; display: inline-flex !important; align-items: center; padding: 6px 12px; border: 1px solid #e5e5ea; border-radius: 980px; cursor: pointer; }
.vr-dialog .vr-format label:has(input:checked) { border-color: #0071e3; background: #f2f7fe; color: #0071e3; }
.vr-dialog .vr-format input { position: absolute; opacity: 0; pointer-events: none; }
.vr-dialog .vr-format b { font-size: 13px; font-weight: 600; }
