html, body { height: 100%; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; color: var(--muted); }
[hidden] { display: none !important; }

/* Đăng nhập */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; padding: 32px 28px; text-align: center; }
.login-card h1 { font-size: 22px; margin-top: 14px; }
.gbtn { display: flex; justify-content: center; margin: 22px 0 8px; min-height: 44px; }
.login-card .notice { text-align: left; margin-top: 14px; }

.brand-mark {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .02em; flex: none;
}
.brand-mark.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 20px; }

/* Bố cục */
.shell {
  height: 100%; display: grid;
  grid-template-columns: 248px 1fr; grid-template-rows: 56px 1fr;
  grid-template-areas: "top top" "side main";
}
.topbar {
  grid-area: top; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; min-width: 0; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.crumb:not(:empty)::before { content: "/"; margin-right: 10px; color: var(--line); }
.user { display: flex; align-items: center; gap: 10px; }
.user img { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); }
.user img:not([src]), .user img[src=""] { visibility: hidden; }
.user-txt { display: flex; flex-direction: column; line-height: 1.2; font-size: 13px; }
.user-txt span { font-size: 12px; }
.icon-btn { display: none; background: none; border: 0; color: var(--text); padding: 6px; border-radius: 8px; cursor: pointer; }

.sidebar {
  grid-area: side; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 12px 10px 24px;
}
.nav-group { margin-top: 14px; }
.nav-group h4 { margin: 0 0 6px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 500;
}
.nav-item:hover { background: var(--panel-2); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-item .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .badge { font-size: 10px; padding: 0 6px; }

.content { grid-area: main; position: relative; overflow: hidden; min-width: 0; }
.home { height: 100%; overflow-y: auto; }
#frames iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }

/* Trang chủ */
.home-inner { max-width: 1100px; margin: 0 auto; padding: 28px 24px 48px; }
.hello h1 { font-size: 24px; }
.setup { margin: 16px 0 4px; display: grid; gap: 8px; }
.home-group { margin-top: 28px; }
.home-group h2 { font-size: 15px; color: var(--muted); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--brand); transform: translateY(-1px); }
.tile .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.tile.soon .ic { background: var(--warn-soft); color: var(--warn); }
.tile .t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.tile p { margin: 0; color: var(--muted); font-size: 13px; }

/* Điện thoại */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
  .icon-btn { display: inline-flex; }
  .sidebar {
    position: fixed; top: 56px; bottom: 0; left: 0; width: 280px; z-index: 20;
    transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 56px 0 0 0; background: rgba(0,0,0,.3); z-index: 10; }
  .crumb, .user-txt, #open-new { display: none; }
  .brand-name { font-size: 14px; }
  .home-inner { padding: 20px 16px 40px; }
}
