/* Ba khung giao diện (Admin §24.1, Workspace §21.1, Console §22.2) và bố cục trang xác thực.
   Board tham chiếu: 5 (Admin), 48 (Workspace), 30 (Console), 1 / 28 / 87–89 (xác thực). */

.shell { display: flex; min-height: 100vh; }
.shell-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.shell-content { padding: 26px var(--gutter) 48px; display: flex; flex-direction: column; gap: 22px; max-width: 1280px; width: 100%; }
.sidebar { display: flex; flex-direction: column; gap: 22px; padding: 22px 14px; flex: 0 0 auto; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 15px; }
.nav-title { font-size: var(--fs-10); letter-spacing: .09em; font-weight: 600; padding: 0 10px 6px; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-sm);
  font-size: var(--fs-13); font-weight: 500; text-decoration: none; }
.nav a .count { margin-left: auto; font-size: var(--fs-11); font-weight: 700; padding: 1px 7px; border-radius: var(--r-pill); }
.nav a .icon { width: 16px; height: 16px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: var(--fs-13); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: var(--fs-11); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px; border-radius: var(--r-pill); cursor: pointer; position: relative; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px var(--gutter); border-bottom: 1px solid var(--border); background: var(--white); position: sticky; top: 0; z-index: 20; }
.menu-toggle { display: none; }

/* ----- Admin: thanh bên tối 248px ----- */
.shell-admin .sidebar { width: var(--sidebar-admin); background: var(--ink); color: var(--slate-300); }
.shell-admin .brand-name { color: var(--white); }
.shell-admin .brand-sub, .shell-admin .nav-title { color: var(--slate-400); }
.shell-admin .logo-mark { background: var(--white); color: var(--ink); }
.shell-admin .nav a { color: var(--slate-300); }
.shell-admin .nav a:hover { background: var(--slate-800); color: var(--white); }
.shell-admin .nav a[aria-current="page"] { background: var(--slate-800); color: var(--white); box-shadow: inset 3px 0 0 var(--lime-500); }
.shell-admin .nav a .count { background: var(--warn-dot); color: var(--white); }
.wallet { background: var(--slate-800); border: 1px solid var(--slate-700); border-radius: var(--r-lg); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.wallet .eyebrow { color: var(--slate-400); }
.wallet-value { font-family: var(--font-head); font-size: var(--fs-18); font-weight: 600; color: var(--white); }
.wallet-sub { font-size: var(--fs-11); color: var(--slate-400); }
.shell-admin .avatar { background: var(--slate-700); color: var(--white); }

/* ----- Workspace: thanh bên trắng 232px ----- */
.shell-app .sidebar { width: var(--sidebar-app); background: var(--white); border-right: 1px solid var(--border); padding: 18px 12px; gap: 18px; }
.shell-app .logo-mark { background: var(--ink); color: var(--white); }
.shell-app .brand-sub { color: var(--text-3); }
.shell-app .nav a { color: var(--slate-600); }
.shell-app .nav a:hover { background: var(--slate-100); color: var(--text); }
.shell-app .nav a[aria-current="page"] { background: var(--lime-50); color: var(--lime-800); font-weight: 600; }
.shell-app .nav a .count { background: var(--slate-100); color: var(--slate-600); }
.shell-app .nav-bottom { margin-top: auto; }

/* ----- Console: băng tím ở đỉnh + thanh bên tối 236px ----- */
.console-band { background: var(--console-900); color: var(--console-200); padding: 9px var(--gutter); display: flex; flex-wrap: wrap; gap: 6px 14px;
  justify-content: space-between; font-size: var(--fs-11); }
.console-band strong { letter-spacing: .08em; color: var(--white); font-weight: 600; }
.shell-console { flex-direction: column; }
.shell-console > .shell { min-height: calc(100vh - 36px); }
.shell-console .sidebar { width: var(--sidebar-console); background: var(--ink); color: var(--slate-300); height: calc(100vh - 36px); top: 36px; }
.shell-console .logo-mark { background: var(--console-500); color: var(--white); }
.shell-console .brand-name { color: var(--white); }
.shell-console .brand-sub { color: var(--console-300); }
.shell-console .nav a { color: var(--slate-300); }
.shell-console .nav a:hover { background: var(--slate-800); color: var(--white); }
.shell-console .nav a[aria-current="page"] { background: var(--slate-800); color: var(--white); box-shadow: inset 3px 0 0 var(--console-500); }
.shell-console .nav a[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.shell-console .avatar { background: var(--console-700); color: var(--white); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--slate-800); }
.sidebar-foot .who { display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-12); color: var(--white); }
.sidebar-foot .who span { font-size: var(--fs-11); color: var(--slate-400); }

/* ----- Thu gọn ở màn hẹp: thanh bên thành ngăn trượt ----- */
@media (max-width: 960px) {
  :root { --gutter: 16px; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 45; transform: translateX(-105%); transition: transform .18s; box-shadow: var(--shadow-drawer); }
  .shell-console .sidebar { top: 0; height: 100vh; }
  .shell.nav-open .sidebar { transform: none; }
  .menu-toggle { display: inline-flex; }
}

/* ===== Trang xác thực ===== */
/* Đăng nhập tenant (board 1) / Console (board 28): hai cột */
.auth-split { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--white); }
.auth-brand { flex: 1 1 480px; min-width: 0; padding: 52px; display: flex; flex-direction: column; gap: 34px; background: var(--ink); color: var(--slate-300); }
.auth-brand h1 { font-size: var(--fs-36); line-height: 1.2; color: var(--white); max-width: 450px; }
.auth-brand h1 em { font-style: normal; color: var(--lime-500); }
.auth-brand p { font-size: 15px; line-height: 1.65; max-width: 450px; }
.auth-brand .brand-name { color: var(--white); font-size: var(--fs-16); }
.auth-brand .brand-sub { color: var(--slate-400); }
.auth-brand .logo-mark { width: 40px; height: 40px; background: var(--white); color: var(--ink); }
.auth-brand .foot { margin-top: auto; font-size: var(--fs-12); color: var(--slate-400); max-width: 450px; }
.auth-note { background: var(--slate-800); border: 1px solid var(--slate-700); border-radius: 16px; padding: 20px; max-width: 450px; display: flex; flex-direction: column; gap: 10px; }
.auth-note ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-13); }
.auth-form-col { flex: 999 1 520px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 52px 24px; }
.auth-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; }
.auth-form h2 { font-size: var(--fs-28); }
.area-console .auth-brand { background: var(--console-900); color: var(--console-200); }
.area-console .auth-brand .logo-mark { background: var(--console-500); color: var(--white); }
.area-console .auth-brand .brand-sub { color: var(--console-300); }
.area-console .auth-note { background: var(--console-800); border-color: var(--console-700); color: var(--console-100); }
.area-console .auth-brand .foot { color: var(--console-300); }
.step-done { background: var(--slate-50); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; display: flex; align-items: center; gap: 11px; }

/* Trang thẻ giữa màn (board 87, 88, 89, 51) */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-page); }
.auth-head { background: var(--white); border-bottom: 1px solid var(--border); padding: 16px 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.auth-head .logo-mark { background: var(--ink); color: var(--white); }
.auth-body { flex: 1 1 auto; display: flex; align-items: flex-start; justify-content: center; padding: 64px 20px; }
.auth-card { width: 100%; max-width: 460px; background: var(--white); border: 1px solid var(--border); border-radius: 22px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: var(--fs-22); }
.auth-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--lime-100); display: flex; align-items: center; justify-content: center; color: var(--lime-800); }
.auth-icon-err { background: var(--err-bg); color: var(--err-fg); }
.auth-foot { padding: 18px 40px; text-align: center; font-size: var(--fs-12); color: var(--text-4); }
@media (max-width: 600px) {
  .auth-brand { padding: 32px 20px; }
  .auth-head, .auth-foot { padding-left: 16px; padding-right: 16px; }
  .auth-body { padding: 32px 16px; }
  .auth-card { padding: 24px 20px; }
}

/* Menu tài khoản và menu ⋯ */
.account { position: relative; }
.account > .menu { right: 0; top: calc(100% + 6px); }
.menu .stack { padding: 8px 12px 4px; }
.qr { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--white); flex: 0 0 auto; }
.secret { word-break: break-all; font-size: var(--fs-12); }
.split-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1100px) { .split-2 { grid-template-columns: minmax(0, 1fr); } }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: var(--fs-13); color: var(--text-2); }
.note-item { border-bottom: 1px solid var(--border); padding: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.note-item:last-child { border-bottom: 0; }
.once-box { background: var(--slate-50); border: 1px dashed var(--border-input); border-radius: var(--r-md); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.once-box code { font-size: var(--fs-14); background: none; padding: 0; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item .meta { font-size: var(--fs-11); color: var(--text-3); }
