/* v0.17.0 */

/* Header: Xin chào | Họ và tên | Vai trò */
.profile-text .profile-role{font-weight:600}

/* Thêm quyền cho user */
.user-perms{margin:14px 0;border:1px solid #e4e7ec;border-radius:8px;background:#fcfcfd}
.user-perms>summary{padding:10px 14px;font-weight:700;cursor:pointer}
.user-perms>.hint{margin:0 14px 8px}
.user-perms .table-wrap{margin:0 14px 12px;max-height:320px;overflow:auto}
.perm-table{width:100%;border-collapse:collapse;font-size:13px}
.perm-table th,.perm-table td{padding:6px 8px;border-bottom:1px solid #eaecf0;text-align:center}
.perm-table th:first-child,.perm-table td:first-child{text-align:left}
.perm-table thead th{position:sticky;top:0;background:#f8fafc;z-index:1}
#dialog .perm-cell{display:inline-flex;align-items:center;gap:4px;margin:0}
.perm-role{padding:0 5px;border-radius:999px;background:#ecfdf3;color:#067647;font-size:10px;font-weight:700}
.admin-tools{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:6px 12px}

/* Khách hàng: quote file links */
.contact-quotes ul{display:grid;gap:6px;margin:6px 0 0;padding:0;list-style:none}
.contact-quotes li{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;padding:8px 10px;border:1px solid #eaecf0;border-radius:6px;background:#fcfcfd}
.contact-quote-link{display:inline-flex;align-items:center;gap:6px;color:var(--brand);font-weight:600;cursor:pointer;text-decoration:none}
.contact-quote-link:hover,.contact-quote-link:focus-visible{text-decoration:underline}
.contact-quote-link .solid-icon{width:15px;height:15px;flex-basis:15px}

/* Sản phẩm: name link + detail dialog */
.product-name-link{padding:0;border:0;background:none;color:#1d2433;font-weight:700;text-align:left;cursor:pointer}
.product-name-link:hover,.product-name-link:focus-visible{color:var(--brand);text-decoration:underline}
.product-detail{display:grid;grid-template-columns:minmax(0,220px) minmax(0,1fr);gap:18px;align-items:start}
.product-detail-img{width:100%;border:1px solid #eaecf0;border-radius:8px;object-fit:cover}
.product-detail-img.empty{display:grid;place-items:center;aspect-ratio:1;background:#f2f4f7;color:#98a2b3}
.product-detail-img.empty .solid-icon{width:48px;height:48px;flex-basis:48px}
.product-detail h3{margin:0 0 10px}
.product-detail dl{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:6px 14px;margin:0}
.product-detail dt{color:#667085}
.product-detail dd{margin:0;font-weight:600}
.product-detail h4{margin:14px 0 6px}
.product-detail-desc{margin:0;white-space:pre-line}
.product-detail-sup{width:100%;border-collapse:collapse}
.product-detail-sup td{padding:6px 8px;border-bottom:1px solid #eaecf0}
.product-detail-sup .money{text-align:right}
@media(max-width:640px){.product-detail{grid-template-columns:minmax(0,1fr)}}

/* Product form: supplier column labels only on the first row */
#supplier-rows .supplier-price-row:not(:first-child) .row-label{display:none}
#supplier-rows .supplier-price-row:not(:first-child){margin-top:6px}
#supplier-rows .supplier-price-row:not(:first-child)>button{margin-top:0}
.supplier-config-link{color:var(--brand);font-weight:600}
.supplier-config-link.disabled{color:inherit;font-weight:inherit;cursor:default}

/* Avatar: round thumbnail + round crop preview */
[data-image="avatar"] img{width:72px;height:72px;border-radius:50%;object-fit:cover}
.crop-avatar-preview{display:inline-flex;flex-direction:column;align-items:center;gap:6px;margin:10px 0 0 14px;vertical-align:top;color:#667085;font-size:12px}
.crop-avatar-preview canvas{width:120px;height:120px;border-radius:50%;box-shadow:0 0 0 3px #fff,0 0 0 4px #d0d5dd;background:#f2f4f7}

/* Large image viewer */
body.mv-open{overflow:hidden}
.media-viewer{position:fixed;inset:0;z-index:1000;display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:#0b0f19f2;color:#fff}
.mv-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px}
.mv-title{display:flex;flex-direction:column;min-width:0}
.mv-title strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mv-title span{color:#98a2b3;font-size:12px}
.mv-tools{display:flex;align-items:center;gap:6px;flex:none}
.mv-tools button{min-width:36px;height:34px;padding:0 10px;border:1px solid #ffffff33;border-radius:6px;background:#ffffff14;color:#fff;font-size:16px}
.mv-tools button:hover,.mv-tools button:focus-visible{background:#ffffff2e}
.mv-count,.mv-zoom{min-width:56px;color:#d0d5dd;font-size:13px;text-align:center}
.mv-stage{position:relative;display:grid;place-items:center;overflow:hidden;touch-action:none}
.mv-img{max-width:calc(100% - 140px);max-height:100%;object-fit:contain;cursor:grab;user-select:none;transition:transform .08s ease-out}
.mv-stage.zoomed .mv-img{cursor:move;max-width:none}
.mv-nav{position:absolute;top:50%;z-index:2;width:52px;height:72px;border:0;border-radius:8px;background:#ffffff1f;color:#fff;font-size:44px;line-height:1;transform:translateY(-50%)}
.mv-nav:hover,.mv-nav:focus-visible{background:#ffffff40}
.mv-nav.prev{left:14px}.mv-nav.next{right:14px}
.mv-hint{position:absolute;bottom:8px;left:50%;margin:0;padding:4px 10px;border-radius:999px;background:#0008;color:#d0d5dd;font-size:12px;transform:translateX(-50%);pointer-events:none}
.mv-thumbs{display:flex;gap:8px;overflow-x:auto;padding:10px 16px 14px;scroll-behavior:smooth}
.mv-thumbs button{flex:none;width:72px;height:54px;padding:0;border:2px solid transparent;border-radius:6px;background:#1d2433;opacity:.6;overflow:hidden}
.mv-thumbs button img{width:100%;height:100%;object-fit:cover}
.mv-thumbs button:hover{opacity:.9}
.mv-thumbs button.active{border-color:var(--brand);opacity:1}
