/* ═════════════════════════════════════════════════════════════
   PHASE 2 STYLES — bổ sung cho style.css
   Tables, status tags, charts, modal forms
   ═════════════════════════════════════════════════════════════ */

/* ── FILTER GRID ── */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}
.filter-grid .field { margin: 0; }
@media (max-width: 768px) {
  .filter-grid { grid-template-columns: 1fr 1fr; }
}


/* ── DATA TABLE ── */
.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}
.data-table th {
  padding: 11px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tbody tr:hover { background: rgba(37,99,196,.03); }
.data-table .empty {
  padding: 60px 20px !important;
  text-align: center;
  color: var(--muted);
  border-bottom: none !important;
}
.cell-strong { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.muted { color: var(--muted); }
.mono { font-family: 'SF Mono', Monaco, monospace; font-size: 12px; }
.text-red    { color: var(--red); }
.text-green  { color: var(--green); }
.text-warning{ color: var(--yellow); }


/* ── STATUS TAGS ── */
.status-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.s-warning { background: var(--yellow-pale); color: var(--yellow); }
.s-success { background: var(--green-pale); color: var(--green); }
.s-danger  { background: var(--red-pale);   color: var(--red); }
.s-muted   { background: var(--bg);          color: var(--muted); }


/* ── MON TAG ── */
.mon-tag {
  display: inline-block;
  padding: 3px 8px;
  background: var(--blue-pale);
  color: var(--blue2);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}


/* ── PROGRESS BAR ── */
.progress-bar {
  height: 5px;
  background: var(--bg);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue2));
  border-radius: 100px;
  transition: width .3s;
}
.cho-info { font-size: 13px; }


/* ── SWITCH TOGGLE ── */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 100px;
  transition: .25s;
}
.switch-slider::before {
  content: '';
  position: absolute;
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .25s;
}
.switch input:checked + .switch-slider { background: var(--green); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }


/* ── BULK BAR ── */
.bulk-bar {
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 14px;
  z-index: 5;
  box-shadow: var(--shadow-lg);
}
.bulk-info { font-size: 13px; font-weight: 600; }
.bulk-actions { display: flex; gap: 6px; flex-wrap: wrap; }


/* ── PAGINATION ── */
.pagination {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.pg-info { font-size: 12px; color: var(--muted); }
.pg-controls { display: flex; align-items: center; gap: 4px; }
.pg-current {
  font-size: 12px; padding: 0 12px;
  color: var(--muted);
}


/* ── BUTTON EXTRA SIZE ── */
.btn-xs { padding: 5px 10px; font-size: 11px; }


/* ── FORM GRID 2 cols ── */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid-2 .field { margin: 0; }
@media (max-width: 480px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}


/* ── DETAIL VIEW ── */
.detail-grid {
  display: flex; flex-direction: column; gap: 14px;
}
.detail-section {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
}
.detail-section h4 {
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
}
.detail-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 4px 0;
  font-size: 13px;
  border-top: 1px solid rgba(0,0,0,.04);
}
.detail-row:first-of-type { border-top: none; }
.detail-row span { color: var(--muted); }
.detail-row strong { color: var(--ink); font-weight: 600; }


/* ── CHART ── */
.chart-area {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}


/* ── GRID 2 COLUMNS for cards ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}


/* ── HOT CLASSES ROW ── */
.hot-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.hot-row:last-child { border-bottom: none; }
.hot-rank {
  width: 32px; height: 32px;
  background: var(--gold);
  color: var(--ink);
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}
.hot-info { flex: 1; min-width: 0; }
.hot-name { font-weight: 600; color: var(--ink); font-size: 14px; }
.hot-meta { font-size: 11px; color: var(--muted); margin: 2px 0 6px; }
.hot-pct {
  font-weight: 700; color: var(--blue2);
  font-size: 18px;
  min-width: 50px; text-align: right;
}


/* ── SUBJECT ROWS ── */
.subject-row {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}
.subject-name { font-weight: 600; font-size: 13px; }
.subject-num { font-size: 13px; text-align: right; }


/* ── RECENT LIST ── */
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  gap: 12px;
}
.recent-name { font-weight: 600; color: var(--ink); font-size: 13px; }
.recent-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.recent-time { font-size: 11px; margin-top: 4px; text-align: right; }
