/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./src/app/globals.css ***!
  \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e6e8eb;
  --text: #1a1d21;
  --muted: #6b7280;
  --primary: #15803d;
  --primary-soft: #ecfdf3;
  --primary-fg: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 600; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); cursor: pointer;
  font-size: 13.5px; font-weight: 500; transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: #f3f4f6; }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn-primary:hover { background: #166534; }
.btn-danger { color: var(--danger); border-color: #f3c4c4; background: var(--surface); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #f3f4f6; }

/* ---- inputs ---- */
input, select {
  padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; width: 100%; background: var(--surface); color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
label { font-size: 12.5px; color: var(--muted); font-weight: 500; display: block; margin-bottom: 5px; }

/* checkbox/radio: bỏ style ô input chung để render đúng kiểu native */
input[type="checkbox"], input[type="radio"] {
  -moz-appearance: auto;
       appearance: auto; -webkit-appearance: auto;
  width: auto; height: auto; min-width: 16px; padding: 0; margin: 0;
  border: none; background: none; border-radius: 0;
  accent-color: var(--primary); cursor: pointer; flex: none;
}
input[type="checkbox"]:focus, input[type="radio"]:focus { box-shadow: none; outline: auto; }

/* input with a trailing icon button (e.g. show/hide password) */
.input-affix { position: relative; }
.input-affix > input { padding-right: 42px; }
.input-affix-btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: none; border-radius: 7px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.input-affix-btn:hover { background: #f3f4f6; color: var(--text); }

/* ---- layout helpers ---- */
.row { display: flex; gap: 8px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.spread { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-size: 13.5px; }
.wrap { flex-wrap: wrap; }

/* ---- card ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }

/* ---- badge ---- */
.badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px;
  background: #f1f3f5; color: var(--muted);
}
.badge-green { background: var(--primary-soft); color: var(--primary); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-amber { background: #fef3c7; color: #b45309; }

/* ---- dashboard (M9) ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-gap: 14px; gap: 14px; }
@media (max-width: 720px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi { padding: 14px 16px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.kpi-val { font-size: 28px; font-weight: 700; line-height: 1.1; margin-top: 4px; }
.kpi-delta { font-size: 12.5px; margin-top: 4px; }
.delta-up { color: var(--primary); }
.delta-down { color: var(--danger); }
.delta-flat { color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 14px; gap: 14px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.progress { height: 10px; border-radius: 999px; background: #eef0f2; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

/* ---- table ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
thead th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; background: #fafbfc; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
.table-wrap { overflow: hidden; }

/* ---- app shell ---- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px;
  position: -webkit-sticky;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.brand-name { font-weight: 650; font-size: 15px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px;
  color: var(--muted); font-weight: 500; font-size: 14px;
}
.nav a:hover { background: #f3f4f6; color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav a.active svg { color: var(--primary); }

/* ---- section tabs (sub-nav trong từng nhóm) ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a {
  padding: 9px 14px; font-size: 14px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none;
}
.user-email { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* language switcher */
.lang-switch { display: inline-flex; align-self: flex-start; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang-switch button {
  border: none; background: var(--surface); padding: 5px 12px; cursor: pointer; font-size: 12.5px;
  font-weight: 600; color: var(--muted);
}
.lang-switch button.active { background: var(--primary); color: #fff; }
.lang-switch button:not(.active):hover { background: #f3f4f6; }

/* ---- content ---- */
.content { padding: 28px 36px; width: 100%; min-width: 0; }
.page-head { margin-bottom: 22px; }

/* ---- roles master-detail ---- */
.roles-layout { display: grid; grid-template-columns: 320px 1fr; grid-gap: 18px; gap: 18px; height: calc(100vh - 132px); }
.roles-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.roles-list-scroll { flex: 1 1; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.role-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid transparent; border-radius: 10px; padding: 11px 13px; background: transparent;
  transition: background .1s, border-color .1s;
}
.role-item:hover { background: #fafbfc; }
.role-item.active { background: var(--primary-soft); border-color: #c7ebd5; }
.role-item-name { font-weight: 600; font-size: 14px; color: var(--text); }
.role-item-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.roles-list-foot { padding: 12px; border-top: 1px solid var(--border); }

.roles-empty { display: flex; align-items: center; justify-content: center; height: 100%; padding: 24px; text-align: center; }
.roles-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.perm-search { padding: 14px 18px 6px; }
.perm-search input { background: #fafbfc; }
.perm-groups { flex: 1 1; overflow: auto; padding: 12px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.perm-group { flex: none; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.perm-group-head { background: #fafbfc; padding: 10px 14px; font-weight: 600; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.perm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 4px 12px; gap: 4px 12px; padding: 12px 14px; }
.perm-check { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.perm-check:hover { background: #fafbfc; }
.perm-check input { width: auto; flex: none; cursor: pointer; }
.perm-check:has(input:disabled) { cursor: default; color: var(--muted); }
.perm-check input:disabled { cursor: default; }
.perm-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  padding: 10px 14px; border-radius: 10px; font-size: 13px;
}
.roles-detail-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); }

@media (max-width: 860px) {
  .roles-layout { grid-template-columns: 1fr; height: auto; }
  .roles-panel { max-height: 60vh; }
  .perm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- modal ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; padding: 22px; width: 460px; max-width: 100%; box-shadow: 0 20px 40px rgba(16,24,40,.2); }
.check-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.check-row:hover { background: #fafbfc; }
.check-row input { width: auto; }

/* ---- auth ---- */
.auth-wrap { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, #e7f6ec, var(--bg)); }
.auth-page-lang { position: absolute; top: 20px; right: 26px; }
.auth-card { width: 400px; max-width: 100%; }
.auth-card > .card { padding: 26px 26px 28px; box-shadow: 0 10px 30px rgba(16, 24, 40, .08), var(--shadow); }
.auth-card .stack { gap: 16px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 4px; }

/* language switcher — text variant ("Tiếng Việt / English") */
.lang-text { display: inline-flex; align-items: center; gap: 8px; }
.lang-text button {
  border: none; background: none; padding: 0; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.lang-text button:hover { color: var(--text); }
.lang-text button.active { color: var(--primary); font-weight: 600; }
.lang-text-sep { color: var(--border); }

