/* ===== Thư Viện AOV — Light Liquid Glass Purple v2 ===== */

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('vendor/fonts/nunito/nunito-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('vendor/fonts/nunito/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('vendor/fonts/nunito/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-1: #faf8ff;
  --bg-2: #f2ecfe;
  --glass: rgba(255, 255, 255, .55);
  --glass-strong: rgba(255, 255, 255, .75);
  --glass-border: rgba(255, 255, 255, .8);
  --text: #241b3e;
  --muted: #6f6790;
  --purple: #7c3aed;
  --purple-2: #6d28d9;
  --purple-soft: #a78bfa;
  --pink: #d946ef;
  --danger: #dc3545;
  --green: #16a34a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(109, 40, 217, .10), 0 2px 8px rgba(109, 40, 217, .06);
  --shadow-hover: 0 18px 44px rgba(109, 40, 217, .18), 0 4px 12px rgba(109, 40, 217, .08);
}

html { scroll-behavior: smooth; }
html, body { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

body {
  background: #ffffff;
  color: var(--text);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.main { flex: 1; padding-top: 26px; padding-bottom: 64px; }
a { color: var(--purple); text-decoration: none; }
img { max-width: 100%; }
.bi { line-height: 1; vertical-align: -0.115em; }

/* ===== Base box style (nền trắng đặc + viền rõ, các rule sau có thể override riêng) ===== */
.glass, .card, .empty, .search-form, .quality-bar, .post-desc-box, .table-wrap,
.upload-box, .login-box, .related-item {
  background: #ffffff;
  border: 1px solid #e4e0f2;
}

/* ===== Header (chỉ logo + tên) ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .62);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border-bottom: 1px solid rgba(124, 58, 237, .10);
}
.header-inner { display: flex; align-items: center; justify-content: flex-start; height: 62px; }
.logo { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: .2px; display: flex; align-items: center; gap: 10px; }
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--purple);
  flex-shrink: 0;
}
.logo-accent {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ===== Hero ===== */
.hero { text-align: center; padding: 48px 0 10px; }
.hero h1 { font-size: clamp(32px, 4.8vw, 48px); font-weight: 900; letter-spacing: -1px; line-height: 1.1; }
.hero-sub {
  color: var(--muted); margin: 14px auto 28px; font-size: 17px; font-weight: 500;
  max-width: 560px; line-height: 1.55;
}
.search-form {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  max-width: 580px; margin: 0 auto; padding: 6px 6px 6px 0;
  border-radius: 999px;
  box-shadow: none;
}
.search-icon { color: var(--muted); font-size: 16px; margin-left: 20px; }
.search-input {
  flex: 1; padding: 11px 8px; border: none; background: transparent; color: var(--text);
  font-size: 16px; outline: none; min-width: 0;
}
.search-input::placeholder { color: var(--muted); }
.search-form .btn-primary { border-radius: 999px; flex-shrink: 0; }

/* ===== Section head ===== */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 38px 0 20px; gap: 12px; flex-wrap: wrap;
}
.section-head h2 { font-size: 21px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.section-head h2 .bi { color: var(--purple); }
.sort-select {
  padding: 8px 34px 8px 14px; border-radius: var(--radius-sm); font-size: 16px; font-weight: 600;
  font-family: inherit; color: var(--text); cursor: pointer; outline: none;
  border: 1px solid #e4e0f2; background: #fff;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%236f6790' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
  transition: border-color .15s;
}
.sort-select:hover, .sort-select:focus { border-color: var(--purple-soft); }

/* ===== Cards ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 22px; }
.card {
  border-radius: var(--radius);
  overflow: hidden; color: var(--text); display: flex; flex-direction: column;
  box-shadow: none;
  border: 1px solid #e4e0f2;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-5px); box-shadow: none; border-color: var(--purple-soft); }
.card-thumb, .related-thumb { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg, #ede9fe, #e2d8fc); overflow: hidden; }
.card-thumb img, .related-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card-thumb img { transform: scale(1.05); }
.thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--purple-soft);
}
.thumb-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(36, 27, 62, 0); transition: .22s; opacity: 0;
}
.thumb-overlay .bi {
  width: 54px; height: 54px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff; border-radius: 50%; padding-left: 4px;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  box-shadow: none;
  transform: scale(.7);
  transition: transform .22s;
}
.card:hover .thumb-overlay { background: rgba(36, 27, 62, .28); opacity: 1; }
.card:hover .thumb-overlay .bi { transform: scale(1); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 800; padding: 4px 11px;
  border-radius: 999px; letter-spacing: .3px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.card-thumb .badge { position: absolute; top: 10px; left: 10px; z-index: 2; }
.badge-hd { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; }
.badge-storage { background: rgba(255, 255, 255, .7); color: var(--muted); border: 1px solid rgba(124, 58, 237, .15); }
.duration-pill {
  position: absolute; bottom: 8px; right: 8px; z-index: 2;
  background: rgba(15, 10, 30, .55); color: #fff;
  font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
  letter-spacing: .3px;
}

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title {
  font-size: 17px; font-weight: 750; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-desc {
  color: var(--muted); font-size: 13px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
.card-date, .card-views { color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.card-views .bi-play { font-size: 17px; }
#view-count .bi-play { font-size: 17px; }

.empty {
  text-align: center; padding: 68px 24px; color: var(--muted); font-size: 16px;
  border-radius: var(--radius);
  box-shadow: none;
}
.empty > .bi { font-size: 42px; color: var(--purple-soft); display: block; margin-bottom: 12px; }

/* ===== Video page (2 cột kiểu YouTube) ===== */
.breadcrumb { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--purple); }
.breadcrumb span {
  color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 55vw;
}
.breadcrumb .bi-chevron-right { font-size: 11px; }

.video-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 30px; align-items: start; }
.video-layout.no-aside { grid-template-columns: minmax(0, 860px); justify-content: center; }

.player-wrap {
  aspect-ratio: 16/9; background: #0d0a1a; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--glass-border);
  box-shadow: none;
}
.player-wrap video { width: 100%; height: 100%; display: block; }

.quality-bar.processing {
  display: flex; align-items: center; gap: 9px;
  margin-top: 14px; padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: none;
  font-size: 13.5px; color: var(--muted);
}
.quality-bar.processing .bi { color: var(--purple); }

.post-title { font-size: clamp(21px, 3vw, 28px); font-weight: 850; line-height: 1.32; letter-spacing: -.3px; margin-top: 20px; }
.post-meta { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(124, 58, 237, .12);
  padding: 4px 12px; border-radius: 999px;
}
.meta-chip .bi { color: var(--purple); }

.post-desc-box {
  margin-top: 20px; padding: 20px 22px;
  border-radius: var(--radius);
  box-shadow: none;
  background: transparent;
  border: 1px solid #e4e0f2;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.desc-title { font-size: 14px; font-weight: 800; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.desc-title .bi { color: var(--purple); }
.post-desc { color: var(--text); font-size: 15.5px; line-height: 1.65; }
.post-desc a { color: var(--purple); font-weight: 600; text-decoration: none; word-break: break-word; }
.post-desc a:hover { color: var(--purple-2); }

/* Aside "Xem thêm" */
.aside-title { font-size: 17px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
.aside-title .bi { color: var(--purple); }
.related-list { display: flex; flex-direction: column; gap: 12px; }
.related-item {
  display: flex; gap: 12px; padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  box-shadow: none;
  transition: transform .18s, box-shadow .18s;
}
.related-item:hover { transform: translateY(-2px); box-shadow: none; }
.related-thumb { width: 148px; flex-shrink: 0; border-radius: 9px; }
.related-thumb .thumb-placeholder { font-size: 24px; }
.related-thumb .duration-pill { bottom: 5px; right: 5px; font-size: 10.5px; padding: 1px 6px; }
.related-info { min-width: 0; display: flex; flex-direction: column; gap: 5px; padding-top: 2px; }
.related-title {
  font-size: 13.5px; font-weight: 700; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ===== Toast (thông báo nổi góc màn hình) ===== */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 500;
  max-width: min(380px, calc(100vw - 40px));
  padding: 14px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  background: #ffffff; border: 1px solid #e4e0f2;
  animation: toast-in .25s ease-out;
}
.toast.toast-hide { animation: toast-out .25s ease-in forwards; }
@keyframes toast-in {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toast-out {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-12px); opacity: 0; }
}
.toast .bi:first-child { font-size: 18px; flex-shrink: 0; }
.toast-success { border-color: #bbf0cc; color: #15803d; }
.toast-success .bi:first-child { color: #16a34a; }
.toast-error { border-color: #fecdd3; color: #b91c1c; }
.toast-error .bi:first-child { color: #dc2626; }
@media (max-width: 640px) {
  .toast { top: 12px; right: 12px; max-width: calc(100vw - 24px); }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 21px; border-radius: 999px;
  border: 1px solid #e4e0f2;
  background: #ffffff;
  color: var(--text); font-weight: 700; font-size: 14.5px;
  cursor: pointer; transition: .18s; font-family: inherit;
  box-shadow: none;
}
.btn:hover { color: var(--purple); border-color: var(--purple-soft); transform: translateY(-1px); box-shadow: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  color: #fff; border: none;
  box-shadow: none;
}
.btn-primary:hover { color: #fff; filter: brightness(1.07); box-shadow: none; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(124, 58, 237, .08); }
.btn-danger { color: var(--danger); border-color: rgba(220, 53, 69, .25); }
.btn-danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ===== Forms ===== */
.field { display: block; margin-bottom: 18px; }
.field > span, .field-label {
  display: block; font-weight: 700; font-size: 13.5px; color: var(--muted); margin-bottom: 8px;
}
.field input[type="text"], .field input[type="password"], .field textarea, .field select,
.field input[type="file"] {
  width: 100%; padding: 12px 15px; border-radius: var(--radius-sm); font-size: 16px; font-family: inherit;
  border: 1px solid rgba(124, 58, 237, .18);
  background: rgba(255, 255, 255, .78); color: var(--text); outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--purple);
  box-shadow: none;
}
.field input[type="file"] { padding: 10px 12px; cursor: pointer; }
.field input[type="file"]::file-selector-button {
  border: none; border-radius: 999px; padding: 7px 16px; margin-right: 12px;
  background: linear-gradient(135deg, var(--purple), var(--purple-2)); color: #fff;
  font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit;
}

.upload-box { border-radius: var(--radius); padding: 20px; box-shadow: none; }

.progress {
  position: relative; height: 28px; border-radius: 999px;
  margin-top: 14px; overflow: hidden;
  background: rgba(124, 58, 237, .10);
  border: 1px solid rgba(124, 58, 237, .14);
}
.progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--purple-soft), var(--purple), var(--purple-2));
  transition: width .2s;
  border-radius: 999px;
}
.progress-bar.pulse { animation: bar-pulse 1.2s ease-in-out infinite; }
@keyframes bar-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
.progress-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 800; color: var(--text);
}
.upload-current { margin-top: 12px; font-size: 13.5px; color: var(--muted); word-break: break-all; }
.upload-current .bi-check-circle-fill { color: var(--green); }
.upload-current code { background: rgba(124, 58, 237, .08); padding: 2px 9px; border-radius: 7px; font-size: 12.5px; }
.thumb-preview { max-height: 135px; border-radius: var(--radius-sm); border: 1px solid #e4e0f2; margin-top: 8px; box-shadow: none; }
.form-actions { margin-top: 10px; display: flex; justify-content: flex-end; }

/* ===== ADMIN — giao diện riêng, sidebar tách biệt ===== */
.admin-body { background: #ffffff; }
.admin-shell { display: flex; min-height: 100vh; flex: 1; }

.admin-sidebar {
  width: 250px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 16px;
  background: #ffffff;
  border-right: 1px solid #e4e0f2;
}
.side-logo { margin: 2px 6px 4px; font-size: 17.5px; }
.side-tag {
  margin: 2px 6px 18px; font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  color: var(--purple); opacity: .75;
}
.side-nav { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: 12px;
  color: var(--muted); font-weight: 650; font-size: 14px;
  transition: .16s; border: none; background: none; cursor: pointer;
  font-family: inherit; width: 100%; text-align: left;
}
.side-link .bi { font-size: 16px; }
.side-link:hover { color: var(--purple); background: #f2edfc; }
.side-link.active {
  color: #fff; background: linear-gradient(135deg, var(--purple), var(--purple-2));
  box-shadow: none;
}
.side-logout { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee9f7; }
.side-logout-btn { color: var(--danger); }
.side-logout-btn:hover { color: #fff; background: var(--danger); }

.admin-main { flex: 1; min-width: 0; padding: 32px 36px 60px; max-width: 1080px; }

.admin-login-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  background: #ffffff;
}
.login-box {
  width: 100%; max-width: 400px; padding: 36px;
  border-radius: 22px;
  box-shadow: none;
  background: #ffffff;
  border: 1px solid #e4e0f2;
}
.login-box h1 { font-size: 21px; margin-bottom: 24px; text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-box h1 .bi { color: var(--purple); }

.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.admin-head h1 { font-size: 23px; display: flex; align-items: center; gap: 11px; }
.admin-head h1 .bi { color: var(--purple); }
.post-form { max-width: 720px; }

/* ===== Admin table ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: none; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.admin-table th {
  text-align: left; padding: 14px 18px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); border-bottom: 1px solid rgba(124, 58, 237, .12);
}
.admin-table td { padding: 14px 18px; border-bottom: 1px solid rgba(124, 58, 237, .08); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: background .15s; }
.admin-table tbody tr:hover { background: rgba(124, 58, 237, .045); }
.table-title { color: var(--text); font-weight: 700; }
.table-title:hover { color: var(--purple); }
.table-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.table-date { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.table-actions { white-space: nowrap; display: flex; gap: 8px; align-items: center; }

/* Thumbnail nhỏ dùng chung cho bảng desktop + card mobile */
.table-thumb, .admin-item-thumb {
  aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, #efe9fd, #e5dcfa);
  display: flex; align-items: center; justify-content: center;
}
.table-thumb img, .admin-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.table-thumb .thumb-placeholder, .admin-item-thumb .thumb-placeholder { font-size: 16px; color: var(--purple-soft); }
.table-thumb { width: 96px; }

/* Dashboard: bảng trên desktop, card xếp dọc trên mobile (tránh bảng bị cắt cột) */
.admin-card-list { display: none; }
.admin-item-card {
  background: #fff; border: 1px solid #e4e0f2; border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.admin-item-row { display: flex; gap: 12px; }
.admin-item-thumb { width: 100px; }
.admin-item-info { min-width: 0; flex: 1; }
.admin-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 14px; }
.admin-item-actions { display: flex; gap: 8px; }
.admin-item-actions .btn, .admin-item-actions form { flex: 1; }
.admin-item-actions .btn { width: 100%; }
.admin-item-actions form button { width: 100%; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid rgba(124, 58, 237, .10);
  background: rgba(255, 255, 255, .45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 22px 0; text-align: center;
  color: var(--muted); font-size: 13.5px;
}
.site-footer .bi { color: var(--purple); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .video-layout { grid-template-columns: 1fr; }
  .video-aside { margin-top: 8px; }
  .related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
@media (max-width: 900px) {
  /* Sidebar -> thanh điều hướng cố định đáy màn hình, kiểu bottom nav iOS */
  .admin-shell { display: block; }
  .admin-sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: auto; height: auto; z-index: 60;
    flex-direction: row; align-items: stretch;
    padding: 8px max(10px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
    border-right: none; border-top: 1px solid #e4e0f2;
    box-shadow: 0 -6px 24px rgba(76, 29, 149, .08);
  }
  .side-logo, .side-tag { display: none; }
  .side-nav { display: contents; }
  .side-link {
    flex: 1; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 6px 4px; border-radius: 14px;
    font-size: 10.5px; font-weight: 700; text-align: center;
  }
  .side-link .bi {
    font-size: 19px; padding: 3px 16px; border-radius: 999px; transition: .16s;
  }
  .side-link.active { background: none; color: var(--purple); }
  .side-link.active .bi { color: var(--purple); }
  .side-logout { display: contents; }
  .admin-main { padding: 22px 18px calc(96px + env(safe-area-inset-bottom)); }
}
@media (max-width: 680px) {
  .admin-table-desktop { display: none; }
  .admin-card-list { display: block; }
}
@media (max-width: 640px) {
  .search-form { flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius); }
  .search-icon { display: none; }
  .search-input { width: 100%; padding: 10px 6px; text-align: center; }
  .search-form .btn-primary { width: 100%; }
  .related-thumb { width: 128px; }
}
