/* ============================================================================
   BỘ KIỂU TRANG QUẢN LÝ BOT QUẢN TRỊ NHÓM
   Giữ nguyên phong cách lưới nút và cửa sổ của bản gốc (01–07/09/2026).
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: #f6f7f9; color: #1f2328;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.khung-trang {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.khung-dang-nhap {
  max-width: 400px;
  margin: 64px auto 32px;
  padding: 24px 22px;
  background: #fff;
  border: 1px solid #e4e7ea;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(16, 24, 40, .07);
}

.khung-dang-nhap h1 {
  margin: 0 0 6px;
  font-size: 20px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
}

input[type=password], input[type=text], input[type=search], input[type=number] {
  width: 100%; padding: 11px 13px; font-size: 15px;
  border: 1px solid #d5d9de; border-radius: 10px; background: #fff;
  color: #1f2328; font-family: inherit;
  -webkit-appearance: none; appearance: none;
}
input:focus { outline: 2px solid #e91e6355; border-color: #e91e63; }
input:disabled { background: #f3f4f6; color: #6b7280; cursor: not-allowed; }

/* Ô nhập mật khẩu có con mắt bên trong */
.o-mat-khau { position: relative; }
.o-mat-khau input { padding-right: 48px; }
.o-mat-khau .nut-xem-mk {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; padding: 0; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: none; color: #8a919b; box-shadow: none;
}
.o-mat-khau .nut-xem-mk:hover { background: #f1f3f5; color: #4b5563; }
.o-mat-khau .nut-xem-mk svg { width: 20px; height: 20px; }
.o-mat-khau .nut-xem-mk.dang-hien { color: #e91e63; }
.o-mat-khau .nut-xem-mk.dang-hien::after {
  content: ""; position: absolute; left: 9px; right: 9px; top: 50%;
  height: 2px; background: currentColor; transform: rotate(-45deg); border-radius: 2px;
}

button {
  font-family: inherit; font-size: 14.5px; font-weight: 600;
  padding: 11px 18px; border-radius: 10px; border: 0;
  background: #e91e63; color: #fff; cursor: pointer;
}
button:hover { background: #d81b60; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.phu, button.nut-phu { background: #eef0f2; color: #374151; }
button.phu:hover, button.nut-phu:hover { background: #e2e6ea; }

.ghi-chu {
  font-size: 13px; color: #5c646d; line-height: 1.5;
  margin-top: 6px;
}
.bao-loi {
  padding: 10px 12px; border-radius: 10px;
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  font-size: 13.5px; margin-bottom: 12px;
}
.bao-nhac {
  padding: 10px 12px; border-radius: 10px;
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af;
  font-size: 13px; margin-bottom: 14px;
}

.an { display: none !important; }

/* Bảng số liệu */
.cuon-ngang { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th {
  padding: 9px 8px;
  border-bottom: 1px solid #eef0f2;
  text-align: left;
  vertical-align: top;
}
tr:last-child td { border-bottom: 0; }
td.so { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }

/* Nhãn trạng thái */
.nhan {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5;
}
.nhan.tot { background: #dcfce7; color: #166534; }
.nhan.cho { background: #fef3c7; color: #92400e; }
.nhan.xau { background: #fee2e2; color: #991b1b; }

/* Danh sách nhóm thuê */
.the-nhom {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 13px; margin-bottom: 8px;
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px;
  flex-wrap: wrap;
}
.the-nhom .phan-ten { flex: 1 1 220px; min-width: 0; }
.the-nhom .ten-nhom { font-weight: 600; font-size: 14.5px; word-break: break-word; }

/* Hàng nút việc của từng nhóm thuê */
.the-nhom .viec-nhom {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
}
.the-nhom .viec-nhom button {
  padding: 7px 11px; font-size: 12.5px; border-radius: 8px;
}

/* Nhóm đang bị tắt / bot đã ra ngoài: nền đỏ thật nhạt để soi ra giữa danh sách dài */
.the-nhom.tat {
  background: #fff5f5; border-color: #fecaca;
}

/* ============================================================================
   TRANG QUẢN LÝ KIỂU LƯỚI NÚT (01/09/2026)
   ========================================================================= */

.dau-trang {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.dau-trang h1 { margin: 0; font-size: 20px; letter-spacing: -.2px; }
.dau-trang p { margin: 3px 0 0; color: #5c646d; font-size: 13px; line-height: 1.5; }

.luoi-cum {
  display: grid; gap: 11px;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}
.nut-cum {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  min-height: 112px; padding: 15px 15px 14px;
  background: #fff; color: #1f2328;
  border: 1px solid #e4e7ea; border-left: 4px solid var(--mau, #e91e63);
  border-radius: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.05);
  text-align: left; font-family: inherit; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.nut-cum:hover {
  background: #fff; transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16,24,40,.09); border-color: #d3d8dd;
}
.nut-cum:active { transform: translateY(0); }
.nut-cum:focus-visible { outline: 3px solid #e91e6366; outline-offset: 2px; }
.nut-cum .hinh {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--mau, #e91e63) 12%, #fff);
  color: var(--mau, #e91e63); flex: none;
}
.nut-cum .hinh svg { width: 19px; height: 19px; }
.nut-cum .ten { font-size: 15px; font-weight: 700; line-height: 1.25; }
.nut-cum .phu-de {
  font-size: 12.5px; color: #5c646d; font-weight: 400; line-height: 1.45;
  margin-top: -4px;
}
.nut-cum .cham {
  position: absolute; top: 11px; right: 11px;
  min-width: 12px; height: 12px; padding: 0; border-radius: 12px;
  background: #dc2626; color: #fff;
  font-size: 12px; font-weight: 700; line-height: 23px; text-align: center;
}
.nut-cum .cham.an { display: none; }

/* Cửa sổ cụm */
.cua {
  width: min(760px, calc(100vw - 24px));
  max-height: min(86vh, 900px);
  padding: 0; border: 0; border-radius: 16px;
  background: #fff; color: #1f2328;
  box-shadow: 0 24px 60px rgba(16,24,40,.26);
  overflow: hidden;
}
.cua::backdrop { background: rgba(15,23,42,.45); }
.cua .cua-dau {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: #fff; border-bottom: 1px solid #eceff2;
}
.cua .cua-dau h2 { margin: 0; font-size: 16px; flex: 1; }
.cua .cua-dau .vach { width: 4px; height: 20px; border-radius: 3px;
                      background: var(--mau, #e91e63); flex: none; }
.cua .dong-cua {
  width: 44px; height: 44px; padding: 0; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #f1f3f5; color: #374151; border-radius: 11px;
}
.cua .dong-cua:hover { background: #e5e8eb; }
.cua .dong-cua svg { width: 17px; height: 17px; }
.cua .cua-than {
  padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  max-height: calc(min(86vh, 900px) - 69px);
}
.khoi + .khoi { margin-top: 18px; padding-top: 18px; border-top: 1px solid #eef0f2; }
.khoi h3 { margin: 0 0 8px; font-size: 14.5px; }

@media (max-width: 560px) {
  .cua { width: 100vw; max-width: 100vw; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .cua .cua-than { max-height: calc(92vh - 69px); }
  .luoi-cum { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .nut-cum { min-height: 104px; padding: 13px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .nut-cum { transition: none; }
  .nut-cum:hover { transform: none; }
}
