/* shell.css — vỏ giao diện dùng chung (story 1.5): sidebar 220px cố định, header 56px, toast, chọn ngôn ngữ, banner,
   responsive 1 cột dưới 768px. Chỉ dùng token của tokens.css (CLAUDE.md v1 §3) — không thêm màu mới.
   Thiết kế lại theo hướng D là story riêng; tệp này chỉ là vỏ kỹ thuật. */

html, body { margin: 0; }
/* `hidden` luôn thắng display của lớp thành phần (.btn-primary, .nav-item, .banner…) — shell ẩn/hiện bằng thuộc tính này. */
[hidden] { display: none !important; }
.shell-body { background: var(--color-background); color: var(--color-text-main); min-height: 100vh; }

/* ---- Sidebar ---- */
.shell-sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width); z-index: 40; display: flex; flex-direction: column; padding: 20px 12px; box-sizing: border-box; background: var(--color-sidebar-bg); color: var(--color-sidebar-text); overflow-y: auto; }
.sidebar { width: var(--sidebar-width); flex-shrink: 0; }
.shell-brand { display: flex; align-items: center; gap: 10px; padding: 0 12px; margin-bottom: 28px; text-decoration: none; color: #fff; }
.shell-brand-logo { width: 32px; height: 32px; border-radius: var(--radius-lg); background: var(--color-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.shell-brand-text { font-weight: 700; font-size: 14px; line-height: 1.2; color: #fff; }
.shell-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.shell-nav-section { display: flex; flex-direction: column; gap: 4px; }
.shell-nav-section + .shell-nav-section { margin-top: 16px; }
.shell-nav-title { padding: 0 12px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(168, 171, 186, 0.5); margin-bottom: 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 8px; color: var(--color-sidebar-text); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; text-decoration: none; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: var(--color-border); }
.nav-item.active { background: rgba(14,121,96,0.25); color: #7EDBC4; }
.nav-item.active .material-symbols-outlined { color: #7EDBC4; }
.nav-item .material-symbols-outlined { font-size: 18px; }
.nav-item[hidden], .shell-nav-section[hidden] { display: none; }

.shell-lang { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-top: 12px; color: var(--color-sidebar-text); }
.shell-lang-select { flex: 1; background: rgba(255,255,255,0.05); color: var(--color-sidebar-text); font-size: 13px; border-radius: var(--radius-md); padding: 6px 8px; border: 1px solid rgba(255,255,255,0.1); font-family: var(--font-ui); }
.shell-lang-select:focus { outline: none; border-color: var(--color-primary); }
.shell-lang-select option { color: var(--color-text-main); background: #fff; }
.shell-lang-float { position: fixed; top: 14px; right: 16px; z-index: 50; }
.shell-lang-float .shell-lang { margin: 0; padding: 4px 8px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); color: var(--color-text-sub); }
.shell-lang-float .shell-lang-select { background: transparent; color: var(--color-text-main); border-color: transparent; }

.shell-sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.shell-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-lg); }
.shell-avatar { width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--color-primary); color: #fff; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.shell-user-text { flex: 1; min-width: 0; }
.shell-user-name { margin: 0; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-user-role { margin: 0; color: var(--color-sidebar-text); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: none; color: var(--color-sidebar-text); cursor: pointer; display: inline-flex; padding: 4px; border-radius: var(--radius-md); }
.icon-btn:hover { color: #fff; background: rgba(255,255,255,0.07); }

/* ---- Cột chính + header ---- */
.shell-col { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.main-col { margin-left: var(--sidebar-width); }
.shell-header { position: sticky; top: 0; z-index: 30; height: var(--header-height); background: var(--color-surface); border-bottom: 1px solid var(--color-border); display: flex; align-items: center; gap: 16px; padding: 0 24px; box-sizing: border-box; }
.shell-menu-btn { display: none; color: var(--color-text-sub); }
.shell-menu-btn:hover { color: var(--color-text-main); background: var(--color-background); }
.shell-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.shell-crumb { color: var(--color-text-sub); white-space: nowrap; }
.shell-crumb.is-current { color: var(--color-text-main); font-weight: 600; }
.shell-crumb-sep { color: var(--color-border-strong); }
.shell-header-spacer { flex: 1; }
.shell-header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.shell-header-actions[hidden] { display: none; }
.shell-main { flex: 1; padding: 24px; box-sizing: border-box; }
.shell-banner { display: flex; flex-direction: column; gap: 6px; margin: 16px 24px 0; padding: 10px 14px; border-radius: var(--radius-lg); background: var(--color-warning-light); color: var(--color-warning); border: 1px solid #FEF0C7; font-size: 13px; }
.shell-banner[hidden] { display: none; }
.shell-banner-row { display: flex; align-items: center; gap: 10px; }
.shell-scrim { display: none; }
.shell-denied-title { font-weight: 700; font-size: 15px; margin: 0; }
.shell-denied-sub { color: var(--color-text-sub); font-size: 13px; margin: 4px 0 0; }
.shell-link { color: var(--color-primary); font-weight: 600; }

/* ---- Toast ---- */
.bw-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px); z-index: 9999; min-width: 320px; max-width: 90vw; padding: 12px 18px; border-radius: var(--radius-xl); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; background: var(--color-success-light); color: var(--color-success); border: 1px solid #A7F3D0; }
.bw-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.bw-toast.is-error { background: var(--color-error-light); color: var(--color-error); border-color: #FECACA; }
.bw-toast .material-symbols-outlined { font-size: 18px; }

/* ---- Responsive: 1 cột dưới 768px (AD-11) ---- */
@media (max-width: 767px) {
  .shell-sidebar { transform: translateX(-100%); transition: transform .2s ease-out; box-shadow: none; }
  body.shell-nav-open .shell-sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,0.35); }
  body.shell-nav-open .shell-scrim { display: block; position: fixed; inset: 0; background: rgba(17,22,33,0.45); z-index: 35; }
  .shell-col, .main-col { margin-left: 0; }
  .shell-menu-btn { display: inline-flex; }
  .shell-header { padding: 0 12px; gap: 10px; }
  .shell-main { padding: 12px; }
  .shell-banner { margin: 12px 12px 0; }
  .shell-header-actions { gap: 6px; }
}
