/* Kho tư liệu Connect Vietnam — giao diện dùng chung
   Bảng màu lấy từ connectvietnam.org để hai trang là một nhà. */

:root {
  --primary:       #047283;
  --primary-dark:  #035e6c;
  --primary-light: #098ba0;
  --accent:        #61c091;
  --dark:          #1C2B3A;
  --text:          #374151;
  --text-light:    #6B7280;
  --border:        #E5E7EB;
  --bg:            #F4F8FA;
  --bg-nhat:       #F8FFFE;
  --white:         #fff;
  --danger:        #ef4444;
  --success:       #22c55e;
  --warning:       #f59e0b;
  --radius:        12px;
  --radius-lg:     20px;
  --shadow:        0 4px 20px rgba(4,114,131,.08);
  --shadow-lg:     0 10px 40px rgba(4,114,131,.16);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3 { color: var(--dark); line-height: 1.3; margin: 0; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p  { margin: 0; }
a  { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

svg.lucide, [data-lucide] { width: 18px; height: 18px; stroke-width: 2; flex: none; }

.bao { width: min(1180px, 100% - 40px); margin-inline: auto; }
.noi-dung { flex: 1; padding: 30px 0 60px; }
.an { display: none !important; }
.nho { font-size: 13px; color: var(--text-light); }

/* ---------------------------------------------------------- thanh trên */

.thanh-tren {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.thanh-tren .bao { display: flex; align-items: center; gap: 22px; height: 68px; }

.hieu { display: flex; align-items: center; gap: 11px; color: var(--dark); }
.hieu span { display: flex; flex-direction: column; line-height: 1.15; }
.hieu strong { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.hieu small { font-size: 11.5px; color: var(--primary); font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }

.dieu-huong { display: flex; gap: 4px; margin-left: auto; }
.dieu-huong a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px;
  color: var(--text); font-weight: 600; font-size: 14px;
}
.dieu-huong a:hover { background: var(--bg); }
.dieu-huong a.dang-o { background: #E7F4F6; color: var(--primary); }

.goc-nguoi { display: flex; align-items: center; gap: 10px; padding-left: 20px; border-left: 1px solid var(--border); }
.chu-cai {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; font-weight: 700; font-size: 16px;
  display: grid; place-items: center; flex: none;
}
.ten-nguoi { display: flex; flex-direction: column; line-height: 1.25; max-width: 190px; }
.ten-nguoi strong { font-size: 14px; color: var(--dark); }
.ten-nguoi small { font-size: 12px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nut-thoat { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--text-light); }
.nut-thoat:hover { background: #FEF2F2; color: var(--danger); }

/* ---------------------------------------------------------- chân trang */

.chan-trang { border-top: 1px solid var(--border); background: var(--white); padding: 20px 0; }
.chan-trang .bao { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-light); }

/* ---------------------------------------------------------- nút, ô nhập */

.nut {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 11px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s;
  white-space: nowrap;
}
.nut.chinh { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; box-shadow: 0 4px 14px rgba(4,114,131,.25); }
.nut.chinh:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(4,114,131,.32); color: #fff; }
.nut.phu { background: var(--white); border-color: var(--border); color: var(--text); }
.nut.phu:hover { border-color: var(--primary); color: var(--primary); }
.nut.nho { padding: 8px 13px; font-size: 13.5px; border-radius: 9px; }
.nut.da-tai { background: #EFF6FF; color: #1d4ed8; border-color: #BFDBFE; }
.nut.da-dang { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.nut:disabled { opacity: .6; cursor: default; transform: none; }
.nut.dang-cho .chu { opacity: .5; }
.nut.dang-cho::after {
  content: ''; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  animation: xoay .7s linear infinite;
}
.nut.phu.dang-cho::after { border-color: rgba(4,114,131,.3); border-top-color: var(--primary); }
@keyframes xoay { to { transform: rotate(360deg); } }

.lien-ket { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; }

.o {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 11px; padding: 0 14px; transition: border-color .15s, box-shadow .15s;
}
.o:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(4,114,131,.1); }
.o [data-lucide], .o svg { color: var(--text-light); }
.o input, .o textarea {
  flex: 1; border: 0; outline: 0; background: none;
  font: inherit; color: var(--text); padding: 13px 0; min-width: 0;
}
.o.cao { align-items: flex-start; padding-top: 12px; }
.o.cao textarea { resize: vertical; padding-top: 0; }
.o.mo { background: var(--bg); }
.o.nho input { padding: 9px 0; }

select {
  font: inherit; color: var(--text); background: var(--white);
  border: 1.5px solid var(--border); border-radius: 11px; padding: 10px 12px; outline: 0;
}
select:focus { border-color: var(--primary); }

.bao-loi { display: none; margin-top: 12px; padding: 10px 13px; border-radius: 10px; background: #FEF2F2; color: #B91C1C; font-size: 13.5px; }
.bao-loi.hien { display: block; }

/* ---------------------------------------------------------- trang đăng nhập */

.trang-vao { display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px; align-items: center; padding: 20px 0 40px; }
.logo-lon { width: 190px; height: auto; margin-bottom: 26px; }
.gioi-thieu h1 { font-size: 34px; margin-bottom: 14px; }
.gioi-thieu .dan { color: var(--text-light); font-size: 16px; max-width: 34em; }
.diem { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 13px; }
.diem li { display: flex; align-items: flex-start; gap: 12px; font-size: 14.5px; }
.diem [data-lucide], .diem svg { color: var(--accent); margin-top: 3px; }

.the-vao { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 34px; }
.the-vao h2 { font-size: 22px; margin-bottom: 6px; }
.the-vao .phu { color: var(--text-light); font-size: 14px; margin-bottom: 20px; }
.the-vao .phu.giua { text-align: center; margin: 16px 0 0; }
.buoc { display: flex; flex-direction: column; gap: 14px; }
.buoc .o + .nut { margin-top: 4px; }
.buoc .nut.chinh { width: 100%; padding: 14px; font-size: 15px; }
.lui { align-self: flex-start; background: none; border: 0; padding: 0 0 4px; font: inherit; font-size: 13.5px; color: var(--text-light); cursor: pointer; display: flex; align-items: center; gap: 5px; }
.lui:hover { color: var(--primary); }

.o-ma {
  width: 100%; text-align: center; font-size: 34px; font-weight: 800;
  letter-spacing: 14px; text-indent: 14px; color: var(--primary);
  border: 2px dashed #B7E0DE; border-radius: 14px; background: var(--bg-nhat);
  padding: 18px 0; outline: 0; font-family: inherit;
}
.o-ma:focus { border-color: var(--accent); background: #fff; }
.o-ma::placeholder { color: #CBD5E1; }

.dong-y { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--text-light); line-height: 1.5; cursor: pointer; }
.dong-y input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--primary); flex: none; }
.dong-y.nho-may { font-size: 13px; }

/* ---------------------------------------------------------- đầu mục, thanh dung lượng */

.dau-muc { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.dau-muc .dan { color: var(--text-light); font-size: 14.5px; margin-top: 5px; }
.con-lai { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-light); background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; }
.con-lai strong { color: var(--dark); }

.thanh-dung-luong { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 18px; margin-bottom: 24px; }
.chu-thich { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--text-light); margin-bottom: 9px; }
.chu-thich span { display: flex; align-items: center; gap: 7px; }
.vach { height: 8px; border-radius: 99px; background: #EDF2F5; overflow: hidden; }
.vach .day { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--primary-light)); transition: width .3s; }
.vach.nho { height: 6px; width: 140px; flex: none; }

/* ---------------------------------------------------------- thư mục */

.luoi-thu-muc { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.the-thu-muc {
  display: flex; align-items: center; gap: 15px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; color: var(--text); transition: transform .14s, box-shadow .14s, border-color .14s;
}
.the-thu-muc:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #CDE7EA; color: var(--text); }
.the-thu-muc .bieu-tuong {
  width: 46px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, #E7F4F6, #DFF3EA); color: var(--primary);
}
.the-thu-muc .bieu-tuong [data-lucide], .the-thu-muc .bieu-tuong svg { width: 22px; height: 22px; }
.the-thu-muc .than { flex: 1; min-width: 0; }
.the-thu-muc h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.the-thu-muc .mo-ta { font-size: 13px; color: var(--text-light); margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.the-thu-muc .so-lieu { display: flex; gap: 16px; margin-top: 8px; font-size: 12.5px; color: var(--text-light); }
.the-thu-muc .so-lieu span { display: flex; align-items: center; gap: 5px; }
.the-thu-muc .so-lieu [data-lucide], .the-thu-muc .so-lieu svg { width: 14px; height: 14px; }
.the-thu-muc .mui-ten { color: #CBD5E1; }

.trong { text-align: center; padding: 64px 20px; background: var(--white); border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.trong [data-lucide], .trong > svg { width: 46px; height: 46px; color: #CBD5E1; margin-bottom: 14px; }
.trong h2 { margin-bottom: 8px; }
.trong p { color: var(--text-light); max-width: 44ch; margin: 0 auto 20px; }

/* ---------------------------------------------------------- hộp thoại */

.lop-phu { position: fixed; inset: 0; background: rgba(28,43,58,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 60; padding: 20px; }
.hop-thoai { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 28px; width: min(480px, 100%); display: flex; flex-direction: column; gap: 14px; }
.hop-thoai h2 { display: flex; align-items: center; gap: 10px; }
.hop-thoai h2 [data-lucide], .hop-thoai h2 svg { color: var(--primary); }
.hang-nut { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.hang-nut.giua-hai-ben { justify-content: space-between; }
.nhom-nut { display: flex; gap: 10px; }
.nut.nguy-hiem { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.nut.nguy-hiem:hover { background: #FEE2E2; color: #991B1B; }

.hop-thoai.rong { width: min(620px, 100%); max-height: 88vh; overflow-y: auto; gap: 16px; }
.phu-hop-thoai { font-size: 13.5px; color: var(--text-light); margin-top: -4px; }
.nhom { display: flex; flex-direction: column; gap: 8px; }
.nhan { font-size: 13px; font-weight: 700; color: var(--dark); display: flex; align-items: baseline; gap: 7px; }
.nhan em { font-style: normal; color: var(--danger); }
.nhan small { font-weight: 500; color: var(--text-light); font-size: 12px; }
.hai-o { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nhom.hai-o { display: grid; }
.hai-o select, .hai-o .o { width: 100%; }
.nhom.hai-o .nhan { margin-bottom: 8px; }

/* thẻ mảng di sản */
.the-mang {
  font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 99px;
  background: #E7F4F6; color: var(--primary); white-space: nowrap;
}

/* hồ sơ tư liệu trên trang thư mục */
.ho-so {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px 26px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 22px;
}
.ho-so .muc.rong { grid-column: 1 / -1; }
.nhan-nho { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); font-weight: 700; margin-bottom: 3px; }
.ho-so strong { font-size: 14.5px; color: var(--dark); }
.ho-so p { font-size: 14px; }

/* danh sách hồ sơ bên quản trị */
.luoi-ho-so { display: grid; grid-template-columns: repeat(auto-fill, minmax(370px, 1fr)); gap: 16px; }
.the-ho-so { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.the-ho-so header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.the-ho-so h2 { font-size: 17px; }
.the-ho-so .dia-ban { font-size: 13px; color: var(--text-light); margin-top: 3px; }
.mo-ta-day { font-size: 14px; color: var(--text); background: var(--bg-nhat); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 10px 13px; }
.thuoc-tinh { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.thuoc-tinh dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-light); font-weight: 700; }
.thuoc-tinh dd { margin: 2px 0 0; font-size: 13.5px; color: var(--dark); }
.the-ho-so footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: auto; }
.the-ho-so .so-lieu { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-light); flex-wrap: wrap; }
.the-ho-so .so-lieu span { display: flex; align-items: center; gap: 5px; }
.the-ho-so .so-lieu [data-lucide], .the-ho-so .so-lieu svg { width: 14px; height: 14px; }
.duong-kho { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--text-light); background: #F1F5F9; border-radius: 6px; padding: 6px 9px; overflow-x: auto; white-space: nowrap; }

/* ---------------------------------------------------------- đường dẫn + ngăn */

.duong-dan { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-light); margin-bottom: 16px; }
.duong-dan a { display: flex; align-items: center; gap: 6px; }
.duong-dan [data-lucide], .duong-dan svg { width: 15px; height: 15px; }

.ngan-tabs { display: flex; gap: 6px; background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 6px; margin-bottom: 20px; overflow-x: auto; }
.ngan-tabs .tab {
  display: flex; align-items: center; gap: 8px; flex: 1; justify-content: center;
  padding: 11px 14px; border: 0; border-radius: 10px; background: none;
  font: inherit; font-weight: 600; font-size: 14px; color: var(--text-light); cursor: pointer; white-space: nowrap;
}
.ngan-tabs .tab:hover { background: var(--bg); color: var(--text); }
.ngan-tabs .tab.dang-o { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; box-shadow: 0 3px 12px rgba(4,114,131,.22); }
.ngan-tabs .dem { font-style: normal; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: rgba(0,0,0,.06); }
.ngan-tabs .tab.dang-o .dem { background: rgba(255,255,255,.24); }

/* ---------------------------------------------------------- vùng thả */

.vung-tha {
  position: relative; text-align: center; padding: 40px 20px;
  background: var(--white); border: 2px dashed #CFE3E6; border-radius: var(--radius-lg);
  transition: border-color .15s, background .15s; margin-bottom: 18px;
}
.vung-tha.dang-keo { border-color: var(--accent); background: var(--bg-nhat); }
.vung-tha [data-lucide], .vung-tha > svg { width: 40px; height: 40px; color: var(--primary-light); margin-bottom: 10px; }
.vung-tha .lon { font-size: 16px; font-weight: 600; color: var(--dark); }
.vung-tha .nho { margin-top: 5px; }
.chon-tep { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------------------------------------------------------- hàng đợi + bảng tệp */

.hang-doi:not(:empty) { display: grid; gap: 8px; margin-bottom: 14px; }
.dong-cho {
  display: flex; align-items: center; gap: 13px;
  background: var(--bg-nhat); border: 1px solid #D7ECEA; border-radius: var(--radius); padding: 13px 16px;
}
.dong-cho.hong { background: #FEF2F2; border-color: #FECACA; }
.dong-cho .bt { color: var(--primary); }
.dong-cho .phan-tram { font-size: 13px; font-weight: 700; color: var(--primary); width: 44px; text-align: right; }

.bang-tep { display: grid; gap: 8px; }
.dong-tep {
  display: flex; align-items: center; gap: 13px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 16px;
}
.dong-tep.vua-xong { animation: hien-len .45s ease; }
@keyframes hien-len { from { opacity: 0; transform: translateY(-6px); } }
.dong-tep .bt { color: var(--primary); }
.dong-tep .ten, .dong-cho .ten { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.dong-tep .ten strong, .dong-cho .ten strong { font-size: 14px; font-weight: 600; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dong-tep .ten small, .dong-cho .ten small { font-size: 12.5px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Metadata đọc từ chính tệp: nơi chụp, lúc chụp, máy chụp */
.chip-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; line-height: 1.4;
  padding: 3px 9px; border-radius: 99px;
  background: #F1F5F9; color: var(--text-light); white-space: nowrap;
}
.chip [data-lucide], .chip svg { width: 12px; height: 12px; }
.chip.toa-do { background: #E7F4F6; color: var(--primary); }
.chip.toa-do:hover { background: #D5EDF0; color: var(--primary-dark); }
.chua-co { text-align: center; color: var(--text-light); font-size: 14px; padding: 26px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); }

.the-trang-thai { font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 99px; white-space: nowrap; }
.the-trang-thai.cho { background: #FFF7ED; color: #C2410C; }
.the-trang-thai.da-tai { background: #EFF6FF; color: #1D4ED8; }
.the-trang-thai.da-dang { background: #ECFDF5; color: #047857; }

.nut-xoa { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: #CBD5E1; cursor: pointer; }
.nut-xoa:hover { background: #FEF2F2; color: var(--danger); }
.nut-xoa.mo { cursor: default; }
.nut-xoa.mo:hover { background: none; color: #CBD5E1; }

/* ---------------------------------------------------------- lời cảm ơn */

.lop-cam-on { animation: mo-dan .18s ease; }
.the-cam-on {
  position: relative; text-align: center; align-items: center;
  width: min(460px, 100%); padding: 34px 30px 28px; gap: 10px;
  animation: nhoi-len .28s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes nhoi-len { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.the-cam-on .dong-goc { position: absolute; top: 12px; right: 12px; }
.dau-tich {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  color: #fff; margin-bottom: 4px;
  box-shadow: 0 6px 22px rgba(97,192,145,.4);
}
.dau-tich [data-lucide], .dau-tich svg { width: 32px; height: 32px; stroke-width: 3; }
.the-cam-on h2 { font-size: 22px; }
.the-cam-on .so-nhan { font-size: 15px; color: var(--dark); font-weight: 600; }
.the-cam-on .loi-nhan { font-size: 14px; color: var(--text-light); line-height: 1.55; }
.the-cam-on .con-hong { font-size: 13.5px; color: #B91C1C; background: #FEF2F2; border-radius: 9px; padding: 9px 12px; }
.hang-nut.giua { justify-content: center; margin-top: 10px; }

/* ---------------------------------------------------------- tiêu đề tư liệu */

.tieu-de { cursor: text; }
.tieu-de:hover { text-decoration: underline dotted var(--text-light); text-underline-offset: 3px; }
.tieu-de.chua-dat { color: var(--text-light); font-weight: 500; font-style: italic; }
.o-tieu-de {
  width: 100%; font: inherit; font-size: 14px; font-weight: 600; color: var(--dark);
  border: 1.5px solid var(--primary); border-radius: 8px; padding: 5px 9px; outline: 0;
  background: var(--white);
}
.hai-dong { display: inline-flex; flex-direction: column; line-height: 1.35; min-width: 0; vertical-align: -8px; }
.hai-dong small { color: var(--text-light); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------- xem trước */

body.khoa-cuon { overflow: hidden; }

.lop-xem {
  position: fixed; inset: 0; z-index: 80; padding: 26px;
  background: rgba(15,26,36,.82); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: mo-dan .16s ease;
}
@keyframes mo-dan { from { opacity: 0; } }

.khung-xem {
  display: flex; flex-direction: column; gap: 12px;
  width: min(1080px, 100%); max-height: 100%;
}
.khung-xem header { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #fff; }
.nhan-xem { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.nhan-xem strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nhan-xem small { font-size: 12.5px; color: rgba(255,255,255,.65); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.khung-xem .thao-tac { display: flex; gap: 6px; flex: none; }
.bieu-tuong-nut.sang { color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.25); background: none; cursor: pointer; }
.bieu-tuong-nut.sang:hover { background: rgba(255,255,255,.16); color: #fff; }

.than-xem {
  position: relative;
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.28); border-radius: var(--radius); overflow: hidden;
}
.o-xem { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.dem-xem { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.75); padding-right: 6px; white-space: nowrap; }

.lat {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 46px; height: 46px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(15,26,36,.55); color: #fff;
  display: grid; place-items: center;
  transition: background .15s;
}
.lat:hover { background: rgba(15,26,36,.8); }
.lat [data-lucide], .lat svg { width: 24px; height: 24px; }
.lat.truoc { left: 12px; }
.lat.sau { right: 12px; }
.than-xem img, .than-xem video { max-width: 100%; max-height: 78vh; display: block; border-radius: var(--radius); }
.than-xem iframe { width: 100%; height: 78vh; border: 0; background: #fff; border-radius: var(--radius); }
.khung-tieng { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 48px 26px; width: 100%; }
.khung-tieng [data-lucide], .khung-tieng svg { width: 54px; height: 54px; color: var(--accent); }
.khung-tieng audio { width: min(520px, 100%); }
.khong-xem-duoc { color: rgba(255,255,255,.8); padding: 60px 20px; text-align: center; }

/* ---------------------------------------------------------- quản trị */

.o-thong-ke { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.o-thong-ke .o {
  display: flex; align-items: center; gap: 15px; padding: 18px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
}
.o-thong-ke .o.nhac { border-color: #FDBA74; background: #FFFBF5; }
.o-thong-ke .bt { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.o-thong-ke .bt [data-lucide], .o-thong-ke .bt svg { width: 21px; height: 21px; }
.o-thong-ke .bt.xanh { background: #E7F4F6; color: var(--primary); }
.o-thong-ke .bt.tim  { background: #EEF2FF; color: #4F46E5; }
.o-thong-ke .bt.luc  { background: #ECFDF5; color: #059669; }
.o-thong-ke .bt.cam  { background: #FFF7ED; color: #EA580C; }
.o-thong-ke em { display: block; font-style: normal; font-size: 23px; font-weight: 800; color: var(--dark); line-height: 1.2; }
.o-thong-ke span { font-size: 13px; color: var(--text-light); }

.canh-bao { display: flex; align-items: center; gap: 12px; background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 22px; font-size: 14px; }
.canh-bao [data-lucide], .canh-bao svg { color: #D97706; }

.hai-cot { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.khoi { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.khoi h2 { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; }
.khoi h2 [data-lucide], .khoi h2 svg { color: var(--primary); }

.bang { width: 100%; border-collapse: collapse; font-size: 14px; }
.bang th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); font-weight: 700; padding: 0 12px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.bang td { padding: 11px 12px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
.bang tr:last-child td { border-bottom: 0; }
.bang tbody tr:hover { background: var(--bg-nhat); }
.bang .phai { text-align: right; }
.bang .hep { width: 34px; }
.bt-nho { width: 15px; height: 15px; color: var(--primary); vertical-align: -2px; }
.cam-dam { color: #EA580C; }
.lien-he small { color: var(--text-light); }
.cuon-ngang { overflow-x: auto; }

.trang-thai-luoi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.trang-thai-luoi .tt { text-align: center; padding: 16px 10px; border-radius: var(--radius); }
.trang-thai-luoi .tt em { display: block; font-style: normal; font-size: 24px; font-weight: 800; line-height: 1.2; }
.trang-thai-luoi .tt span { font-size: 12.5px; }
.trang-thai-luoi .cho { background: #FFF7ED; color: #C2410C; }
.trang-thai-luoi .da-tai { background: #EFF6FF; color: #1D4ED8; }
.trang-thai-luoi .da-dang { background: #ECFDF5; color: #047857; }

.bieu-do { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.bieu-do .cot { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; height: 100%; }
.bieu-do .than { width: 100%; max-width: 42px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--primary-light), var(--accent)); transition: opacity .15s; }
.bieu-do .cot:hover .than { opacity: .75; }
.bieu-do span { font-size: 10.5px; color: var(--text-light); white-space: nowrap; }

.bo-loc { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.bo-loc .o.nho { flex: 1; min-width: 220px; }

.thanh-chon {
  position: sticky; top: 78px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--dark); color: #fff; border-radius: var(--radius); padding: 12px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow-lg);
}
.thanh-chon strong { color: var(--accent); }

.bang-tep-admin .ten-tep { max-width: 320px; }
.bang-tep-admin .ten-tep span { display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: -4px; }
.bang-tep-admin input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.hang-thao-tac { display: flex; gap: 4px; justify-content: flex-end; }
.bieu-tuong-nut { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text-light); }
.bieu-tuong-nut:hover { background: #E7F4F6; color: var(--primary); }
tr.vua-doi { animation: nhay .8s ease; }
@keyframes nhay { 0%, 100% { background: transparent; } 30% { background: #ECFDF5; } }

.phan-trang { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 20px; font-size: 14px; color: var(--text-light); }

.meo pre { background: var(--dark); color: #E2E8F0; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 13px; margin: 12px 0; }
.meo code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.meo p code { background: #EEF2F5; color: var(--primary-dark); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }

/* ---------------------------------------------------------- màn nhỏ */

@media (max-width: 900px) {
  .trang-vao { grid-template-columns: 1fr; gap: 34px; }
  .gioi-thieu { text-align: center; }
  .gioi-thieu h1 { font-size: 27px; }
  .gioi-thieu .dan { margin-inline: auto; }
  .diem { text-align: left; max-width: 420px; margin-inline: auto; }
  .logo-lon { width: 155px; }
  .hai-cot { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .bao { width: calc(100% - 28px); }
  /* Không cho bất cứ thứ gì đẩy cả trang trượt ngang */
  body { overflow-x: hidden; }

  /* Dòng tệp gói thành hai hàng: tên ở trên, trạng thái và nút ở dưới */
  .dong-tep { flex-wrap: wrap; row-gap: 10px; padding: 13px 14px; }
  .dong-tep .bt { order: 0; }
  .dong-tep .ten { order: 1; flex: 1 1 calc(100% - 32px); }
  .dong-tep .the-trang-thai { order: 2; margin-right: auto; }
  .dong-tep .bieu-tuong-nut,
  .dong-tep .nut-xoa { order: 3; }

  .lat { width: 40px; height: 40px; }
  .lat.truoc { left: 6px; }
  .lat.sau { right: 6px; }
  .khung-xem header { gap: 10px; }
  .lop-xem { padding: 16px 12px; }
  .thanh-tren .bao { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 12px; }
  .dieu-huong { order: 3; width: 100%; margin-left: 0; }
  .dieu-huong a { flex: 1; justify-content: center; }
  .goc-nguoi { margin-left: auto; padding-left: 0; border-left: 0; }
  .ten-nguoi { display: none; }
  .ngan-tabs .tab span { display: none; }
  .the-vao { padding: 24px; }
  .o-ma { font-size: 27px; letter-spacing: 9px; text-indent: 9px; }
  .dong-cho .vach.nho { display: none; }
  .con-lai { width: 100%; }
  .hai-o, .nhom.hai-o { grid-template-columns: 1fr; }
  .luoi-ho-so { grid-template-columns: 1fr; }
  .hop-thoai.rong { padding: 22px; }
}
