/* Giao diện quản trị — gọn, không phụ thuộc thư viện ngoài. */
:root {
  --red: #d92f47;
  --red-deep: #c92d45;
  --ink: #141c2f;
  --ink-2: #3d4f69;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --ok: #059669;
  --warn: #b45309;
  --radius: 10px;
}
* { box-sizing: border-box; }
/* class có display riêng vẫn phải ẩn khi đặt thuộc tính hidden */
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink-2);
  background: var(--bg);
}
h1, h2, h3, p { margin: 0; }
a { color: var(--red-deep); }
input, select, textarea, button { font: inherit; color: inherit; }
.muted { color: var(--muted); font-size: 12.5px; }
.error { color: var(--red-deep); font-size: 13px; min-height: 18px; margin: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Đăng nhập ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box {
  width: min(380px, 100%); background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 26px; display: grid; gap: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}
.login-box h1 { font-size: 20px; color: var(--ink); }
.login-box label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink); }

/* ---------- Khung ---------- */
#app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-size: 17px; font-weight: 800; color: var(--red-deep); padding: 4px 10px 14px; }
.brand span { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
#nav { display: grid; gap: 2px; overflow-y: auto; flex: 1; align-content: start; }

/* nhóm gập được: bấm tiêu đề để mở/đóng */
.nav-group { display: grid; gap: 2px; }
.nav-group > .nav-group-head {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 12px 10px 5px; border: 0; background: none; cursor: pointer;
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); text-align: left;
}
.nav-group-head .caret { margin-left: auto; transition: transform .18s; font-size: 9px; }
.nav-group[data-open="false"] .nav-group-head .caret { transform: rotate(-90deg); }
.nav-group[data-open="false"] .nav-group-body { display: none; }
.nav-group-body { display: grid; gap: 2px; }

#nav .nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  text-align: left; border: 0; background: none; padding: 8px 10px;
  border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 13.5px;
}
#nav .nav-item:hover { background: var(--bg); }
#nav .nav-item[aria-current="true"] { background: #fff1f2; color: var(--red-deep); font-weight: 700; }
#nav .nav-item .badge {
  margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--bg); border-radius: 999px; padding: 1px 7px;
}
#nav .nav-item[aria-current="true"] .badge { background: #ffe4e6; color: var(--red-deep); }

/* menu con theo thị trường */
.nav-sub { display: grid; gap: 1px; margin: 2px 0 4px 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav-sub[hidden] { display: none !important; }
#nav .nav-sub .nav-item { padding: 6px 10px; font-size: 12.5px; color: var(--muted); }
#nav .nav-sub .nav-item[aria-current="true"] { background: #fff1f2; color: var(--red-deep); }
.nav-sub .flag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar h2 { font-size: 17px; color: var(--ink); flex: 1; min-width: 0; }
.topbar #sidebar-open { display: none; }
#app[data-sidebar="closed"] .topbar #sidebar-open { display: inline-grid; }
.page { padding: 18px 22px 60px; min-width: 0; }

/* ---------- Nút ---------- */
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-weight: 600; color: var(--ink-2);
}
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-deep); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn.danger { color: var(--red-deep); border-color: #fecdd3; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Bảng ---------- */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafc; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pill.on { background: #ecfdf5; color: var(--ok); }
.pill.off { background: #fef2f2; color: var(--red-deep); }
.pill.primary { background: #eff6ff; color: #1d4ed8; }

/* ---------- Form ---------- */
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.field input[type="text"], .field input[type="number"], .field input[type="url"],
.field select, .field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff;
}
.field textarea { min-height: 84px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); }
.i18n-grid { display: grid; gap: 8px; }
.i18n-grid .lang { display: grid; grid-template-columns: 42px 1fr; gap: 8px; align-items: start; }
.i18n-grid .lang > span { font-size: 11px; font-weight: 800; color: var(--muted); padding-top: 9px; text-transform: uppercase; }
.check { display: flex; align-items: center; gap: 8px; }

/* ---------- Hộp thoại ---------- */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal-box { width: min(680px, 100%); max-height: 90vh; display: flex; flex-direction: column; background: #fff; border-radius: 14px; overflow: hidden; }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; }
.modal-head { border-bottom: 1px solid var(--line); }
.modal-foot { border-top: 1px solid var(--line); background: #f8fafc; }
.modal-head h3 { font-size: 16px; color: var(--ink); }
.modal-body { padding: 16px 18px; overflow-y: auto; }

/* ---------- Nhập lô ---------- */
/* Nhập lô: trải hết chiều ngang như các màn bảng; màn rộng thì hai thẻ hướng dẫn
   và file mẫu đứng cạnh nhau, phần chọn file + kết quả chiếm trọn hàng. */
.import-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .import-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .import-grid > .card:nth-child(3), .import-grid > .import-out { grid-column: 1 / -1; }
}
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h3 { font-size: 14px; color: var(--ink); margin-bottom: 8px; }
.summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.summary span { padding: 5px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; background: #f1f5f9; }
.summary .created { background: #ecfdf5; color: var(--ok); }
.summary .skipped { background: #fffbeb; color: var(--warn); }
.summary .failed { background: #fef2f2; color: var(--red-deep); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-weight: 600; z-index: 90;
}
.toast[data-kind="error"] { background: var(--red-deep); }

@media (max-width: 860px) {
  /* Điện thoại: thanh bên thành NGĂN KÉO trượt từ trái, không nằm trong luồng
     trang nữa (trước đây nó đứng phía trên nội dung, chiếm nguyên màn đầu). */
  #app, #app[data-sidebar="closed"] { grid-template-columns: minmax(0, 1fr); }
  .sidebar, #app[data-sidebar="closed"] .sidebar {
    display: flex; position: fixed; top: 0; left: 0; bottom: 0; height: 100dvh;
    width: min(300px, 86vw); z-index: 30; overflow-y: auto;
    transform: translateX(-102%); transition: transform .2s ease;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
  }
  #app[data-drawer="open"] .sidebar { transform: none; }
  /* lớp phủ mờ phía sau ngăn kéo — bấm vào là đóng (xử lý trong admin.js) */
  #app[data-drawer="open"]::before {
    content: ""; position: fixed; inset: 0; z-index: 25; background: rgba(15, 23, 42, .38);
  }
  body.drawer-open { overflow: hidden; }
  .topbar #sidebar-open { display: inline-grid; }
  .toolbar .ss { flex: 1 1 100%; min-width: 0; }
  .ss-menu { max-width: none; width: 100%; }
}

/* =====================================================================
   Thanh công cụ dùng chung cho MỌI màn dữ liệu — tìm kiếm, lọc, đếm.
   ===================================================================== */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px; margin-bottom: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
/* Rule chung phải đứng TRƯỚC ô tìm kiếm — cùng độ ưu tiên thì cái sau thắng,
   đặt sau sẽ ghi đè padding-left và icon ⌕ đè lên chữ. */
.toolbar input[type="text"], .toolbar select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.toolbar select { min-width: 130px; }

.toolbar .search {
  position: relative; flex: 1 1 240px; min-width: 200px;
}
.toolbar .search input[type="text"] { width: 100%; padding: 8px 30px 8px 34px; }
.toolbar .search .ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px; line-height: 1; pointer-events: none;
}
.toolbar .search .clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px;
  line-height: 1; padding: 4px;
}
.toolbar .spacer { flex: 1 1 auto; }
.toolbar .count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* cột sắp xếp được */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--ink); }
th.sortable .arrow { opacity: .3; margin-left: 3px; font-size: 10px; }
th.sortable[aria-sort="ascending"] .arrow,
th.sortable[aria-sort="descending"] .arrow { opacity: 1; color: var(--red-deep); }
th.sortable[aria-sort="descending"] .arrow { display: inline-block; transform: rotate(180deg); }

.empty { padding: 34px 16px; text-align: center; color: var(--muted); }

.pager { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* nhãn nhóm giữa bảng (ví dụ: tiêu đề thị trường) */
.group-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 20px 0 8px;
}
.group-head h3 { font-size: 14px; color: var(--ink); }
.group-head .stat-note { font-size: 12.5px; color: var(--muted); }

/* thẻ tóm tắt ở đầu màn */
.summary-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.summary-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.summary-card .k { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.summary-card .v { margin-top: 4px; font-size: 19px; font-weight: 800; color: var(--ink); }
.summary-card .s { font-size: 12px; color: var(--muted); }

/* =====================================================================
   Nội dung đa ngôn ngữ — dạng thẻ, xem ba bản dịch cạnh nhau
   ===================================================================== */
.i18n-list { display: grid; gap: 10px; }

.i18n-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: border-color .18s, box-shadow .18s;
}
.i18n-card:hover { border-color: var(--line-2); box-shadow: 0 2px 10px rgba(15,23,42,.05); }

.i18n-card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid var(--line);
}
.i18n-card-head code { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.i18n-card-head .group-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--red-deep); background: #fff1f2; padding: 2px 8px; border-radius: 999px;
}
.i18n-card-head .btn { margin-left: auto; }

/* ba cột song song, mỗi cột một ngôn ngữ */
.i18n-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.i18n-col { padding: 11px 14px; border-right: 1px solid var(--line); min-width: 0; }
.i18n-col:last-child { border-right: 0; }
.i18n-col .lang-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: var(--muted);
  margin-bottom: 5px; text-transform: uppercase;
}
.i18n-col .lang-tag .src { color: var(--ok); font-weight: 700; text-transform: none; letter-spacing: 0; }
.i18n-col .val { font-size: 13px; line-height: 1.5; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.i18n-col .val.missing { color: var(--warn); font-style: italic; }

/* trong hộp thoại: cột trái nhập, cột phải xem trước */
.i18n-edit { display: grid; gap: 12px; }
.i18n-edit-row {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr); gap: 10px;
  align-items: start;
}
.i18n-edit-row > .tag {
  font-size: 11px; font-weight: 800; color: var(--muted); padding-top: 9px; text-transform: uppercase;
}
.i18n-edit-row textarea, .i18n-edit-row input[type="text"] {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
}
.i18n-edit-row textarea { min-height: 76px; resize: vertical; }
.i18n-preview {
  padding: 8px 10px; border: 1px dashed var(--line-2); border-radius: 8px;
  background: #f8fafc; font-size: 13px; line-height: 1.55; color: var(--ink-2);
  white-space: pre-wrap; word-break: break-word; min-height: 38px;
}
.i18n-preview:empty::before { content: "— chưa có bản dịch, trang sẽ hiện bản tiếng Anh —"; color: var(--warn); font-style: italic; }
.i18n-edit-legend {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr); gap: 10px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}

@media (max-width: 980px) {
  .i18n-cols { grid-template-columns: minmax(0, 1fr); }
  .i18n-col { border-right: 0; border-bottom: 1px solid var(--line); }
  .i18n-col:last-child { border-bottom: 0; }
  .i18n-edit-row, .i18n-edit-legend { grid-template-columns: 44px minmax(0, 1fr); }
  .i18n-edit-row .i18n-preview, .i18n-edit-legend span:last-child { display: none; }
}

/* =====================================================================
   Nút thu/mở thanh bên
   ===================================================================== */
.sidebar-toggle {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  cursor: pointer; color: var(--ink-2);
}
.sidebar-toggle:hover { background: var(--bg); }
.sidebar-toggle .bars { display: grid; gap: 3px; }
.sidebar-toggle .bars span { display: block; width: 15px; height: 2px; background: currentColor; border-radius: 2px; }

.brand-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px 14px; }
.brand-row .brand { padding: 0; flex: 1; min-width: 0; }

/* Thu gọn: thanh bên bị display:none nên phải về MỘT cột,
   để 0 1fr thì .main rơi vào cột rộng 0 và nội dung bị bóp lại. */
#app[data-sidebar="closed"] { grid-template-columns: minmax(0, 1fr); }
#app[data-sidebar="closed"] .sidebar { display: none; }

/* =====================================================================
   Dropdown có tìm kiếm — dùng khi danh sách dài (thương hiệu, thị trường…)
   ===================================================================== */
.ss { position: relative; }

.ss-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; cursor: pointer; text-align: left; color: var(--ink-2);
}
.ss-toggle:hover { border-color: var(--line-2); }
.ss-toggle .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-toggle .caret { font-size: 9px; color: var(--muted); }
.toolbar .ss { flex: 0 0 auto; min-width: 176px; }

.ss-menu {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0;
  min-width: 100%; width: max-content; max-width: 320px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
  display: none; overflow: hidden;
}
.ss[data-open="true"] .ss-menu { display: block; }

.ss-search { padding: 8px; border-bottom: 1px solid var(--line); }
.ss-search input { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; }

/* Danh sách luôn cuộn, không đổ hết chiều cao màn hình */
.ss-list { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; }
.ss-option {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 9px; border: 0; background: none; border-radius: 7px;
  cursor: pointer; text-align: left; font-size: 13.5px; color: var(--ink-2);
}
.ss-option:hover, .ss-option[data-active="true"] { background: var(--bg); }
.ss-option[aria-selected="true"] { background: #fff1f2; color: var(--red-deep); font-weight: 700; }
.ss-option .tick { margin-left: auto; opacity: 0; color: var(--red-deep); }
.ss-option[aria-selected="true"] .tick { opacity: 1; }
.ss-option .sub { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.ss-empty { padding: 14px 10px; text-align: center; color: var(--muted); font-size: 12.5px; }
.ss-count { padding: 6px 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }

/* Trong hộp thoại form */
.field .ss-toggle { padding: 8px 10px; }

/* =====================================================================
   Kéo-thả đổi thứ tự hiển thị
   ===================================================================== */
tr[draggable="true"] { cursor: default; }
tr[draggable="true"].dragging { opacity: .4; }
tr.drop-before td { box-shadow: inset 0 2px 0 var(--red); }
tr.drop-after td { box-shadow: inset 0 -2px 0 var(--red); }

td.grip, th.grip { width: 34px; padding-left: 10px; padding-right: 0; }
.grip-handle {
  display: grid; place-items: center; width: 22px; height: 26px;
  border-radius: 6px; color: var(--line-2); cursor: grab; user-select: none;
  font-size: 13px; line-height: 1;
}
.grip-handle:hover { color: var(--muted); background: var(--bg); }
.grip-handle:active { cursor: grabbing; }

.reorder-hint {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; font-size: 12.5px; color: var(--muted);
}
.reorder-hint .badge-live {
  background: #fff1f2; color: var(--red-deep); font-weight: 700;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px;
}

/* Dòng đang ẩn khỏi trang công khai — làm mờ để nhìn phát biết */
tr.row-off td { opacity: .5; }
tr.row-off td.actions { opacity: 1; }

/* Số vị trí trong danh sách sắp xếp được */
.pos {
  display: inline-block; min-width: 30px; padding: 1px 7px;
  border-radius: 999px; background: var(--bg); color: var(--muted);
  font-size: 12px; font-weight: 700; text-align: center;
}

.btn.warn { color: var(--warn); border-color: #fde68a; }
.btn.warn:hover { background: #fffbeb; }

/* ---------- Bộ chọn ngôn ngữ giao diện (EN mặc định · VI · ZH) ---------- */
.lang-switch { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.lang-switch.login-lang { justify-self: end; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em;
  transition: background .15s, color .15s;
}
.lang-btn img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgba(15, 23, 42, .08); }
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-pressed="true"] { background: #fff; color: var(--red-deep); box-shadow: 0 1px 4px rgba(15, 23, 42, .1); }
.sidebar-foot .lang-switch { justify-self: start; }

/* ---------- Tài khoản của tôi ---------- */
.who {
  border: 0; background: none; padding: 2px 0; text-align: left; cursor: pointer;
  font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.who:hover { color: var(--red-deep); text-decoration: underline; }
/* Tài khoản: trải hết chiều ngang như các màn khác; màn rộng thì thẻ tóm tắt
   chiếm trọn hàng, hai form sửa thông tin / đổi mật khẩu đứng cạnh nhau. */
.profile-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-grid > .card:first-child { grid-column: 1 / -1; }
}
.profile-head { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: #fff1f2; color: var(--red-deep); font-weight: 800; font-size: 18px; letter-spacing: .02em;
  border: 1px solid #fecdd3; flex: none;
}
.profile-head .name { font-size: 16px; font-weight: 800; color: var(--ink); }
.profile-head .email { font-size: 13px; color: var(--muted); }
.profile-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 14px; }
.profile-meta .k { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.profile-meta .v { margin-top: 2px; font-weight: 700; color: var(--ink); }
.card .lead { margin: -2px 0 12px; }
.card form .field:last-of-type { margin-bottom: 14px; }
.field input[type="password"], .field input[type="email"] {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.role-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--bg); color: var(--ink-2); }
