/* =====================================================================
   BẾP HỌC ĐƯỜNG - HOCTAP.CSS
   Style riêng cho trang Quản lý học tập (quanlyhoctap.html)
   Theme: tím (#7b1fa2) - phân biệt với admin (xanh), GV (cam), PH (xanh-tím)
   ===================================================================== */

.ht-header { background: linear-gradient(135deg, #7b1fa2, #4a148c) !important; }

.ht-toolbar { background: white; padding: 12px 16px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ht-toolbar label { font-size: 13px; color: #555; font-weight: 600; margin-right: 4px; }
.ht-toolbar select { width: auto; min-width: 140px; }

.ht-tabs { display: flex; gap: 4px; background: white; padding: 8px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); margin-bottom: 16px; overflow-x: auto; }
.ht-tab { background: #f5f5f5; color: #555; border: 2px solid transparent; padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; transition: all .15s; white-space: nowrap; display: flex; align-items: center; gap: 6px; font-family: inherit; }
.ht-tab:hover { background: #f3e5f5; color: #7b1fa2; }
.ht-tab.active { background: #7b1fa2; color: white; }

/* ============== THỜI KHÓA BIỂU ============== */
.tkb-grid { display: grid; grid-template-columns: 90px repeat(6, 1fr); gap: 4px; }
.tkb-head { background: #7b1fa2; color: white; padding: 10px 6px; text-align: center; font-weight: 600; font-size: 12px; border-radius: 6px; }
.tkb-time { background: #fafafa; padding: 10px 6px; text-align: center; border-radius: 6px; }
.tkb-time .lbl { font-weight: 700; font-size: 13px; color: #555; }
.tkb-time .tm { font-size: 10px; color: #999; margin-top: 2px; }
.tkb-cell { background: #f8fbff; border: 1px dashed #c5e1f7; border-radius: 6px; padding: 8px 6px; min-height: 70px; cursor: pointer; transition: all .15s; font-size: 12px; }
.tkb-cell:hover { background: #f3e5f5; border-style: solid; border-color: #ce93d8; }
.tkb-cell.filled { background: linear-gradient(135deg, #f3e5f5, #e1bee7); border-color: #ce93d8; border-style: solid; }
.tkb-cell.filled:hover { background: linear-gradient(135deg, #e1bee7, #ce93d8); }
.tkb-cell .sub { font-weight: 700; color: #6a1b9a; font-size: 13px; }
.tkb-cell .tch { font-size: 11px; color: #555; margin-top: 4px; }

/* ============== BẢNG ĐIỂM ============== */
.gd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gd-table th, .gd-table td { padding: 8px 10px; border: 1px solid #e0e0e0; text-align: center; }
.gd-table thead { background: linear-gradient(135deg, #7b1fa2, #ab47bc); color: white; }
.gd-table thead th { font-size: 12px; padding: 10px 6px; }
.gd-table tbody tr:hover { background: #faf5fc; }
.gd-table .col-name { text-align: left; font-weight: 600; min-width: 150px; }
.gd-table .col-stt { width: 36px; color: #999; font-weight: 600; }
.gd-table .gd-cell { cursor: pointer; transition: background .15s; min-height: 32px; }
.gd-table .gd-cell:hover { background: #faf5fc; }
.gd-table .gd-cell.empty { color: #ccc; font-style: italic; }
.gd-table .gd-cell.gd-empty { background: #fafafa; }
.gd-table .gd-cell.gd-empty:hover { background: #f3e5f5; }
.gd-table .gd-cell.gd-empty .gd-plus { color: #ccc; font-size: 18px; font-weight: 700; transition: color .15s; }
.gd-table .gd-cell.gd-empty:hover .gd-plus { color: #7b1fa2; }
.gd-table th.tx-col, .gd-table td.tx-col { min-width: 52px; }

/* Sortable column headers */
.gd-table th.sortable { cursor: pointer; user-select: none; transition: background .15s; position: relative; }
.gd-table th.sortable:hover { background: linear-gradient(135deg, #6a1b9a, #9c27b0); }
.gd-table th .sort-icon { display: inline-block; margin-left: 4px; font-size: 11px; opacity: .65; vertical-align: middle; }
.gd-table th .sort-icon.dim { opacity: .35; font-size: 12px; }
.gd-table th.sorted { background: linear-gradient(135deg, #4a148c, #6a1b9a); }
.gd-table th.sorted .sort-icon { color: #fff59d; opacity: 1; font-weight: 700; font-size: 13px; }
.gd-table .gd-score { display: inline-block; padding: 2px 8px; border-radius: 12px; font-weight: 600; font-size: 12px; margin: 2px; cursor: pointer; }
.gd-table .gd-score.s-high { background: #c8e6c9; color: #1b5e20; }
.gd-table .gd-score.s-mid { background: #ffe0b2; color: #e65100; }
.gd-table .gd-score.s-low { background: #ffcdd2; color: #b71c1c; }
.gd-table .gd-avg { font-size: 16px; font-weight: 700; }

.level-badge { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.level-badge.gray { background: #eeeeee; color: #555; }
.level-badge.green { background: #c8e6c9; color: #1b5e20; }
.level-badge.blue { background: #bbdefb; color: #0d47a1; }
.level-badge.orange { background: #ffe0b2; color: #e65100; }
.level-badge.red { background: #ffcdd2; color: #b71c1c; }

/* ============== BÀI TẬP ============== */
.as-card { background: white; border-left: 4px solid #7b1fa2; border-radius: 8px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.as-card.overdue { border-left-color: #c62828; background: #fff5f5; }
.as-card.upcoming { border-left-color: #43a047; background: #f7fcf7; }
.as-card .as-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.as-card .as-title { font-weight: 700; font-size: 15px; color: #4a148c; }
.as-card .as-meta { font-size: 12px; color: #666; margin: 4px 0 8px; }
.as-card .as-meta span { margin-right: 10px; }
.as-card .as-desc { font-size: 14px; color: #444; white-space: pre-wrap; line-height: 1.5; padding: 8px 10px; background: #fafafa; border-radius: 6px; margin-bottom: 8px; }
.as-card .as-classes { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }

@media (max-width: 768px) {
  .ht-tab { padding: 8px 12px; font-size: 12px; }
  .ht-toolbar { padding: 10px; gap: 6px; }
  .ht-toolbar select { width: 100%; min-width: 0; }
  .ht-toolbar label { width: 100%; margin-right: 0; }
  /* TKB scroll ngang */
  .tkb-grid { grid-template-columns: 70px repeat(6, minmax(90px, 1fr)); overflow-x: auto; }
  .tkb-cell { min-height: 60px; padding: 6px 4px; font-size: 11px; }
  .tkb-cell .sub { font-size: 12px; }
  .tkb-cell .tch { font-size: 10px; }
  .tkb-head { padding: 8px 4px; font-size: 11px; }
  .tkb-time .lbl { font-size: 12px; }
  /* Bảng điểm scroll */
  .gd-table { display: block; overflow-x: auto; white-space: nowrap; }
  .gd-table th, .gd-table td { padding: 6px 8px; font-size: 11px; }
  .gd-table .gd-score { font-size: 11px; padding: 2px 6px; }
  .as-card { padding: 12px; }
  .as-card .as-title { font-size: 14px; }
}
