/* =========================================================================
   MK Vision · Quản lý tài sản — Design system
   Font: Be Vietnam Pro (thiết kế riêng cho tiếng Việt, dấu rõ ràng)
   Thang chữ: 12 · 13 · 14 · 16 · 20 · 28 px   |   Lưới khoảng cách: 4px
   ========================================================================= */

:root {
  /* Typography */
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --fs-xs: 12px;   /* nhãn phụ, chú thích – cỡ nhỏ nhất */
  --fs-sm: 13px;   /* bảng, nhãn form, mô tả */
  --fs-base: 14px; /* nội dung chính, nút, ô nhập */
  --fs-md: 16px;   /* tiêu đề khối */
  --fs-lg: 20px;   /* tiêu đề hộp thoại, số liệu phụ */
  --fs-xl: 28px;   /* tiêu đề trang, số liệu chính */
  --lh: 1.55;

  /* Màu chữ (đều đạt tương phản WCAG AA trên nền trắng) */
  --ink: #18223a;
  --text: #3a4760;
  --muted: #5f6b80;
  --subtle: #8a94a6; /* chỉ dùng cho chi tiết trang trí */

  /* Bề mặt & đường kẻ */
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-alt: #f8f9fc;
  --line: #e4e8f0;
  --line-soft: #eef1f6;

  /* Màu thương hiệu */
  --blue: #3f63e0;
  --blue-dark: #2f4fc4;
  --blue-soft: #edf1ff;
  --blue-ring: #a9baff;

  /* Màu trạng thái */
  --green: #1a7f56;   --green-soft: #e8f6ef;
  --amber: #a86410;   --amber-soft: #fff4e2;
  --red: #c0392f;     --red-soft: #fdeeed;
  --violet: #6a4cc4;  --violet-soft: #f1edff;
  --pink: #b0457a;    --pink-soft: #fdeef5;

  /* Hình khối */
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(24, 34, 58, .05);
  --shadow: 0 2px 8px rgba(24, 34, 58, .06);
  --shadow-lg: 0 24px 64px rgba(16, 28, 55, .22);
  --control-h: 40px;

  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.3; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--blue-ring); outline-offset: 2px;
}
[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* ---------- App shell & sidebar ---------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 5;
  width: 256px; padding: 24px 16px 16px;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; color: var(--ink); text-decoration: none; }
.brand-logo { display: block; width: 140px; height: auto; object-fit: contain; }
.brand-light { font-weight: 500; color: var(--muted); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 800; }

.workspace-label, .eyebrow {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle);
}
.workspace-label { margin: 32px 12px 10px; }

.main-nav { display: grid; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: var(--r);
  background: transparent; color: var(--text); text-align: left;
  font-size: var(--fs-base); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-alt); color: var(--ink); }
.nav-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; box-shadow: inset 3px 0 0 var(--blue); }
.nav-icon { width: 20px; font-size: 17px; text-align: center; line-height: 1; }
.nav-count { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
.nav-badge:empty { display: none; }
.nav-badge { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: var(--fs-xs); font-weight: 700; }

.sidebar-bottom { margin-top: auto; padding-top: 16px; }
.help-card { margin: 0 0 16px; padding: 16px; border-radius: var(--r-lg); background: var(--surface-alt); border: 1px solid var(--line-soft); }
.help-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-bottom: 8px; border-radius: var(--r); background: var(--blue-soft); color: var(--blue); }
.help-icon:empty::before { content: "?"; font-weight: 700; font-size: var(--fs-base); }
.help-card strong { display: block; font-size: var(--fs-base); font-weight: 600; }
.help-card p { margin: 4px 0 10px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; overflow-wrap: anywhere; }
.help-card a { display: flex; justify-content: space-between; font-size: var(--fs-sm); font-weight: 600; color: var(--blue); text-decoration: none; }
.help-card a:hover { text-decoration: underline; }

.profile-row { display: flex; align-items: center; gap: 10px; padding: 16px 4px 0; border-top: 1px solid var(--line); }
.avatar { flex: 0 0 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: var(--fs-sm); font-weight: 700; }
.profile-info { flex: 1; min-width: 0; display: grid; gap: 1px; }
.profile-info strong { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-info span { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-button { flex: none; width: 36px; min-height: 36px; height: 36px; margin-left: auto; padding: 0; box-shadow: none; }
.logout-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.logout-icon { font-size: 16px; line-height: 1; }

/* ---------- Main area & topbar ---------- */
.main-area { margin-left: 256px; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 4;
  height: 64px; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.breadcrumbs { min-width: 0; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumbs span { padding: 0 8px; color: var(--subtle); }
.breadcrumbs strong { color: var(--ink); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.today-label { color: var(--muted); font-size: var(--fs-sm); }

.page-content { max-width: 1440px; margin: 0 auto; padding: 32px 32px 48px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 24px; }
.page-heading .eyebrow { margin: 0 0 6px; color: var(--blue); }
.page-heading h1 { margin: 0; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; }
.page-heading p.muted { margin: 6px 0 0; font-size: var(--fs-base); }
.wave { color: #e9a93b; font-size: .7em; vertical-align: middle; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--control-h); padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--r);
  font-size: var(--fs-base); font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.button-primary { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(63, 99, 224, .3); }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); }
.button-secondary { background: var(--surface); border-color: var(--line); color: var(--text); }
.button-secondary:hover { background: var(--surface-alt); border-color: #cfd6e3; color: var(--ink); }
.button-danger { background: var(--red-soft); border-color: #f4d3d0; color: var(--red); }
.button-danger:hover { background: #fbe0de; }
.button-small { min-height: 34px; padding: 0 12px; font-size: var(--fs-sm); }
.button-wide { width: 100%; min-height: 44px; }
.text-button { padding: 4px 6px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--blue); font-size: var(--fs-sm); font-weight: 600; }
.text-button:hover { background: var(--blue-soft); }
.text-button span { margin-left: 4px; }

/* ---------- Cards & stats ---------- */
.stat-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { min-height: 128px; padding: 20px; display: flex; flex-direction: column; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.stat-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; font-size: 16px; font-weight: 700; }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.amber { color: var(--amber); background: var(--amber-soft); }
.stat-icon.violet { color: var(--violet); background: var(--violet-soft); }
.stat-card > strong { display: block; margin: 8px 0 auto; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.stat-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: var(--fs-xs); }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.dot-blue { background: var(--blue); }
.dot-green { background: #2fa877; }
.dot-amber { background: #e3a23a; }
.dot-violet { background: #8a6be0; }

.company-overview { margin-bottom: 20px; }
.company-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 0 20px 20px; }
.company-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-alt); }
.company-tile strong { color: var(--ink); font-size: 26px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.company-tile small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.45; }
.company-label { color: var(--text); font-size: var(--fs-sm); font-weight: 500; }
.company-tile-primary { border-color: #cfe9dc; background: var(--green-soft); }
.company-tile-primary strong { color: var(--green); }
.stat-filter { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.stat-filter:hover { border-color: #b4c3fb; box-shadow: var(--shadow); }
.stat-filter:active { transform: translateY(1px); }
.stat-filter.is-active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(63, 99, 224, .12); }
.department-chart .dept-item { display: block; width: 100%; padding: 10px 12px; margin: 0; border: 1px solid transparent; border-radius: var(--r); background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.department-chart .dept-item:hover { background: var(--surface-alt); }
.department-chart .dept-item.is-active { border-color: var(--blue); background: var(--blue-soft); }
.overview-assets { margin-bottom: 20px; scroll-margin-top: 80px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 16px; margin-bottom: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 16px; }
.panel-heading h2 { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.panel-heading p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.panel-menu { font-size: 20px; color: var(--subtle); letter-spacing: 2px; }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; text-align: left; }
.data-table th {
  position: sticky; top: 0; z-index: 1;
  padding: 10px 16px; background: var(--surface-alt);
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text); font-size: var(--fs-sm); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #f7f9ff; }
.data-table td .role-pill { margin: 2px; }
.data-table td.action-cell { white-space: nowrap; }
.action-cell > * + * { margin-left: 6px; }

.asset-name { display: flex; align-items: center; gap: 12px; }
.asset-icon { flex-shrink: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r); background: var(--blue-soft); color: var(--blue); font-size: 16px; }
.asset-primary { display: block; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.asset-secondary { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-xs); }
.code-label, .asset-code-link { color: var(--text); font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.asset-link { display: inline-flex; align-items: center; gap: 12px; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.asset-link:hover .asset-primary, .asset-code-link:hover { color: var(--blue); text-decoration: underline; }
.asset-link:focus-visible { outline: 3px solid var(--blue-ring); outline-offset: 3px; border-radius: 4px; }
.asset-name-link .asset-primary { font-size: var(--fs-sm); }
.data-table .asset-name-link { min-width: 200px; max-width: 280px; white-space: normal; }
.data-table .asset-name-link .asset-secondary { overflow-wrap: anywhere; }

.person-cell { display: flex; align-items: center; gap: 8px; }
.mini-avatar { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 700; }

/* ---------- Pills & badges ---------- */
.status-pill, .role-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-usable, .status-completed { color: var(--green); background: var(--green-soft); }
.status-unusable, .status-pending { color: var(--amber); background: var(--amber-soft); }
.status-rejected { color: var(--red); background: var(--red-soft); }
.role-pill, .role-employee { background: #eef1f6; color: var(--text); }
.role-admin { background: var(--violet-soft); color: var(--violet); }
.role-it { background: var(--blue-soft); color: var(--blue-dark); }
.role-hr { background: var(--pink-soft); color: var(--pink); }
.role-manager { background: var(--green-soft); color: var(--green); }
.count-pill { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #eef1f6; color: var(--text); font-size: var(--fs-xs); font-weight: 600; }

.row-action { width: 32px; height: 32px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: 16px; font-weight: 700; }
.row-action:hover { background: var(--blue-soft); color: var(--blue); }
.table-button {
  min-height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-xs); font-weight: 600;
}
.table-button:hover { border-color: #b4c3fb; color: var(--blue); background: #f7f9ff; }
.table-button.transfer-row-button { color: var(--blue); border-color: #d6defb; }
.table-button.recipient-accept { border-color: #c9e8d9; background: var(--green-soft); color: var(--green); }
.table-button.recipient-accept:hover { border-color: #9fd5bb; color: #136342; }
.table-button.recipient-reject { border-color: #f1d1ce; background: var(--red-soft); color: var(--red); }
.table-button.recipient-reject:hover { border-color: #e5aea8; color: #9d2b22; }
.transfer-pending-note { display: inline-block; margin: 0; padding: 3px 10px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-weight: 600; }
.transfer-actions { display: flex; align-items: center; gap: 6px; }

.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); font-size: var(--fs-base); }

/* ---------- Overview: pending + department ---------- */
.pending-list { padding: 0 20px 8px; }
.pending-item { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.pending-symbol { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r); background: var(--amber-soft); color: var(--amber); font-size: 14px; }
.pending-copy { flex: 1; min-width: 0; }
.pending-copy strong { display: block; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.pending-copy p { margin: 2px 0 4px; color: var(--muted); font-size: var(--fs-xs); }
.pending-copy button { padding: 2px 0; border: 0; background: transparent; color: var(--blue); font-size: var(--fs-xs); font-weight: 600; }
.pending-copy button:hover { text-decoration: underline; }
.pending-empty { padding: 36px 12px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }

.department-panel { margin-bottom: 20px; }
.department-chart { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: 0 10px 14px; }
.dept-item { min-width: 0; }
.dept-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--text); font-size: var(--fs-sm); }
.dept-label strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; border-radius: 999px; background: #edf0f6; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--blue); }

/* ---------- Toolbar & form controls ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.toolbar-title { font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.search-box {
  height: var(--control-h); min-width: 280px;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--muted);
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(63, 99, 224, .15); }
.search-box span { font-size: 18px; line-height: 1; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: var(--fs-base); color: var(--ink); }
.search-box input::placeholder { color: var(--subtle); }

.toolbar select,
.form-field select, .form-field input, .form-field textarea,
.form-stack input, .user-picker-search {
  min-width: 140px; min-height: var(--control-h); padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font-size: var(--fs-base);
  transition: border-color .15s, box-shadow .15s;
}
.toolbar select:hover, .form-field select:hover, .form-field input:hover, .form-field textarea:hover, .form-stack input:hover { border-color: #cbd3e1; }
.toolbar select:focus, .form-field select:focus, .form-field input:focus, .form-field textarea:focus,
.form-stack input:focus, .user-picker-search:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(63, 99, 224, .15);
}
.form-field input::placeholder, .form-field textarea::placeholder, .form-stack input::placeholder, .user-picker-search::placeholder { color: var(--subtle); }
.result-count { margin-left: auto; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: var(--fs-xs); }

/* ---------- Trang cá nhân ---------- */
.profile-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; margin: -6px; padding: 6px; border: 0; border-radius: var(--r); background: transparent; text-align: left; color: inherit; }
.profile-link:hover { background: var(--surface-alt); }
.profile-layout { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.4fr); gap: 16px; margin-bottom: 20px; align-items: start; }
.profile-card { padding: 20px; }
.profile-card-head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.profile-card-head h2 { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.profile-card-head p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.profile-avatar { flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font-size: 18px; font-weight: 700; }
.profile-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 16px 0; }
.profile-details dt { color: var(--muted); font-size: var(--fs-xs); }
.profile-details dd { margin: 2px 0 0; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.profile-roles { padding-top: 14px; border-top: 1px solid var(--line-soft); }
.profile-roles > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: var(--fs-xs); }
.profile-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-stats .summary-tile strong { font-size: var(--fs-md); }
.profile-actions { display: flex; justify-content: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.profile-actions .button { width: 100%; }
.password-strength { gap: 4px; }
.strength-bar { height: 6px; border-radius: 999px; background: #edf0f6; overflow: hidden; }
.strength-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--red); transition: width .2s, background .2s; }
.strength-bar span[data-level="2"] { background: #e07a3a; }
.strength-bar span[data-level="3"] { background: #e3a23a; }
.strength-bar span[data-level="4"] { background: #2fa877; }
.strength-bar span[data-level="5"] { background: var(--green); }
.password-strength small { color: var(--muted); font-size: var(--fs-xs); }
.password-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-alt); list-style: none; font-size: var(--fs-sm); color: var(--muted); }
.password-rules li { display: flex; align-items: flex-start; gap: 8px; }
.password-rules em { font-style: normal; color: var(--subtle); font-size: var(--fs-xs); }
.rule-mark { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #eef1f6; color: var(--subtle); font-size: 11px; font-weight: 700; }
.password-rules li.is-ok { color: var(--ink); }
.password-rules li.is-ok .rule-mark { background: var(--green-soft); color: var(--green); }
@media (max-width: 600px) { .password-rules { grid-template-columns: 1fr; } }
.profile-stat { display: block; width: 100%; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.profile-stat:hover { border-color: #b4c3fb; box-shadow: var(--shadow); }
.profile-stat:active { transform: translateY(1px); }
.profile-stat.is-warning strong { color: var(--amber); }
.profile-tabs-panel { overflow: hidden; }
.profile-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); background: var(--surface-alt); overflow-x: auto; }
.profile-tab { display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; padding: 12px 16px; border: 1px solid transparent; border-bottom: 0; border-radius: var(--r) var(--r) 0 0; background: transparent; color: var(--muted); font-size: var(--fs-base); font-weight: 600; white-space: nowrap; }
.profile-tab:hover { color: var(--ink); }
.profile-tab.is-active { border-color: var(--line); background: var(--surface); color: var(--blue); box-shadow: inset 0 3px 0 var(--blue); }
.profile-tab .count-pill { margin-left: 0; }
.profile-tab.is-active .count-pill { background: var(--blue-soft); color: var(--blue-dark); }
.access-session { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: var(--text); font-size: var(--fs-sm); }
.access-session strong { color: var(--ink); }
.access-session-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.access-event { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; }
.access-completed { background: var(--green-soft); color: var(--green); }
.access-neutral { background: #eef1f6; color: var(--text); }
.access-ip { color: var(--text); font-size: var(--fs-xs); }
@media (max-width: 1100px) { .profile-layout { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .profile-link { display: none; } }
@media (max-width: 600px) {
  .profile-card { padding: 16px; }
  .profile-details { gap: 10px 12px; margin: 12px 0; }
  .profile-stats { gap: 8px; }
  .profile-stats .summary-tile { padding: 12px; }
  .profile-stats .summary-tile strong { font-size: var(--fs-base); }
  .profile-tab { padding: 10px 12px; font-size: var(--fs-sm); }
  .access-session { flex-basis: 100%; }
}

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; padding: 12px 20px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: var(--fs-sm); }
.pager-summary { margin-right: auto; font-variant-numeric: tabular-nums; }
.pager-summary strong { color: var(--ink); font-weight: 600; }
.pager-size { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pager-size select { min-height: 32px; padding: 4px 28px 4px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); cursor: pointer; }
.pager-size select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(63, 99, 224, .15); }
.pager-pages { display: flex; align-items: center; gap: 4px; }
.pager-button { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: 500; font-variant-numeric: tabular-nums; transition: background .12s, border-color .12s, color .12s; }
.pager-button:hover:not(:disabled):not(.is-current) { border-color: #b4c3fb; background: #f7f9ff; color: var(--blue); }
.pager-button.is-current { border-color: var(--blue); background: var(--blue); color: #fff; font-weight: 700; cursor: default; }
.pager-button:disabled { opacity: .4; cursor: not-allowed; }
.pager-gap { min-width: 20px; color: var(--subtle); text-align: center; }

/* ---------- Transfers & people ---------- */
.transfer-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0 0 20px; }
.summary-tile { padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.summary-tile span { display: block; color: var(--muted); font-size: var(--fs-sm); }
.summary-tile strong { display: block; margin-top: 4px; color: var(--ink); font-size: 24px; font-weight: 700; line-height: 1.25; }
.summary-tile small { color: var(--muted); font-size: var(--fs-xs); }

.people-stats { display: flex; gap: 12px; margin-bottom: 20px; }
.people-stat { min-width: 150px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.people-stat strong { font-size: 22px; font-weight: 700; }
.people-stat span { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-xs); }
.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 20px; }
.person-card { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.person-head { display: flex; align-items: center; gap: 12px; }
.person-avatar { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: var(--fs-sm); font-weight: 700; }
.person-head strong { font-size: var(--fs-base); font-weight: 600; }
.person-head span { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-xs); }
.people-card-code { margin-top: 2px !important; color: var(--muted) !important; font-size: var(--fs-xs) !important; }
.person-card-bottom { display: flex; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: var(--fs-xs); }
.person-card-bottom strong { color: var(--ink); }

.employee-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.employee-columns-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); background: var(--surface-alt); color: var(--text); font-size: var(--fs-sm); }
.employee-columns-options { display: flex; align-items: center; gap: 6px 16px; flex: 1; flex-wrap: wrap; }
.employee-columns-options label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.employee-columns-options input { width: 16px; height: 16px; accent-color: var(--blue); }
.employee-table { min-width: 720px; }

/* ---------- Permissions ---------- */
.permission-note {
  display: flex; gap: 12px; margin-bottom: 20px; padding: 16px 20px;
  border: 1px solid #d9e1fb; border-radius: var(--r-lg); background: #f3f6ff; color: var(--blue); font-size: 18px;
}
.permission-note strong { font-size: var(--fs-base); color: var(--blue-dark); }
.permission-note p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text); line-height: 1.6; }
.permission-panel { margin-bottom: 20px; }
.user-groups-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; padding: 0 20px 20px; }
.user-group-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.user-group-card > div:first-child { min-width: 0; }
.user-group-card strong, .user-group-card span { display: block; }
.user-group-card strong { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.user-group-card span { margin-top: 2px; font-size: var(--fs-xs); color: var(--muted); }
.group-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

.permission-groups { display: grid; gap: 16px; margin-bottom: 20px; }
.permission-group-card { padding: 20px; }
.permission-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.permission-group-heading h2 { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.permission-group-heading p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.permission-member-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.permission-member-columns fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); }
.permission-member-columns legend { padding: 0 6px; color: var(--text); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.permission-member-list { display: grid; gap: 2px; max-height: 240px; overflow: auto; }
.permission-member-list label { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-sm); cursor: pointer; }
.permission-member-list label:hover { background: var(--surface-alt); }
.permission-member-list input { flex: 0 0 16px; width: 16px; height: 16px; min-width: 0; min-height: 0; margin: 2px 0 0; padding: 0; accent-color: var(--blue); }
.form-field input[type="checkbox"], .form-field input[type="radio"] { width: 16px; height: 16px; min-width: 0; min-height: 0; padding: 0; accent-color: var(--blue); }
.permission-member-list label span { min-width: 0; }
.permission-member-list small { display: block; margin-top: 1px; color: var(--muted); font-size: var(--fs-xs); }
.form-field > label:not(.role-checkbox):not(.policy-option) { display: block; }
.permission-member-columns.is-single { grid-template-columns: 1fr; }
.extra-pill { background: var(--amber-soft); color: var(--amber); }
.role-checkbox .extra-permission-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 6px; background: var(--blue-soft); color: var(--blue); font-size: 12px; vertical-align: -3px; }
.extra-grant-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.extra-grant-includes { font-weight: 400; margin: 6px 0 0; padding: 6px 0 0 16px; border-top: 1px dashed var(--line); color: var(--text); font-size: var(--fs-xs); line-height: 1.5; }
.extra-grant-includes li::marker { color: var(--blue); }
@media (max-width: 800px) { .extra-grant-grid { grid-template-columns: 1fr; } }
.extra-permission-note { display: block; margin-top: 2px; color: var(--green); font-style: normal; font-weight: 500; }
.restricted-panel { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 20px; }
.restricted-panel h2 { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.restricted-panel p { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.restricted-panel > div { flex: 1; min-width: 0; }
.restricted-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 20px; font-weight: 700; }
@media (max-width: 600px) { .restricted-panel { flex-direction: column; align-items: flex-start; } }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 12px; }
.section-heading h2 { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.section-heading p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.group-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #eef1f6; color: var(--text); font-size: 11px; font-weight: 600; vertical-align: 2px; }
.group-tag-system { background: var(--violet-soft); color: var(--violet); }
.group-tag-custom { background: var(--green-soft); color: var(--green); }
.policy-editor { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-alt); }
.policy-editor > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.policy-editor > summary::-webkit-details-marker { display: none; }
.policy-editor > summary::before { content: "▸"; margin-right: 4px; color: var(--muted); transition: transform .15s; }
.policy-editor[open] > summary::before { transform: rotate(90deg); }
.policy-editor > summary > span:first-child { flex: 1; }
.policy-editor > summary:hover { color: var(--blue); }
.policy-count { padding: 1px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; }
.policy-editor > .policy-category-grid { padding: 0 14px 14px; }
.policy-category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.policy-category { min-width: 0; margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.policy-category legend { padding: 0 6px; color: var(--blue); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.policy-option { display: flex !important; align-items: flex-start; gap: 10px; padding: 7px 6px; border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-sm); font-weight: 400 !important; line-height: 1.45; cursor: pointer; }
.policy-option:hover { background: var(--surface-alt); }
.policy-option:has(input:checked) { color: var(--ink); }
.policy-option input { flex: 0 0 16px; width: 16px !important; height: 16px; min-width: 0 !important; min-height: 0 !important; margin: 1px 0 0; padding: 0 !important; accent-color: var(--blue); }
.policy-option small { display: block; margin-top: 1px; color: var(--violet); font-size: 11px; }
.policy-option.is-locked { cursor: not-allowed; }
.permission-policy-list { display: grid; gap: 8px; margin: 0; padding: 4px 4px 2px; list-style: none; color: var(--text); font-size: var(--fs-sm); line-height: 1.5; }
.permission-policy-list li { display: flex; align-items: flex-start; gap: 10px; }
.permission-member-list-form { max-height: 280px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r); }

.role-checkbox-heading { color: var(--text); font-size: var(--fs-sm); font-weight: 600; }
.role-checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.role-checkbox { display: flex !important; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.role-checkbox:hover, .role-checkbox:focus-within { border-color: #b4c3fb; background: #f7f9ff; }
.role-checkbox:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.role-checkbox input { flex: 0 0 16px; width: 16px; height: 16px; min-width: 16px; min-height: 0; margin: 2px 0 0; padding: 0; accent-color: var(--blue); }
.role-checkbox span { display: grid; gap: 2px; }
.role-checkbox strong { font-size: var(--fs-sm); color: var(--ink); }
.role-checkbox small { font-size: var(--fs-xs); color: var(--muted); line-height: 1.45; font-weight: 400; }

/* ---------- Login ---------- */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 1fr) minmax(360px, .9fr); background: var(--surface); }
.login-card { width: min(400px, calc(100% - 48px)); margin: auto; padding: 40px 0; }
.login-logo { display: block; width: min(200px, 70%); height: auto; margin: 0 auto 24px; object-fit: contain; }
.login-card h1, .login-title { margin: 0 0 28px; text-align: center; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.login-card .eyebrow { margin: 0 0 8px; color: var(--blue); }
.login-card > p.muted { margin: 0 0 24px; font-size: var(--fs-base); }
.brand-login { padding: 0; margin-bottom: 48px; }

.form-stack { display: grid; gap: 16px; }
.form-stack label, .form-field label { display: grid; gap: 6px; color: var(--text); font-size: var(--fs-sm); font-weight: 600; }
.form-stack input { width: 100%; height: 44px; }
.form-error { margin: 0; padding: 10px 12px; border-radius: var(--r); background: var(--red-soft); color: var(--red); font-size: var(--fs-sm); }
.login-password-field { display: grid; gap: 6px; }
.password-input-wrap { position: relative; }
.password-input-wrap input { width: 100%; padding-right: 64px; }
.password-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); padding: 6px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--blue); font-size: var(--fs-sm); font-weight: 600; }
.password-toggle:hover { background: var(--blue-soft); }

.password-policy { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-alt); color: var(--text); font-size: var(--fs-sm); line-height: 1.55; }
.password-policy-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.password-policy-head strong { color: var(--ink); font-size: var(--fs-base); font-weight: 600; }
.password-policy-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r); background: var(--blue-soft); font-size: 14px; }
.password-policy-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.password-policy-list li { display: flex; align-items: flex-start; gap: 10px; }
.policy-mark { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 700; }
.password-policy-list .is-required { color: var(--ink); }
.password-policy-list .is-required .policy-mark { background: var(--blue); color: #fff; }
.policy-tag { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: 11px; font-style: normal; font-weight: 600; vertical-align: 1px; }
.password-policy-foot { margin: 12px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); }
.password-policy-foot b { color: var(--ink); font-weight: 600; }

.login-aside {
  position: relative; overflow: hidden; padding: 12%;
  display: flex; flex-direction: column; justify-content: center;
  color: #fff; background: #172541;
  background-image: radial-gradient(ellipse at 60% 45%, #2a4475 0, transparent 60%), linear-gradient(145deg, #1a2a4b, #101a31);
}
.aside-orb { position: absolute; top: 15%; right: -110px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(130, 149, 197, .17); box-shadow: 0 0 0 38px rgba(130, 149, 197, .045), 0 0 0 78px rgba(130, 149, 197, .03); }
.aside-orb::after { content: ""; position: absolute; inset: 60px; border-radius: 50%; border: 1px solid rgba(130, 149, 197, .12); }
.aside-label { position: relative; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .16em; color: #a9bfff; }
.login-aside h2 { position: relative; margin: 16px 0 12px; color: #fff; font-size: 40px; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }
.login-aside > p { position: relative; max-width: 360px; margin: 0; color: #c3cee3; font-size: var(--fs-md); line-height: 1.7; }
.aside-foot { position: absolute; bottom: 32px; color: #8e9cb8; font-size: var(--fs-xs); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(16, 26, 49, .45); backdrop-filter: blur(2px); animation: fade-in .15s ease-out; }
.modal { width: min(580px, 100%); max-height: min(90vh, 860px); overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); animation: modal-in .18s ease-out; }
.modal.modal-wide { width: min(780px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.modal-header h2 { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.modal-header p { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.modal-close { flex: none; width: 36px; height: 36px; margin: -6px -8px 0 0; border: 0; border-radius: var(--r); background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
.modal-close:hover { background: var(--surface-alt); color: var(--ink); }
.modal-body { padding: 20px 24px; }
.modal-footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; background: var(--surface); border-top: 1px solid var(--line-soft); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: grid; gap: 6px; align-content: start; }
.form-field.full { grid-column: 1 / -1; }
.form-field input, .form-field select, .form-field textarea { width: 100%; }
.form-field textarea { min-height: 88px; resize: vertical; line-height: var(--lh); }
.field-hint, .field-help { color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
.form-section-title { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--ink); font-size: var(--fs-base); font-weight: 600; line-height: 1.45; }
.info-strip { padding: 12px 14px; border-radius: var(--r); background: #f3f6ff; border: 1px solid #e0e7fd; color: var(--text); font-size: var(--fs-sm); line-height: 1.55; }

/* ---------- Danh mục bộ phận ---------- */
.department-add-toggle { justify-self: start; }
.department-inline-add { display: flex; gap: 8px; align-items: center; }
.department-inline-add[hidden] { display: none; }
.department-inline-add input { flex: 1; min-width: 0; }
.department-table tr.is-muted td { color: var(--muted); }
.department-table .group-card-actions { justify-content: flex-end; flex-wrap: wrap; }
.table-button.table-button-danger { color: var(--red); border-color: #f1d1ce; }
.table-button.table-button-danger:hover { background: var(--red-soft); border-color: #e5aea8; color: #9d2b22; }
.department-usage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.department-usage-grid > div { padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-alt); }
.department-usage-grid strong { display: block; color: var(--ink); font-size: 20px; }
.department-usage-grid span { color: var(--muted); font-size: var(--fs-xs); }
@media (max-width: 560px) { .department-usage-grid { grid-template-columns: 1fr; } }

.detail-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.detail-head h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.detail-head p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 0; }
.detail-item span { display: block; margin-bottom: 2px; color: var(--muted); font-size: var(--fs-xs); }
.detail-item strong { color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.detail-item-full { grid-column: 1 / -1; }
.history-title { margin: 16px 0 8px; font-size: var(--fs-base); font-weight: 600; }
.history-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.history-item strong { font-size: var(--fs-sm); font-weight: 600; }
.history-item p, .history-item span { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-xs); }

.approval-steps { display: grid; gap: 8px; margin: 16px 0; }
.approval-step { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); color: var(--text); font-size: var(--fs-sm); }
.approval-step strong { font-size: var(--fs-xs); }
.approval-step small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; font-weight: 400; }

/* Transfer form */
.transfer-asset-preview { margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-alt); }
.transfer-asset-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.transfer-asset-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-top: 10px; color: var(--text); font-size: var(--fs-sm); }
.transfer-asset-notes { grid-column: 1 / -1; }
.approver-list { display: grid; gap: 12px; }
.approver-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; align-items: end; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-alt); }
.approver-remove { margin-bottom: 2px; }
.add-approver-button { justify-self: start; }

/* User / notify pickers */
.user-picker { display: grid; gap: 8px; }
.user-picker-search { width: 100%; }
.user-picker-results { max-height: 220px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r); }
.user-picker-selected, .notify-selected { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.notify-selected { margin-top: 8px; }
.user-picker-count, .user-picker-hint { width: 100%; color: var(--muted); font-size: var(--fs-xs); }
.user-picker-chip, .notify-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 6px 3px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: var(--fs-xs); font-weight: 500; }
.user-picker-chip button, .notify-chip button { width: 18px; height: 18px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 14px; line-height: 1; }
.user-picker-chip button:hover, .notify-chip button:hover { background: rgba(63, 99, 224, .15); }
.user-picker-empty { margin: 0; padding: 10px; font-size: var(--fs-sm); color: var(--muted); }
.notify-list { display: grid; gap: 2px; max-height: 200px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--r); }
.notify-option { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-sm); cursor: pointer; }
.notify-option:hover { background: var(--surface-alt); }
.notify-option input { width: 16px; height: 16px; min-height: 0; min-width: 0; accent-color: var(--blue); }

/* ---------- Activity log ---------- */
.asset-log-table, #asset-logs-table .asset-log-table { min-width: 1360px; }
.asset-log-row { cursor: pointer; }
.asset-log-row:hover { background: #f5f8ff !important; }
.asset-log-open { white-space: nowrap; }
.asset-log-person { display: grid; gap: 2px; min-width: 155px; max-width: 240px; white-space: normal; }
.asset-log-person strong, .asset-log-person span { display: block; }
.asset-log-person strong { color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.asset-log-person span { color: var(--muted); font-size: var(--fs-xs); line-height: 1.45; }
.asset-log-meta { display: grid; grid-template-columns: max-content minmax(110px, 1fr); gap: 4px 12px; min-width: 320px; margin: 8px 0 2px; white-space: normal; }
.asset-log-meta dt { color: var(--muted); font-size: var(--fs-xs); }
.asset-log-meta dd { margin: 0; color: var(--ink); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.asset-log-details summary { color: var(--blue); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.asset-log-details pre { max-width: 360px; max-height: 220px; overflow: auto; padding: 10px; border-radius: var(--r-sm); background: var(--surface-alt); color: var(--text); font-size: var(--fs-xs); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

.asset-log-modal { display: grid; gap: 16px; }
.asset-log-activity-heading { display: flex; justify-content: space-between; gap: 20px; padding: 14px 16px; border: 1px solid #e0e7fd; border-radius: var(--r); background: #f5f7ff; }
.asset-log-activity-heading > div { display: grid; gap: 2px; }
.asset-log-activity-heading span { color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
.asset-log-activity-heading strong { color: var(--ink); font-size: var(--fs-base); font-weight: 600; }
.asset-log-activity-heading small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; }
.asset-log-modal-section { padding: 16px; border: 1px solid var(--line); border-radius: var(--r); }
.asset-log-modal-section h3 { margin: 0 0 12px; color: var(--blue); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.asset-log-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.asset-log-detail-grid .detail-item { min-width: 0; }
.asset-log-detail-grid .detail-item strong { display: block; overflow-wrap: anywhere; line-height: 1.45; }
.asset-log-people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.asset-log-person-card { padding: 14px; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface-alt); }
.asset-log-person-card h3, .asset-log-person-card h4 { margin: 0 0 10px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.asset-log-person-card .detail-grid, .asset-log-person-card .asset-log-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0; }
.asset-log-person-name { display: block; margin-bottom: 10px; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.asset-log-changes { display: grid; gap: 6px; }
.asset-log-change { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(0, 1.3fr); gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-alt); font-size: var(--fs-sm); }
.asset-log-change strong { color: var(--muted); font-weight: 600; }
.asset-log-change span { color: var(--ink); overflow-wrap: anywhere; }
.asset-log-empty { color: var(--muted); font-size: var(--fs-sm); }

/* ---------- Toast ---------- */
.toast-root { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 16px; border-radius: var(--r); background: #1d2a45; color: #fff; font-size: var(--fs-sm); line-height: 1.5; box-shadow: 0 10px 28px rgba(16, 26, 49, .28); animation: toast-in .2s ease-out; }
.toast.error { background: #a8322b; }

@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1100px) {
  .sidebar { width: 228px; }
  .main-area { margin-left: 228px; }
  .page-content { padding: 24px; }
  .topbar { padding: 0 24px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .department-chart { grid-template-columns: repeat(2, 1fr); }
  .company-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .sidebar { width: 72px; padding: 20px 10px 12px; }
  .brand { min-height: 28px; padding: 0; justify-content: center; }
  .brand-logo { width: 44px; }
  .brand > span:not(.brand-mark), .workspace-label { font-size: 0; }
  .workspace-label { margin: 20px 0 8px; }
  .nav-item, .nav-item.active { justify-content: center; padding: 12px 6px; font-size: 0; }
  .nav-item.active { box-shadow: none; }
  .nav-icon { font-size: 19px; }
  .nav-count, .nav-badge, .help-card, .profile-info, .profile-row > .avatar { display: none; }
  .profile-row { justify-content: center; padding-top: 12px; }
  .logout-button { width: 44px; height: 40px; margin: 0; padding: 0; background: var(--surface-alt); }
  .logout-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .logout-icon { font-size: 18px; }
  .main-area { margin-left: 72px; }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .activity-panel { min-height: 160px; }
}

@media (max-width: 700px) {
  .asset-log-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-log-people-grid { grid-template-columns: 1fr; }
  .asset-log-activity-heading { flex-direction: column; gap: 12px; }
}

@media (max-width: 600px) {
  :root { --fs-xl: 24px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .brand-login { margin-bottom: 36px; }
  .page-content { padding: 20px 16px 32px; }
  .topbar { height: 56px; padding: 0 16px; }
  .today-label { display: none; }
  .topbar-right { gap: 8px; }
  .topbar .button { padding: 0 12px; font-size: 0; }
  .topbar .button span { font-size: 16px; }
  .page-heading { flex-direction: column; align-items: flex-start; }
  .stat-card { min-height: 112px; padding: 16px; }
  .department-chart { grid-template-columns: 1fr 1fr; gap: 16px; }
  .toolbar { flex-wrap: wrap; padding: 12px 16px; }
  .search-box { flex: 1; min-width: 100%; }
  .toolbar select { flex: 1; min-width: 0; }
  .result-count { margin-left: 0; }
  .people-grid { grid-template-columns: 1fr; padding: 16px; }
  .people-stats { overflow-x: auto; }
  .people-stat { min-width: 130px; }
  .transfer-summary { gap: 8px; }
  .summary-tile { padding: 12px; }
  .summary-tile strong { font-size: var(--fs-lg); }
  .form-grid, .role-checkbox-grid, .permission-member-columns, .approver-row, .transfer-asset-meta, .policy-category-grid { grid-template-columns: 1fr; }
  .section-heading { flex-direction: column; align-items: flex-start; }
  .permission-group-heading .group-card-actions { flex-wrap: wrap; }
  .form-field.full, .form-section-title, .transfer-asset-notes { grid-column: auto; }
  .approver-remove { justify-self: end; }
  .modal-backdrop { padding: 8px; }
  .modal-header, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-footer { padding: 12px 16px; }
  .data-table th, .data-table td { padding-left: 12px; padding-right: 12px; }
  .employee-tools { width: 100%; }
  .employee-tools .button { flex: 1; padding: 0 8px; font-size: var(--fs-sm); }
  .permission-group-heading, .user-group-card { flex-direction: column; align-items: flex-start; }
  .pager { padding: 12px 16px; justify-content: space-between; }
  .pager-summary { width: 100%; margin-right: 0; }
  .pager-pages { flex-wrap: wrap; }
  .toast-root { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}

@media (max-width: 420px) {
  .sidebar { width: 60px; padding: 16px 8px 12px; }
  .main-area { margin-left: 60px; }
  .page-content { padding: 16px 12px 28px; }
  .topbar { padding: 0 12px; }
  .breadcrumbs { font-size: 0; }
  .breadcrumbs strong { font-size: var(--fs-base); }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { min-height: 0; padding: 14px; }
  .stat-icon { width: 28px; height: 28px; font-size: 13px; }
  .stat-card > strong { font-size: 24px; }
  .department-chart { grid-template-columns: 1fr; }
  .company-grid { grid-template-columns: 1fr; padding: 0 16px 16px; }
  .panel-heading { padding: 16px 16px 12px; }
  .asset-log-detail-grid { grid-template-columns: 1fr; }
  .asset-log-change { grid-template-columns: 1fr; gap: 4px; }
}
