/* CSS riêng của app: chỉ bố cục. Màu, font lấy từ lớp .saly-* và biến var(--brand-*), var(--font-*). */

.saly-main > section {
  margin-bottom: var(--space-4);
}

/* ---- Đầu trang ---- */
.dau-trang > * {
  margin: 0;
}

.dau-trang {
  display: grid;
  gap: var(--space-1);
}

.tieu-de {
  margin: 0;
}

.thong-tin-ngay {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin-top: var(--space-2);
}

/* ---- 4 ô đếm: 2x2 trên điện thoại, 4 cột trên máy tính ---- */
.o-dem-nhom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.o-dem {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-1);
  width: 100%;
  min-height: 88px;
  margin: 0;
  padding: var(--space-3);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-left: 6px solid var(--brand-border);
}

.o-dem--het { border-left-color: var(--brand-danger); }
.o-dem--sap-het { border-left-color: var(--brand-secondary); }
.o-dem--sap-den { border-left-color: var(--chart-3, var(--brand-secondary)); }
.o-dem--dang-dung { border-left-color: var(--brand-primary); }

.o-dem[aria-pressed="true"] {
  outline: 3px solid var(--brand-primary);
  outline-offset: 2px;
}

.o-dem:focus-visible {
  outline: 3px solid var(--brand-primary-strong);
  outline-offset: 2px;
}

.o-dem-so {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.o-dem-nhan {
  font-size: 0.95rem;
}

/* ---- Tìm và lọc ---- */
.bo-loc {
  display: grid;
  gap: var(--space-3);
}

.bo-loc .saly-input {
  font-size: 16px;
  min-height: 48px;
  width: 100%;
  box-sizing: border-box;
}

.loc-goi {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.nut-loc {
  flex: 1 1 auto;
  min-height: 48px;
  min-width: 48px;
  padding: 0 var(--space-3);
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: var(--brand-surface-alt);
  color: var(--brand-text);
  cursor: pointer;
}

.nut-loc[aria-pressed="true"] {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-on-primary);
  font-weight: 600;
}

.nut-loc:focus-visible {
  outline: 3px solid var(--brand-primary-strong);
  outline-offset: 2px;
}

/* ---- Danh sách thẻ học viên ---- */
.tieu-de-danh-sach {
  margin: 0 0 var(--space-3);
  font-size: 1.15rem;
}

.danh-sach {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}

.the-hv {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  border-left: 6px solid var(--brand-border);
}

.the-hv > * {
  margin: 0;
}

.the-hv--da-het { border-left-color: var(--brand-danger); }
.the-hv--sap-het { border-left-color: var(--brand-secondary); }
.the-hv--sap-den { border-left-color: var(--chart-3, var(--brand-secondary)); }
.the-hv--dang-dung { border-left-color: var(--brand-primary); }

.the-hv-dau {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
}

.the-hv-ten {
  margin: 0;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.the-hv-nhan {
  flex: none;
  white-space: nowrap;
}

.the-hv-khoa {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  align-items: center;
}

.the-hv-nhom {
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.the-hv-con-lai {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.so-ngay {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
}

.the-hv--da-het .so-ngay { color: var(--brand-danger); }

.so-ngay--chu {
  font-size: 1.5rem;
}

.the-hv-ngay {
  font-size: 0.95rem;
}

.thanh-thoi-gian {
  width: 100%;
  height: 10px;
}

.danh-sach-trong {
  margin: 0;
}

/* ---- Máy tính bảng / máy tính ---- */
@media (min-width: 768px) {
  .o-dem-nhom {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .danh-sach {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loc-goi {
    flex-wrap: nowrap;
  }

  .nut-loc {
    flex: 0 0 auto;
  }
}

@media (min-width: 1024px) {
  .bo-loc {
    grid-template-columns: minmax(0, 22rem) 1fr;
    align-items: end;
  }

  .danh-sach {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
