/* Giao diện kho dữ liệu (drive.html) + trang đăng nhập + quản trị. Dùng biến màu từ brand.css */
body.app { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: var(--blue-mist); }

.topbar { display: flex; align-items: center; gap: 16px; height: 68px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.brand img { transition: transform var(--t) var(--ease); }
.brand:hover img { transform: scale(1.04); }
.search { flex: 1; max-width: 640px; margin-left: 12px; display: flex; align-items: center; gap: 10px; background: var(--blue-mist); border: 1.5px solid transparent; border-radius: 999px; padding: 0 18px; height: 44px; color: var(--muted); transition: border-color var(--t), background var(--t), box-shadow var(--t); }
.search:focus-within { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(30,115,190,.12); }
.search input { flex: 1; border: 0; background: transparent; outline: 0; }
.search input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.search-ic, .search-x { border: 0; background: transparent; color: inherit; padding: 0; display: grid; place-items: center; cursor: pointer; font-size: 24px; line-height: 1; }
.search-x { display: none; }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 500; }
.menu-only { display: none; }
.icon-btn { border: 0; background: transparent; border-radius: 50%; width: 36px; height: 36px; font-size: 17px; color: var(--muted); transition: background var(--t), transform var(--t); }
.icon-btn:hover { background: var(--blue-soft); color: var(--blue-dark); transform: scale(1.08); }
.btn-text { border: 0; background: transparent; color: var(--blue); font-weight: 600; padding: 8px 12px; border-radius: 999px; transition: background var(--t); }
.btn-text:hover { background: var(--blue-soft); }

.layout { display: flex; flex: 1; min-height: 0; }
.sidebar { width: 264px; padding: 16px 14px; flex-shrink: 0; overflow: auto; background: #fff; border-right: 1px solid var(--line); }
.new-wrap { position: relative; margin-bottom: 14px; }
.btn-new { border: 0; background: var(--yellow); color: var(--ink); font-weight: 700; border-radius: 16px; height: 52px; padding: 0 26px; box-shadow: 0 6px 16px rgba(255,194,14,.45); transition: transform var(--t) var(--ease), box-shadow var(--t); }
.btn-new:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(255,194,14,.55); }
.roots { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.roots a { color: var(--ink); padding: 10px 16px; border-radius: 12px; font-weight: 500; transition: background var(--t), padding-left var(--t) var(--ease); }
.roots a:hover { background: var(--blue-mist); padding-left: 20px; }
.roots a.active { background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; }

.main { flex: 1; padding: 18px 26px 26px; overflow: auto; position: relative; }
.crumbs-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.crumbs { font-size: 18px; font-weight: 600; }
.crumbs .sep { color: var(--muted); margin: 0 6px; }
.crumbs a { padding: 2px 6px; border-radius: 8px; }
.crumbs a:hover { background: var(--blue-soft); }
.empty { color: var(--muted); text-align: center; padding: 90px 0; grid-column: 1 / -1; animation: pageIn .4s var(--ease); }

.content.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; overflow: hidden; animation: pop .45s var(--ease) both; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t); }
.card:hover, .card:focus { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #bcd6ee; outline: 0; }
.thumb { height: 128px; display: flex; align-items: center; justify-content: center; font-size: 54px; background: linear-gradient(180deg, var(--blue-mist), #fff); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .thumb img { transform: scale(1.06); }
.cap { display: flex; align-items: center; padding: 8px 6px 8px 14px; border-top: 1px solid var(--line); }
.cap .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

.row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; background: #fff; animation: pageIn .35s var(--ease) both; transition: background var(--t); }
.content.list { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row:hover { background: var(--blue-mist); }
.row.head { cursor: default; color: var(--muted); font-weight: 600; font-size: 13px; position: sticky; top: 0; background: #fff; animation: none; }
.row.head:hover { background: #fff; }
.row .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .d { width: 170px; color: var(--muted); }
.row .s { width: 110px; color: var(--muted); }
.sort { cursor: pointer; }
.card:nth-child(2) { animation-delay: .03s; } .card:nth-child(3) { animation-delay: .06s; } .card:nth-child(4) { animation-delay: .09s; }
.card:nth-child(5) { animation-delay: .12s; } .card:nth-child(6) { animation-delay: .15s; } .card:nth-child(n+7) { animation-delay: .18s; }

.menu { position: absolute; z-index: 30; background: #fff; border-radius: var(--r-sm); box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 6px; min-width: 210px; display: flex; flex-direction: column; animation: pop .18s var(--ease); }
.menu.ctx { position: fixed; }
.menu button { border: 0; background: transparent; text-align: left; padding: 9px 14px; border-radius: 8px; }
.menu button:hover { background: var(--blue-soft); }

.drop-hint { display: none; position: absolute; inset: 10px; border: 3px dashed var(--blue); background: rgba(30,115,190,.08); backdrop-filter: blur(2px); border-radius: var(--r-lg); align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--blue-dark); pointer-events: none; z-index: 20; }
.drop-hint.on { display: flex; animation: pop .2s var(--ease); }

.modal { position: fixed; inset: 0; background: rgba(18,38,58,.5); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 50; animation: pageIn .2s; }
.modal-box { background: #fff; border-radius: var(--r-lg); padding: 26px; width: min(460px, 92vw); box-shadow: var(--shadow-lg); animation: pop .25s var(--ease); }
.modal-box h3 { margin: 0 0 12px; font-size: 20px; }
.modal-box p { margin-bottom: 12px; color: #3d5266; }
.modal-box input, .modal-box select { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); }
.modal-box input:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(30,115,190,.15); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.preview { position: fixed; inset: 0; background: rgba(10,20,32,.92); z-index: 40; display: flex; flex-direction: column; animation: pageIn .2s; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; color: #fff; }
.preview-bar .btn-text { color: #fff; }
.preview-body { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; }
.preview-body img, .preview-body video { max-width: 96%; max-height: 90vh; border-radius: 8px; animation: pop .3s var(--ease); }
.preview-body iframe { width: min(1000px, 96%); height: 92%; border: 0; background: #fff; border-radius: 8px; }

.uploads { position: fixed; right: 24px; bottom: 0; width: 360px; background: #fff; border-radius: var(--r) var(--r) 0 0; box-shadow: var(--shadow-lg); z-index: 35; animation: pop .25s var(--ease); }
.uploads-head { display: flex; justify-content: space-between; align-items: center; background: var(--blue-dark); color: #fff; padding: 8px 8px 8px 18px; border-radius: var(--r) var(--r) 0 0; font-weight: 600; }
.uploads-head .btn-text { color: #fff; }
#uploadsList { max-height: 260px; overflow: auto; }
.up-row { display: flex; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.up-row .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-row .p { color: var(--blue); font-weight: 600; }
.up-row.bad .p { color: var(--red); }

.toasts { position: fixed; left: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--r-sm); box-shadow: var(--shadow); animation: pop .25s var(--ease); }
.toast.bad { background: var(--red); }

/* ---------- đăng nhập ---------- */
.login-body { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.login-art { background-image: linear-gradient(145deg, rgba(15,76,138,.92), rgba(30,115,190,.82)), url(/assets/img/tap-the-4.jpg); background-size: cover; background-position: center; position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art::before, .login-art::after { content: ""; position: absolute; border-radius: 50%; filter: blur(50px); animation: drift 12s ease-in-out infinite; }
.login-art::before { width: 360px; height: 360px; background: rgba(255,194,14,.35); top: -90px; right: -90px; }
.login-art::after { width: 300px; height: 300px; background: rgba(143,194,238,.4); bottom: -80px; left: -60px; animation-delay: -6s; }
.login-art > * { position: relative; z-index: 1; }
.login-art .logo-card { background: #fff; display: inline-block; padding: 12px 18px; border-radius: var(--r); }
.login-art .logo-card img { height: 64px; width: auto; }
.login-art h2 { font-size: 34px; font-weight: 800; margin-bottom: 12px; }
.login-art p { opacity: .9; max-width: 420px; font-size: 16px; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-box { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; animation: pageIn .6s var(--ease) both; }
.login-box h1 { font-size: 28px; }
.login-box > p { color: var(--muted); margin-top: -6px; }
.err { color: var(--red); min-height: 20px; font-size: 14px; font-weight: 500; }
.back-link { color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- quản trị nhân sự ---------- */
.adm-main { flex: 1; overflow: auto; padding: 28px; }
.adm-wrap { width: min(1100px, 100%); margin: 0 auto; }
.adm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.adm-head h1 { font-size: 26px; }
.adm-head p { color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; }
.stat b { display: block; font-size: 28px; color: var(--blue-dark); }
.stat span { color: var(--muted); font-size: 13px; }
.table { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.t-row { display: grid; grid-template-columns: 1.5fr 1.5fr 110px 2fr 150px; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: center; animation: pageIn .35s var(--ease) both; transition: background var(--t); }
.t-row:hover { background: var(--blue-mist); }
.t-row.t-head { background: var(--blue-mist); color: var(--muted); font-size: 13px; font-weight: 700; animation: none; }
.t-row:last-child { border-bottom: 0; }
.t-name { font-weight: 600; }
.t-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.admin { background: var(--yellow-soft); color: #8a6200; }
.badge.staff { background: var(--blue-soft); color: var(--blue-dark); }
.tag { display: inline-block; background: var(--blue-mist); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; font-size: 12px; margin: 2px 4px 2px 0; }
.tag.w { background: #e6f6ec; border-color: #bfe5cc; }
.t-act { display: flex; gap: 6px; justify-content: flex-end; }
.drawer-bg { position: fixed; inset: 0; background: rgba(18,38,58,.45); backdrop-filter: blur(3px); z-index: 50; animation: pageIn .2s; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(520px, 100%); background: #fff; z-index: 51; padding: 26px; overflow: auto; box-shadow: var(--shadow-lg); animation: slideIn .3s var(--ease); display: flex; flex-direction: column; gap: 14px; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.perm-row { display: grid; grid-template-columns: 1fr 130px 36px; gap: 8px; align-items: center; }
.perm-row .input { padding: 9px 12px; }
.hint { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: transparent; padding: 10px 18px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; transition: color var(--t), border-color var(--t); }
.tab:hover { color: var(--blue-dark); }
.tab.on { color: var(--blue-dark); border-color: var(--blue); }
.tr-row { grid-template-columns: 1.6fr 1.6fr 1fr 1fr 230px; }

.who .btn, .who .btn-sm, .btn { white-space: nowrap; }
.scrim { display: none; }
.login-logo { display: none; height: 60px; width: auto; align-self: flex-start; }
@media (max-width: 860px) { .login-logo { display: block; } }
.mobile-only { display: none; }
@media (max-width: 860px) { .mobile-only { display: flex; } }

@media (max-width: 860px) {
  .login-body { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-form-wrap { align-items: flex-start; padding-top: 8vh; }

  .topbar { height: 60px; padding: 0 10px; gap: 8px; }
  .brand img { height: 34px; }
  .brand-text small { display: none; }
  .brand-text b { font-size: 14px; }
  .menu-only { display: grid; place-items: center; flex-shrink: 0; }
  .topbar { position: relative; }
  .search { margin-left: auto; flex: 0 0 40px; width: 40px; min-width: 0; height: 40px; padding: 0; justify-content: center; }
  .search input, .search-x { display: none; }
  .search-ic { width: 100%; height: 100%; padding: 0; }
  .search.open .search-ic { width: auto; flex-shrink: 0; }
  .search.open { position: absolute; z-index: 60; left: 10px; right: 10px; top: 10px; width: auto; max-width: none; flex: none; padding: 0 6px 0 12px; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(30,115,190,.12); justify-content: flex-start; }
  .search.open input { display: block; min-width: 0; width: 100%; font-size: 16px; }
  .search.open .search-x { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; }
  .who { margin-left: 0; }
  .search-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(18,38,58,.38); animation: pageIn .2s; }
  .search-scrim[hidden] { display: none; }
  input, select, textarea { font-size: 16px !important; }
  .login-form-wrap { padding: 28px 20px 24px; }
  .modal { align-items: flex-start; overflow-y: auto; padding: 12px 0; }
  .modal-box { margin: auto; max-height: calc(100dvh - 24px); overflow-y: auto; }
  .who { gap: 6px; }
  .who #whoName, #navAdminTop { display: none; }
  .who .btn-sm { padding: 8px 12px; font-size: 13px; }

  .sidebar { position: fixed; left: 0; top: 60px; bottom: 0; z-index: 45; width: min(300px, 84vw); transform: translateX(-102%); transition: transform .28s var(--ease); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { position: fixed; inset: 60px 0 0 0; background: rgba(18,38,58,.45); z-index: 44; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .scrim.on { display: block; opacity: 1; pointer-events: auto; }

  .main { padding: 12px; }
  .crumbs { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .thumb { height: 96px; font-size: 42px; }
  .cap { padding: 4px 2px 4px 10px; }
  .row .d, .row .s { display: none; }
  .row { padding: 12px; }
  .row .more { width: 40px; height: 40px; }
  .icon-btn.more { width: 40px; height: 40px; }
  .btn-new { width: 100%; }
  .uploads { right: 0; left: 0; width: 100%; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .modal-box { padding: 20px; }
  .preview-body iframe { width: 100%; height: 100%; border-radius: 0; }

  /* quản trị */
  .topbar strong { display: none; }
  .adm-main { padding: 14px; }
  .adm-head { flex-direction: column; align-items: stretch; }
  .adm-head > div:last-child { flex-direction: column; align-items: stretch; }
  .adm-head .input { width: 100% !important; }
  .stat-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 11px; }
  .t-row, .tr-row { grid-template-columns: 1fr; gap: 4px; padding: 14px; }
  .t-row.t-head { display: none; }
  .t-act { justify-content: flex-start; margin-top: 8px; }
  .drawer { width: 100%; padding: 18px; }
  .perm-row { grid-template-columns: 1fr 112px 34px; }
}

/* icon trong app */
.icon-btn .i { width: 20px; height: 20px; }
.search .i { width: 18px; height: 18px; }
.btn-new .i { width: 20px; height: 20px; margin-right: 4px; }
.roots a { display: flex; align-items: center; gap: 10px; }
.roots a .i { width: 20px; height: 20px; color: var(--muted); }
.roots a.active .i { color: var(--blue); }
.menu button { display: flex; align-items: center; gap: 10px; }
.menu button .i { width: 18px; height: 18px; color: var(--muted); }
.thumb .i { width: 56px; height: 56px; stroke-width: 1.2; }
.row .n .i { width: 20px; height: 20px; margin-right: 6px; }
.cap .more .i { width: 18px; height: 18px; }
.drop-hint div { display: flex; align-items: center; gap: 12px; }
.drop-hint .i { width: 28px; height: 28px; }
.t-name .i { width: 18px; height: 18px; margin-right: 4px; }
.t-act .btn .i, .btn-text .i { width: 16px; height: 16px; margin-right: 4px; }
.preview-bar .i { width: 18px; height: 18px; }
.perm-row .icon-btn .i { width: 16px; height: 16px; }
.back-link { display: flex; align-items: center; justify-content: center; gap: 6px; }
.up-row .p .i { width: 18px; height: 18px; color: var(--ok); }

/* nhập hàng loạt */
.modal-box.wide { width: min(940px, 96vw); max-height: 90vh; overflow: auto; }
.bulk-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.bulk-top label.btn { cursor: pointer; }
#b-text { font-family: ui-monospace, Consolas, monospace; font-size: 13px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: #3d5266; }
.check input { width: auto; }
.bulk-table { border: 1px solid var(--line); border-radius: var(--r-sm); max-height: 300px; overflow: auto; }
.b-row { display: grid; grid-template-columns: 1.2fr 1.4fr 100px 1.4fr 1.4fr; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); align-items: center; font-size: 13px; }
.b-row:last-child { border-bottom: 0; }
.st { font-weight: 600; color: var(--blue-dark); }
.st.ok { color: var(--ok); } .st.bad { color: var(--red); } .st.skip { color: var(--muted); }
.help-list { margin: 8px 0 14px; padding-left: 20px; display: grid; gap: 6px; }
.help-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.help-table th, .help-table td { text-align: left; padding: 8px 10px; border: 1px solid var(--line); vertical-align: top; }
.help-table th { background: var(--blue-mist); }
@media (max-width: 860px) { .b-row { grid-template-columns: 1fr; gap: 2px; } .adm-head > div:last-child { flex-wrap: wrap; } }

/* thanh dung lượng */
.usage { margin: auto 14px 14px; padding: 12px 14px; background: var(--blue-mist); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; color: var(--muted); }
.usage:empty { display: none; }
.usage-top { display: flex; justify-content: space-between; color: var(--ink, #12263a); margin-bottom: 8px; }
.usage-bar { height: 8px; border-radius: 99px; background: #dbe7f3; overflow: hidden; }
.usage-bar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width .4s var(--ease); }
.usage.warn .usage-bar i { background: #f0a30a; }
.usage.full .usage-bar i { background: #d64545; }
.usage-txt { margin-top: 8px; line-height: 1.5; }
.sidebar { display: flex; flex-direction: column; }
.usage-wide { margin: 0 0 16px; max-width: 420px; }

/* menu tài khoản (trang quản trị) */
.acct { position: relative; margin-left: auto; }
.acct-btn { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px 4px 4px; color: var(--ink, #12263a); font-weight: 600; max-width: 240px; cursor: pointer; }
.acct-btn:hover { background: var(--blue-mist); }
.acct-av { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-soft, #e6f1fb); color: var(--blue); display: grid; place-items: center; flex-shrink: 0; }
.acct-av .i { width: 18px; height: 18px; }
.acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu { right: 0; top: calc(100% + 8px); }
.acct-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 8px; color: inherit; text-decoration: none; }
.acct-menu a:hover { background: var(--blue-soft); }
.acct-menu .i { width: 18px; height: 18px; color: var(--muted); }
.acct-menu.hidden { display: none; }
@media (max-width: 860px) {
  .acct-name { display: none !important; }
  .acct-btn { padding: 4px; }
  .brand-text b { white-space: nowrap; }
}

/* nút + và bảng tải lên (điện thoại) */
.fab, .sheet, .sheet-back { display: none; }
@media (max-width: 860px) {
  .fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40; width: 58px; height: 58px; border: 0; border-radius: 50%; background: var(--yellow, #FFC20E); color: #12263a; box-shadow: 0 8px 22px rgba(15,76,138,.32); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; animation: pop .3s var(--ease); }
  .fab:active { transform: scale(.92); }
  .fab .i { width: 28px; height: 28px; stroke-width: 2.4; }
  .fab.hidden { display: none; }
  body.sheet-open .fab { transform: rotate(45deg) scale(.9); }
  .sheet-back { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(18,38,58,.5); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: pageIn .2s; }
  .sheet { display: block; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 71; background: #fff; border-radius: 24px; padding: 18px 16px 14px; box-shadow: var(--shadow-lg); transform-origin: 85% 100%; animation: sheetUp .28s var(--ease); }
  .sheet[hidden], .sheet-back[hidden] { display: none; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 17px; padding: 0 4px; }
  .sheet-head span { color: var(--blue); }
  .sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .sheet-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--blue-mist); text-align: left; cursor: pointer; transition: transform .15s, border-color .15s; }
  .sheet-grid button:active { transform: scale(.96); border-color: var(--blue); }
  .sheet-grid b { font-size: 15px; color: var(--ink, #12263a); }
  .sheet-grid small { color: var(--muted); font-size: 12px; }
  .sheet-ic { width: 42px; height: 42px; border-radius: 14px; background: #fff; color: var(--blue); display: grid; place-items: center; margin-bottom: 6px; box-shadow: 0 2px 8px rgba(15,76,138,.1); }
  .sheet-ic .i { width: 22px; height: 22px; }
  .sheet-note { margin: 12px 4px 0; color: var(--muted); font-size: 12.5px; }
  .uploads { bottom: 0; }
}
@keyframes sheetUp { from { opacity: 0; transform: translateY(28px) scale(.94); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { body:has(#uploads:not(.hidden)) .fab { bottom: 250px; } }

@media (max-width: 860px) {
  .fab.fab-off { opacity: 0; transform: scale(.6); pointer-events: none; }
  .main { padding-bottom: 96px; }
  .sheet { max-height: calc(100dvh - 24px); overflow-y: auto; }
}
@media (max-width: 860px) and (max-height: 480px) {
  .sheet-grid { grid-template-columns: repeat(4, 1fr); }
  .sheet-grid small, .sheet-note { display: none; }
}

.menu.ctx { max-height: calc(100vh - 16px); overflow-y: auto; }
@media (max-width: 860px) {
  .menu.ctx.ctx-sheet { position: fixed; left: 12px !important; right: 12px; top: auto !important; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; min-width: 0; z-index: 72; border-radius: 22px; padding: 8px; max-height: calc(100dvh - 24px); box-shadow: var(--shadow-lg); animation: sheetUp .26s var(--ease); }
  .menu.ctx.ctx-sheet button { padding: 15px 16px; font-size: 16px; border-radius: 14px; }
  .menu.ctx.ctx-sheet button .i { width: 20px; height: 20px; }
}

/* ---- Thùng rác: bộ lọc, chế độ xem, chọn hàng loạt ---- */
.tr-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 10px; align-items: center; }
.tr-bar input[type=search] { flex: 1 1 220px; min-width: 180px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); }
.tr-bar select { padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.tr-views { display: flex; gap: 4px; }
.tr-views .btn.on { background: var(--blue-mist); color: var(--blue); border-color: var(--blue); }
.tr-sel { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 10px; padding: 10px 14px; background: var(--blue-mist); border-radius: var(--r-sm); }
.tr-sel label { display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.tr-sel-act { margin-left: auto; display: flex; gap: 8px; }
.tr-lrow { grid-template-columns: 36px 1.6fr 1.4fr 1fr 1fr 230px; }
.tr-lrow.sel, .tr-card.sel { background: var(--blue-mist); }
.tr-chk, #trAll { width: 18px; height: 18px; cursor: pointer; }
.tr-box.tr-grid, .tr-box.tr-big { display: grid; gap: 14px; padding: 14px; background: transparent; border: 0; box-shadow: none; }
.tr-box.tr-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tr-box.tr-big { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.tr-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.tr-card.sel { outline: 2px solid var(--blue); }
.tr-pick { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(255,255,255,.9); padding: 4px; border-radius: 6px; display: flex; }
.tr-thumb { position: relative; aspect-ratio: 4 / 3; background: #eef3f8; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tr-big .tr-thumb { aspect-ratio: 16 / 10; }
.tr-thumb img, .tr-thumb video { width: 100%; height: 100%; object-fit: cover; }
.tr-ico .i { width: 48px; height: 48px; color: var(--muted); }
.tr-play { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.tr-meta { padding: 10px 12px 4px; min-width: 0; }
.tr-meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-card .t-act { padding: 8px 10px 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tr-grid .tr-card .t-act .btn { padding: 6px 8px; font-size: 12px; }
@media (max-width: 720px) { .tr-lrow { grid-template-columns: 1fr; } .tr-sel-act { margin-left: 0; } }

/* Máy tính: hiện sẵn "Về kho dữ liệu" và "Đăng xuất" trên thanh trên, không gói vào menu */
@media (min-width: 861px) {
  .acct { display: flex; align-items: center; gap: 10px; }
  .acct-btn { order: 1; cursor: default; pointer-events: none; }
  .acct-menu, .acct-menu.hidden { display: flex !important; position: static; order: 0; flex-direction: row; gap: 8px; padding: 0; border: 0; box-shadow: none; background: none; min-width: 0; animation: none; }
  .acct-menu a, .acct-menu button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; width: auto; }
  .acct-menu a:hover, .acct-menu button:hover { background: var(--blue-mist); }
  .acct-menu #btnLogout { color: var(--red); }
}
