/* VIET TRADE — giao diện hệ thống tài khoản: danh mục sản phẩm, cổng người bán / người mua / Cục */

.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.pcard { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: var(--ink-4); transform: translateY(-2px); }
.pcard .ph { aspect-ratio: 4 / 3; background: var(--bg-3); overflow: hidden; position: relative; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .ph .tag { position: absolute; left: 8px; top: 8px; }
.pcard .bd { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard .bd b { font-weight: 600; line-height: 1.35; }
.pcard .bd .co { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .bd .meta { margin-top: auto; padding-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink-4); font-size: 12px; }

.gallery { display: grid; gap: 10px; }
.gallery .main { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); border: 1px solid var(--line); }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery .thumbs button { width: 64px; height: 48px; border: 2px solid transparent; border-radius: 6px; overflow: hidden; padding: 0; cursor: pointer; background: var(--bg-3); }
.gallery .thumbs button.on { border-color: var(--accent); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }

.file-list { display: grid; gap: 8px; }
.file-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; }
.file-row .ic { width: 44px; height: 34px; border-radius: 5px; background: var(--bg-3); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--ink-3); overflow: hidden; }
.file-row .ic img { width: 100%; height: 100%; object-fit: cover; }
.file-row b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.media-grid figure { margin: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-3); }
.media-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.media-grid figcaption { font-size: 11.5px; padding: 6px 8px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 6px; align-items: center; background: var(--bg); }
.media-grid .del { border: 0; background: transparent; color: var(--down); cursor: pointer; font-size: 12px; padding: 0; }
.video-frame { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: var(--radius); background: #000; }

/* CRM dạng kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--bg-2); border-radius: var(--radius); padding: 10px; min-height: 260px; }
.kcol h4 { font-size: 13px; display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 10px; }
.kcard { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s, box-shadow .15s; font-size: 13px; }
.kcard:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.kcard .k1 { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.kcard b { display: block; font-weight: 600; margin: 4px 0 2px; line-height: 1.35; }
.kcard .k3 { font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 6px; }

/* ngăn chi tiết & hộp thoại */
.drawer-bg { position: fixed; inset: 0; background: rgba(15, 17, 23, .38); z-index: 40; opacity: 0; transition: opacity .2s; }
.drawer-bg.on { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--bg); z-index: 41; box-shadow: var(--shadow); transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-b { padding: 18px 22px 40px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 12px 22px; border-top: 1px solid var(--line); background: var(--bg-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); }
.timeline li::after { content: ""; position: absolute; left: 7.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.approve::before { background: var(--up); }
.timeline li.reject::before { background: var(--down); }
.timeline li.yeu_cau_bo_sung::before { background: var(--warn); }
.timeline time { color: var(--ink-4); font-size: 12px; }
.modal-bg { position: fixed; inset: 0; background: rgba(15, 17, 23, .45); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--bg); border-radius: 12px; box-shadow: var(--shadow); width: min(500px, 100%); padding: 22px; }
.cred { background: var(--bg-2); border: 1px dashed var(--line); border-radius: 8px; padding: 12px 14px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; line-height: 1.8; margin: 12px 0; word-break: break-all; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; word-break: break-word; }
.section-t { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 22px 0 10px; }

/* hộp thư */
.inbox { display: grid; grid-template-columns: 320px 1fr; border: 1px solid var(--line); border-radius: var(--radius); height: 600px; overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; }
.inbox-list a { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.inbox-list a:hover { background: var(--bg-2); }
.inbox-list a.on { background: var(--accent-soft); }
.inbox-list b { display: flex; justify-content: space-between; gap: 6px; font-weight: 600; font-size: 13.5px; }
.inbox-list span { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat { display: flex; flex-direction: column; min-width: 0; }
.chat-h { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-b { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-2); }
.msg { max-width: 76%; padding: 9px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.msg.mine { align-self: flex-end; background: var(--accent); color: #fff; border-color: var(--accent); }
.msg time { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }
.chat-f { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-f textarea { flex: 1; resize: none; height: 44px; }

/* biểu mẫu nhiều phần */
.form-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.form-sec h3 { font-size: 15px; margin-bottom: 4px; }
.form-sec > p { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-3); }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-grid-3 .full, .form-grid .full { grid-column: 1 / -1; }
.form-grid-3 .input, .form-grid-3 select { width: 100%; min-width: 0; }
.field .req { color: var(--down); }
.field input[type=file] { font-size: 13px; max-width: 100%; }
.type-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.type-pick label { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px 18px; cursor: pointer; display: block; }
.type-pick input { position: absolute; opacity: 0; pointer-events: none; }
.type-pick label.on { border-color: var(--accent); background: var(--accent-soft); }
.type-pick b { font-size: 16px; display: block; margin-bottom: 4px; }
.specs-row { display: grid; grid-template-columns: 1fr 1.6fr 34px; gap: 8px; margin-bottom: 8px; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--radius); }
.err-box, .ok-box, .warn-box, .info-box { border-radius: 8px; padding: 10px 14px; font-size: 13px; margin: 10px 0; }
.err-box { background: var(--down-soft); color: var(--down); }
.ok-box { background: var(--up-soft); color: var(--up); }
.warn-box { background: var(--warn-soft); color: var(--warn); }
.info-box { background: var(--accent-soft); color: var(--ink-2); }
.dot { display: inline-block; min-width: 18px; height: 18px; border-radius: 9px; background: var(--down); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; padding: 0 5px; }
.btn.danger { color: var(--down); border-color: var(--down-soft); }
.btn.danger:hover { border-color: var(--down); }
.link { color: var(--accent); cursor: pointer; background: none; border: 0; padding: 0; font: inherit; }

@media (max-width: 860px) {
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat { height: 520px; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .type-pick { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .form-grid-3 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(4, 260px); }
}
