/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1.5px solid transparent; transition: all var(--transition);
  white-space: nowrap; user-select: none; line-height: 1;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm   { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 11px; }

.btn-primary  { background: var(--primary);  color: #fff; border-color: var(--primary); }
.btn-primary:hover  { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success  { background: var(--success);  color: #fff; border-color: var(--success); }
.btn-success:hover  { background: #15803d; }
.btn-danger   { background: var(--danger);   color: #fff; border-color: var(--danger); }
.btn-danger:hover   { background: #b91c1c; }
.btn-outline  { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover  { background: var(--primary-light); }
.btn-ghost    { background: #fff; color: var(--gray-500); border-color: var(--gray-200); }
.btn-ghost:hover    { background: var(--gray-50); }

/* ── FORM ── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--gray-500); margin-bottom: .35rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--gray-900);
  background: #fff; transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,168,.1);
}
.form-group input::placeholder { color: var(--gray-400); }
.req { color: var(--danger); }
.hint { font-size: 11px; color: var(--gray-400); font-weight: 400; margin-left: 4px; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600;
}
.badge-ci  { background: #dcfce7; color: #15803d; }
.badge-co  { background: #dbeafe; color: #1d4ed8; }
.badge-abs { background: #fee2e2; color: #b91c1c; }
.badge-sa  { background: #ede9fe; color: #6d28d9; }
.badge-adm { background: #e0f2fe; color: #0369a1; }

/* Center align table headers and cells for attendance tables */
.tbl-wrap table th,
.tbl-wrap table td {
  text-align: center;
  vertical-align: middle;
}

.chip {
  display: inline-block; background: var(--gray-100);
  color: var(--gray-700); padding: 2px 9px;
  border-radius: 5px; font-size: 12px; font-family: monospace; font-weight: 700;
}

/* ── TABLE ── */
.table-card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); overflow: hidden; }
.table-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.25rem; border-bottom: 1px solid var(--gray-100);
}
.table-hdr h3 { font-size: 14px; font-weight: 700; color: var(--primary-dark); }
.table-hdr .count { font-size: 12px; color: var(--gray-400); font-weight: 400; margin-left: 5px; }
.tbl-wrap { overflow-x: auto; }

/* Pagination control tweaks */
.table-controls { gap: 12px; }
.table-controls label { font-weight:600; color:var(--gray-700); margin-right:6px; font-size:13px; }
.table-controls select { padding:6px 8px; border-radius:6px; border:1px solid var(--gray-200); }
.table-controls #att-pager { gap:14px; }


table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--gray-50); padding: 10px 14px;
  text-align: left; font-size: 11px; font-weight: 700;
  color: var(--gray-500); text-transform: uppercase;
  letter-spacing: .5px; border-bottom: 1px solid var(--gray-200); white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbff; }
.td-num { color: var(--gray-400); width: 40px; }

.empty { text-align: center; padding: 3.5rem 1rem; color: var(--gray-400); }
.empty-ico { font-size: 44px; margin-bottom: .75rem; }
.empty p { font-size: 14px; }

/* ── MODAL ── */
.modal-wrap {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 500; display: flex; align-items: center;
  justify-content: center; padding: 1rem;
  animation: fadeIn .15s ease;
}
.modal {
  background: #fff; border-radius: var(--radius-lg);
  width: 100%; max-width: 480px; max-height: 92vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: slideUp .18s ease;
}
.modal-hdr {
  padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-hdr h3 { font-size: 15px; font-weight: 700; color: var(--primary-dark); }
.modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--gray-400); line-height: 1; padding: 2px 4px; border-radius: 4px; transition: color var(--transition);
}
.modal-close:hover { color: var(--gray-700); }
.modal-body { padding: 1.4rem 1.5rem; }
.modal-foot {
  padding: .9rem 1.5rem; border-top: 1px solid var(--gray-100);
  display: flex; justify-content: flex-end; gap: .6rem;
  position: sticky; bottom: 0; background: #fff;
}

/* ── ERROR BOX ── */
.err-box {
  background: #fef2f2; border: 1px solid #fecaca;
  color: var(--danger); border-radius: var(--radius-sm);
  padding: 9px 13px; font-size: 13px; margin-top: .75rem;
  display: none;
}
.err-box.show { display: block; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999;
  padding: 11px 18px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-md);
  transform: translateY(80px); opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none; max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-ok  { background: var(--success); color: #fff; }
.toast-err { background: var(--danger);  color: #fff; }

/* ── STAT CARDS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200); padding: 1.25rem;
}
.stat-card .sc-ico   { font-size: 26px; margin-bottom: 8px; }
.stat-card .sc-label { font-size: 12px; color: var(--gray-500); font-weight: 500; }
.stat-card .sc-val   { font-size: 32px; font-weight: 800; line-height: 1; margin-top: 4px; }
.stat-card .sc-sub   { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.sc-blue   .sc-val { color: var(--primary); }
.sc-green  .sc-val { color: var(--success); }
.sc-orange .sc-val { color: var(--warning); }
.sc-red    .sc-val { color: var(--danger);  }

/* ── FILTER CARD ── */
.filter-card {
  background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200); padding: 1.2rem 1.25rem;
  margin-bottom: 1.25rem;
}
.filter-card h3 {
  font-size: 13px; font-weight: 700; color: var(--gray-700);
  margin-bottom: 1rem; display: flex; align-items: center; gap: 6px;
}
.filter-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem;
}
.filter-grid .form-group { margin: 0; }
.filter-grid .form-group label { font-size: 11.5px; }
.filter-grid .form-group input,
.filter-grid .form-group select { padding: 8px 11px; font-size: 13px; }
.filter-actions {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--gray-100);
}

/* ── ANIMATIONS ── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }