/* ============================================================
   APEX 05 — Team Dashboard | Giao diện chung (không CDN)
   ============================================================ */
:root {
  --bg: #f2f5fa;
  --surface: #ffffff;
  --border: #e5eaf2;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-soft: #eef2ff;
  --sidebar: #0d1428;
  --sidebar-2: #101b3a;
  --green: #047857;  --green-bg: #d1fae5;
  --amber: #b45309;  --amber-bg: #fef3c7;
  --red: #dc2626;    --red-bg: #fee2e2;
  --blue: #1d4ed8;   --blue-bg: #dbeafe;
  --slate: #475569;  --slate-bg: #e8edf5;
  --line: #eef2f8;
  --hover: #f8fafd;
  --input-bg: #ffffff;
  --input-bd: #d7deeb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 10px 28px -16px rgba(15,23,42,.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 50;
  background: linear-gradient(180deg, var(--sidebar-2), var(--sidebar) 55%);
  color: #cbd5e1; display: flex; flex-direction: column;
  transition: transform .25s ease;
}
.side-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px 16px; color: #fff; text-decoration: none;
}
.side-logo:hover { text-decoration: none; }
.logo-badge {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 6px 16px -6px rgba(99,102,241,.7);
}
.side-logo b { font-size: 16px; letter-spacing: .3px; display: block; line-height: 1.2; }
.side-logo small { color: #7c8cb0; font-size: 11.5px; }
.side-nav { flex: 1; padding: 6px 12px; overflow-y: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin: 2px 0; border-radius: 10px;
  color: #aab6d3; font-weight: 500; font-size: 14px; text-decoration: none;
}
.side-nav a .ico { font-size: 17px; width: 22px; text-align: center; }
.side-nav a:hover { background: rgba(148,163,184,.12); color: #fff; text-decoration: none; }
.side-nav a.active {
  background: linear-gradient(90deg, rgba(99,102,241,.32), rgba(99,102,241,.10));
  color: #fff; font-weight: 600;
  box-shadow: inset 2.5px 0 0 #818cf8;
}
.side-user {
  border-top: 1px solid rgba(148,163,184,.15);
  padding: 14px 16px; display: flex; align-items: center; gap: 11px;
}
.side-user .nm { color: #fff; font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.side-user .ps { color: #7c8cb0; font-size: 11.5px; }
.side-user .lo { margin-left: auto; color: #7c8cb0; font-size: 16px; text-decoration: none; }
.side-user .lo:hover { color: #f87171; }

/* ---------------- Topbar (mobile) ---------------- */
.topbar {
  display: none; position: fixed; inset: 0 0 auto 0; height: 56px; z-index: 40;
  background: rgba(13,20,40,.97); color: #fff;
  align-items: center; gap: 12px; padding: 0 14px;
}
.burger {
  background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer;
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
}
.burger:hover { background: rgba(148,163,184,.15); }
.topbar .t-brand { font-weight: 700; letter-spacing: .3px; }
.topbar .t-user { margin-left: auto; }
.overlay {
  display: none; position: fixed; inset: 0; z-index: 45; background: rgba(15,23,42,.5);
}
body.nav-open .overlay { display: block; }

/* ---------------- Main ---------------- */
.main { margin-left: 248px; padding: 26px 32px 48px; min-height: 100vh; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-head h1 { font-size: 21px; font-weight: 750; letter-spacing: -.2px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 18px;
}
.card-title {
  font-size: 15px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.card-title .more { margin-left: auto; font-size: 12.5px; font-weight: 500; }
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: flex; gap: 14px; align-items: center;
}
.stat-ico {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: grid; place-items: center; font-size: 22px; background: var(--primary-soft);
}
.stat-ico.t-green { background: var(--green-bg); }
.stat-ico.t-amber { background: var(--amber-bg); }
.stat-ico.t-red   { background: var(--red-bg); }
.stat-ico.t-blue  { background: var(--blue-bg); }
.stat-card .num { font-size: 20px; font-weight: 800; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.stat-card .lbl { color: var(--muted); font-size: 12.5px; }
.stat-card .sub { font-size: 11.5px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1.9fr 1fr; gap: 18px; align-items: start; }
.grid2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* ---------------- Bảng ---------------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 650; padding: 8px 10px;
  border-bottom: 1.5px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.num-tab { font-variant-numeric: tabular-nums; }

/* ---------------- Badge / chip / avatar ---------------- */
.badge {
  display: inline-block; padding: 2.5px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; white-space: nowrap;
}
.b-slate { background: var(--slate-bg); color: var(--slate); }
.b-blue  { background: var(--blue-bg);  color: var(--blue); }
.b-green { background: var(--green-bg); color: var(--green); }
.b-amber { background: var(--amber-bg); color: var(--amber); }
.b-red   { background: var(--red-bg);   color: var(--red); }
.b-indigo{ background: var(--primary-soft); color: var(--primary); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--slate-bg); color: var(--slate);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 550;
}
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 50%; color: #fff; font-weight: 700; font-size: 12.5px;
  width: 34px; height: 34px; letter-spacing: .3px;
}
.u-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.u-cell .nm { font-weight: 600; line-height: 1.25; }
.u-cell .ps { color: var(--muted); font-size: 12px; }

/* ---------------- Nút ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  padding: 8.5px 15px; text-decoration: none; transition: .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6d28d9); color: #fff;
  box-shadow: 0 6px 14px -6px rgba(79,70,229,.55);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); border-color: #d7deeb; color: var(--text); }
.btn-ghost:hover { background: #f6f8fc; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { filter: brightness(1.08); }
.btn-warn { background: #f59e0b; color: #fff; }
.btn-warn:hover { filter: brightness(1.05); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 5.5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------------- Form ---------------- */
.field { margin-bottom: 13px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 650; color: #334155;
  margin-bottom: 5px;
}
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=date], input[type=time], input[type=month], input[type=password],
select, textarea {
  width: 100%; padding: 9px 12px; font-family: var(--font); font-size: 14px;
  border: 1.5px solid var(--input-bd); border-radius: 10px; background: var(--input-bg); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.13);
}
textarea { resize: vertical; min-height: 84px; }
input[type=file] {
  width: 100%; font-size: 13px; color: var(--muted);
  border: 1.5px dashed #c3cde0; border-radius: 10px; padding: 10px; background: #fafbfe;
}
input[type=file]::file-selector-button {
  margin-right: 10px; border: 0; border-radius: 8px; padding: 7px 12px;
  background: var(--primary-soft); color: var(--primary); font-weight: 650;
  font-family: var(--font); font-size: 12.5px; cursor: pointer;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.checkline input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Khối form thu gọn (admin) */
details.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px;
}
details.panel > summary {
  list-style: none; cursor: pointer; padding: 15px 20px;
  font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 9px;
  border-radius: var(--radius);
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: '▾'; margin-left: auto; color: var(--muted); transition: .2s; }
details.panel[open] > summary::after { transform: rotate(180deg); }
details.panel[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
details.panel .panel-body { padding: 18px 20px; }

/* Segmented radio (điểm danh) */
.seg { display: inline-flex; background: #eaeef6; border-radius: 10px; padding: 3px; gap: 2px; }
.seg label { display: contents; cursor: pointer; }
.seg input { display: none; }
.seg span {
  padding: 5px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 550;
  color: var(--muted); cursor: pointer; white-space: nowrap; user-select: none;
}
.seg span:hover { color: var(--text); }
.seg input:checked + span { background: #fff; box-shadow: 0 1px 4px rgba(15,23,42,.14); color: var(--text); font-weight: 700; }
.seg input[value=co_mat]:checked + span { color: var(--green); }
.seg input[value=bao_vang]:checked + span { color: var(--amber); }
.seg input[value=khong_phan_hoi]:checked + span { color: var(--red); }

/* ---------------- Flash ---------------- */
.flash-stack { margin-bottom: 16px; }
.flash-item {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: 12px; padding: 12px 15px; margin-bottom: 9px;
  font-size: 13.5px; font-weight: 550; border: 1px solid;
  animation: flashIn .25s ease;
}
@keyframes flashIn { from { opacity: 0; transform: translateY(-6px); } }
.flash-item.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-item.error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-item.info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.flash-item .fx {
  margin-left: auto; cursor: pointer; background: none; border: 0;
  font-size: 15px; color: inherit; opacity: .6; line-height: 1;
}
.flash-item .fx:hover { opacity: 1; }

/* ---------------- Progress ---------------- */
.progress { height: 8px; background: #e7ebf3; border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.progress i.done { background: linear-gradient(90deg, #10b981, #059669); }

/* ---------------- Khác ---------------- */
.empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 13.5px; }
.empty .big { font-size: 30px; display: block; margin-bottom: 6px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.file-line {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 7px;
  background: #fafbfe; font-size: 13px;
}
.file-line .fname { font-weight: 600; word-break: break-all; }
.file-line .fmeta { color: var(--muted); font-size: 11.5px; }
.file-line form { margin-left: auto; }
.inline-form { display: inline; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 15px; }
.toolbar .sp { flex: 1; }
.tab-pills { display: inline-flex; background: #e8edf5; padding: 3px; border-radius: 11px; gap: 2px; }
.tab-pills a {
  padding: 6px 13px; border-radius: 9px; font-size: 13px; font-weight: 600;
  color: var(--muted); text-decoration: none;
}
.tab-pills a.on { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(15,23,42,.12); }
.tab-pills a:hover { text-decoration: none; color: var(--text); }

/* ---------------- Trang đăng nhập ---------------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 14px;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(109,40,217,.35), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(37,99,235,.28), transparent 60%),
    linear-gradient(160deg, #0b1220, #131c38 60%, #0b1220);
}
.login-card {
  width: 100%; max-width: 780px; background: #fff; border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(2,6,23,.6); padding: 34px 34px 30px;
}
.login-head { text-align: center; margin-bottom: 24px; }
.login-head .logo-badge { width: 56px; height: 56px; font-size: 22px; margin: 0 auto 12px; border-radius: 16px; }
.login-head h1 { font-size: 21px; letter-spacing: -.2px; }
.login-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.member-group { margin: 18px 0 6px; }
.member-group > b { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.member-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 9px; margin-top: 9px;
}
.member-pick input { display: none; }
.member-pick .mcard {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 12px; padding: 9px 11px;
  transition: .14s; background: #fff;
}
.member-pick .mcard:hover { border-color: #b6c2dd; box-shadow: var(--shadow); }
.member-pick input:checked + .mcard {
  border-color: var(--primary); background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(79,70,229,.14);
}
.member-pick .nm { font-weight: 650; font-size: 13px; line-height: 1.25; }
.member-pick .ps { color: var(--muted); font-size: 11px; }
.login-step2 { text-align: center; }
.login-step2 .who { display: inline-flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.login-step2 .who .nm { font-weight: 750; font-size: 16px; }
.pin-boxes { display: flex; gap: 10px; justify-content: center; margin: 6px 0 18px; }
.pin-boxes input {
  width: 56px; height: 62px; text-align: center; font-size: 26px; font-weight: 800;
  border: 1.5px solid #d7deeb; border-radius: 14px;
}
.login-err {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  border-radius: 11px; padding: 10px 14px; font-size: 13px; font-weight: 600;
  margin-bottom: 14px; text-align: center;
}
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 920px) {
  .sidebar { transform: translateX(-105%); box-shadow: 0 0 60px rgba(2,6,23,.5); }
  body.nav-open .sidebar { transform: translateX(0); }
  .topbar { display: flex; }
  .main { margin-left: 0; padding: 74px 14px 40px; }
  .grid2, .grid2col, .form-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 18.5px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  .login-card { padding: 24px 18px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: 1fr 1fr; }
  .pin-boxes input { width: 48px; height: 56px; }
}

/* ============================================================
   V2 — Logo, chế độ tối, bottom nav di động, upload tiến trình
   ============================================================ */

/* ---------------- Logo ---------------- */
.logo-badge { background: linear-gradient(160deg, #101b3a, #0b1220); padding: 5px; }
.logo-badge img { width: 100%; height: 100%; object-fit: contain; display: block; }
.t-logo { width: 26px; height: 26px; vertical-align: -7px; margin-right: 2px; }

/* ---------------- Nút chuyển sáng / tối ---------------- */
.theme-btn {
  border: 1px solid rgba(148,163,184,.25); background: rgba(148,163,184,.10);
  color: #cbd5e1; border-radius: 10px; cursor: pointer; font-family: var(--font);
  font-size: 13px; font-weight: 600; padding: 8px 12px;
  display: inline-flex; align-items: center; gap: 7px;
}
.theme-btn:hover { background: rgba(148,163,184,.2); color: #fff; }
.side-theme { padding: 10px 16px 4px; }
.side-theme .theme-btn { width: 100%; justify-content: flex-start; }
.topbar .t-theme { padding: 6px 9px; font-size: 15px; margin-left: auto; border: 0; }
.topbar .t-user { margin-left: 4px; }

/* ---------------- Bottom nav (di động) ---------------- */
.bottombar { display: none; }
@media (max-width: 920px) {
  .bottombar {
    display: flex; position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottombar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 5px 2px; border-radius: 12px; text-decoration: none;
    color: var(--muted); font-size: 10.5px; font-weight: 650; min-height: 46px; justify-content: center;
  }
  .bottombar a .b-ico { font-size: 20px; line-height: 1; }
  .bottombar a.on { color: var(--primary); background: var(--primary-soft); }
  .bottombar a:active { transform: scale(.94); }
  .main { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
}

/* ---------------- Responsive mạnh hơn cho di động ---------------- */
@media (max-width: 700px) {
  .hide-sm { display: none !important; }
  body { font-size: 14px; }
  .card, details.panel .panel-body { padding: 14px; }
  details.panel > summary { padding: 13px 14px; }
  .card-title { font-size: 14.5px; }
  .btn { padding: 10px 14px; }        /* nút to hơn cho ngón tay */
  .btn-sm { padding: 7px 11px; }
  .tbl th, .tbl td { padding: 8px 7px; }
  .page-head { margin-bottom: 14px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .stat-card { padding: 13px 14px; gap: 11px; }
  .stat-card .num { font-size: 17px; }
  .seg span { padding: 6px 9px; font-size: 12px; }
  input, select, textarea { font-size: 16px !important; } /* chặn iOS tự zoom khi focus */
}

/* ---------------- Thanh tiến trình upload ---------------- */
.up-progress { display: none; margin-top: 10px; }
.up-progress.show { display: block; }
.up-progress .track { height: 10px; background: var(--slate-bg); border-radius: 999px; overflow: hidden; }
.up-progress .fill {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6); transition: width .2s;
}
.up-progress .pct { font-size: 12px; color: var(--muted); margin-top: 5px; font-weight: 650; }

/* ---------------- Hàng danh sách & video ---------------- */
.list-row { padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.me-row { background: var(--primary-soft); }
.video-box { margin-top: 10px; }
.video-box video {
  width: 100%; max-height: 380px; border-radius: 12px; background: #000;
  display: block; outline: none;
}

/* ============================================================
   CHẾ ĐỘ TỐI  — [data-theme="dark"]
   ============================================================ */
html.theme-anim, html.theme-anim body, html.theme-anim .card, html.theme-anim .sidebar,
html.theme-anim .tbl td, html.theme-anim .btn, html.theme-anim input, html.theme-anim select,
html.theme-anim textarea, html.theme-anim .bottombar, html.theme-anim details.panel,
html.theme-anim .stat-card, html.theme-anim .badge, html.theme-anim .topbar {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease !important;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #121b32;
  --border: #22304f;
  --text: #e2e8f0;
  --muted: #8fa0bd;
  --primary: #818cf8;
  --primary-soft: rgba(99,102,241,.16);
  --green: #34d399;  --green-bg: rgba(16,185,129,.14);
  --amber: #fbbf24;  --amber-bg: rgba(245,158,11,.14);
  --red: #f87171;    --red-bg: rgba(239,68,68,.15);
  --blue: #93c5fd;   --blue-bg: rgba(59,130,246,.16);
  --slate: #a7b6d0;  --slate-bg: #223050;
  --line: #1d2947;
  --hover: #16213c;
  --input-bg: #0d1730;
  --input-bd: #2b3c63;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -18px rgba(0,0,0,.55);
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #0e1830, #0a101f 55%); }
[data-theme="dark"] .topbar { background: rgba(10,16,31,.97); }
[data-theme="dark"] input:focus, [data-theme="dark"] select:focus, [data-theme="dark"] textarea:focus {
  border-color: #818cf8; box-shadow: 0 0 0 3px rgba(129,140,248,.18);
}
[data-theme="dark"] input[type=file] { background: #0d1730; border-color: #33456e; color: var(--muted); }
[data-theme="dark"] input[type=file]::file-selector-button { background: rgba(99,102,241,.2); color: #a5b4fc; }
[data-theme="dark"] .seg { background: #0d1730; }
[data-theme="dark"] .seg input:checked + span { background: #223050; box-shadow: none; color: #e2e8f0; }
[data-theme="dark"] .seg input[value=co_mat]:checked + span { color: var(--green); }
[data-theme="dark"] .seg input[value=bao_vang]:checked + span { color: var(--amber); }
[data-theme="dark"] .seg input[value=khong_phan_hoi]:checked + span { color: var(--red); }
[data-theme="dark"] .btn-ghost { background: #1a2440; border-color: #2b3c63; color: #dbe4f3; }
[data-theme="dark"] .btn-ghost:hover { background: #223050; }
[data-theme="dark"] .btn-danger { background: rgba(239,68,68,.16); color: #fca5a5; }
[data-theme="dark"] .btn-danger:hover { background: rgba(239,68,68,.28); }
[data-theme="dark"] .file-line { background: #0e1729; }
[data-theme="dark"] .stat-ico { background: rgba(99,102,241,.16); }
[data-theme="dark"] .stat-ico.t-green { background: rgba(16,185,129,.14); }
[data-theme="dark"] .stat-ico.t-amber { background: rgba(245,158,11,.14); }
[data-theme="dark"] .stat-ico.t-red   { background: rgba(239,68,68,.15); }
[data-theme="dark"] .stat-ico.t-blue  { background: rgba(59,130,246,.16); }
[data-theme="dark"] .tab-pills { background: #0d1730; }
[data-theme="dark"] .tab-pills a.on { background: #223050; color: #e2e8f0; box-shadow: none; }
[data-theme="dark"] .flash-item.success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.35); color: #6ee7b7; }
[data-theme="dark"] .flash-item.error   { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.35);  color: #fca5a5; }
[data-theme="dark"] .flash-item.info    { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.35); color: #93c5fd; }
[data-theme="dark"] .progress { background: #223050; }
[data-theme="dark"] .up-progress .track { background: #223050; }
[data-theme="dark"] .bottombar { background: rgba(13,20,38,.95); }
[data-theme="dark"] .field label { color: #b9c6de; }

/* Trang đăng nhập — bản tối */
[data-theme="dark"] .login-card { background: #121b32; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); }
[data-theme="dark"] .member-pick .mcard { background: #0e1729; border-color: #263455; }
[data-theme="dark"] .member-pick .mcard:hover { border-color: #3b4f7e; }
[data-theme="dark"] .member-pick input:checked + .mcard {
  border-color: #818cf8; background: rgba(99,102,241,.14); box-shadow: 0 0 0 3px rgba(129,140,248,.16);
}
[data-theme="dark"] .login-err { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); color: #fca5a5; }
