/* ================================================
   sw-custom.css — ABSENKI Professional Polish
   ================================================ */

/* ═══════════════════════════════════════════════════════
   PHASE 4: STUDENT MOBILE POLISH
   Mobile-first student experience system
   ═══════════════════════════════════════════════════════ */

/* ── Student App Shell ── */
.student-app {
  min-height: 100vh;
  background: linear-gradient(180deg, #f8faff 0%, #eef2ff 100%);
  -webkit-font-smoothing: antialiased;
}
.student-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 14px 100px;
  width: 100%;
}

/* ── Student Card ── */
.student-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid #eaecf3;
  box-shadow: 0 4px 16px rgba(31, 45, 61, 0.06);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.student-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(31, 45, 61, 0.1);
}
.student-card .card-header {
  padding: 1rem 1.1rem;
  background: #fff;
  border-bottom: 1px solid #eaecf3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
.student-card .card-header h3,
.student-card .card-header h4 {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  color: #1a2336;
}
.student-card .card-body {
  padding: 1rem 1.1rem;
}

/* ── Student Action Grid ── */
.student-action-grid {
  display: grid;
  gap: .75rem;
  margin-bottom: .85rem;
}
.student-action-grid.four-col {
  grid-template-columns: repeat(4, 1fr);
}
.student-action-grid.three-col {
  grid-template-columns: repeat(3, 1fr);
}
.student-action-grid.two-col {
  grid-template-columns: repeat(2, 1fr);
}
.student-action-grid .action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  padding: .75rem .5rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #eaecf3;
  transition: all .18s ease;
  text-align: center;
}
.student-action-grid .action-item:active {
  transform: scale(.96);
  box-shadow: 0 4px 12px rgba(94, 114, 228, 0.15);
  border-color: #5e72e4;
}
.student-action-grid .action-item .icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.student-action-grid .action-item ion-icon {
  font-size: 1.3rem;
  color: #fff;
}
.student-action-grid .action-item strong {
  font-size: .66rem;
  font-weight: 700;
  color: #4a5568;
  line-height: 1.3;
  display: block;
  text-align: center;
}

/* ── Primary Buttons ── */
.student-primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 50px;
  padding: .7rem 1.2rem;
  border-radius: 14px;
  font-weight: 800;
  font-size: .95rem;
  color: #fff;
  background: linear-gradient(135deg, #5e72e4, #8245ef);
  border: none;
  box-shadow: 0 6px 18px rgba(94, 114, 228, 0.35);
  text-decoration: none;
  transition: all .18s ease;
  width: 100%;
  touch-action: manipulation;
}
.student-primary-btn:active {
  transform: scale(.97);
  box-shadow: 0 4px 12px rgba(94, 114, 228, 0.3);
}
.student-primary-btn.alt-green {
  background: linear-gradient(135deg, #2dce89, #20b27d);
  box-shadow: 0 6px 18px rgba(45, 206, 137, 0.35);
}
.student-primary-btn.alt-green:active {
  box-shadow: 0 4px 12px rgba(45, 206, 137, 0.3);
}
.student-primary-btn.alt-red {
  background: linear-gradient(135deg, #f5365c, #e02444);
  box-shadow: 0 6px 18px rgba(245, 54, 92, 0.35);
}
.student-primary-btn.alt-red:active {
  box-shadow: 0 4px 12px rgba(245, 54, 92, 0.3);
}
.student-primary-btn ion-icon {
  font-size: 1.2rem;
}
.student-secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .6rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: .85rem;
  color: #5e72e4;
  background: rgba(94, 114, 228, 0.08);
  border: 1.5px solid rgba(94, 114, 228, 0.2);
  text-decoration: none;
  transition: all .18s ease;
}
.student-secondary-btn:active {
  transform: scale(.97);
  background: rgba(94, 114, 228, 0.15);
}

/* ── Status Badges (Student) ── */
.student-status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.2;
}
.student-status-badge.badge-hadir {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.student-status-badge.badge-telat {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.student-status-badge.badge-alfa {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.student-status-badge.badge-izin {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.student-status-badge.badge-sakit {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
.student-status-badge.badge-dispen {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}
.student-status-badge.badge-menunggu {
  background: #f8fafc;
  color: #475467;
  border: 1px solid #e5e7eb;
}
.student-status-badge.badge-setuju {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.student-status-badge.badge-tolak {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ── History List (Student) ── */
.student-history-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.student-history-list .history-item {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .85rem 1rem;
  background: #fff;
  border: 1px solid #e9ecf3;
  border-radius: 14px;
  transition: all .18s ease;
  text-decoration: none;
  color: inherit;
}
.student-history-list .history-item:hover {
  border-color: #5e72e4;
  background: #f8faff;
  box-shadow: 0 4px 12px rgba(94, 114, 228, 0.08);
  transform: translateX(3px);
}
.student-history-list .history-item .item-date {
  min-width: 52px;
  text-align: center;
  flex-shrink: 0;
}
.student-history-list .history-item .item-date strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a2336;
  line-height: 1;
}
.student-history-list .history-item .item-date span {
  font-size: .7rem;
  font-weight: 700;
  color: #8898aa;
  text-transform: uppercase;
}
.student-history-list .history-item .item-body {
  flex: 1;
  min-width: 0;
}
.student-history-list .history-item .item-title {
  font-weight: 700;
  font-size: .88rem;
  color: #1a2336;
}
.student-history-list .history-item .item-meta {
  font-size: .78rem;
  color: #6b7a90;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.student-history-list .history-item .item-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── Empty State (Student) ── */
.student-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  text-align: center;
  color: #8898aa;
}
.student-empty-state ion-icon {
  font-size: 3rem;
  margin-bottom: .75rem;
  opacity: .5;
}
.student-empty-state p {
  margin: 0 auto;
  font-size: .9rem;
  line-height: 1.6;
  max-width: 280px;
}

/* ── Loading States (Student) ── */
.student-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #8898aa;
  font-size: .85rem;
  gap: .5rem;
}
.student-loading::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #e2e8f2;
  border-top-color: #5e72e4;
  border-radius: 50%;
  animation: spin-student .7s linear infinite;
}
@keyframes spin-student { to { transform: rotate(360deg); } }

/* ── Student Profile Card ── */
.student-profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eaecf3;
  box-shadow: 0 4px 12px rgba(31, 45, 61, 0.05);
  margin-bottom: .85rem;
}
.student-profile-card .avatar-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid #5e72e4;
}
.student-profile-card .avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.student-profile-card .profile-info h4 {
  margin: 0 0 3px;
  font-size: .95rem;
  font-weight: 800;
  color: #1a2336;
}
.student-profile-card .profile-info p {
  margin: 0;
  font-size: .78rem;
  color: #6b7a90;
}

/* ── Student Form ── */
.student-form { display: flex; flex-direction: column; gap: .85rem; }
.student-form .form-group { display: flex; flex-direction: column; gap: .3rem; }
.student-form .form-group label {
  font-size: .8rem;
  font-weight: 700;
  color: #4e5d78;
}
.student-form .form-group input,
.student-form .form-group select,
.student-form .form-group textarea {
  border-radius: 12px !important;
  border: 1.5px solid #e2e8f2 !important;
  padding: .65rem .85rem !important;
  font-size: .9rem !important;
  min-height: 46px;
  transition: border-color .2s ease !important;
}
.student-form .form-group input:focus,
.student-form .form-group select:focus,
.student-form .form-group textarea:focus {
  border-color: #5e72e4 !important;
  box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.12) !important;
}
.student-form .form-group textarea { min-height: 90px; resize: vertical; }
.student-form .form-group small {
  font-size: .76rem;
  color: #8898aa;
  line-height: 1.4;
}

/* ── Menu Grid (Student) ── */
.student-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-bottom: .85rem;
}
.student-menu-grid .menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  padding: 1rem .5rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #eaecf3;
  transition: all .18s ease;
  text-align: center;
  gap: .4rem;
}
.student-menu-grid .menu-item:active {
  transform: scale(.95);
  border-color: #5e72e4;
  box-shadow: 0 4px 14px rgba(94, 114, 228, 0.12);
}
.student-menu-grid .menu-item .icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.student-menu-grid .menu-item ion-icon {
  font-size: 1.3rem;
  color: #fff;
}
.student-menu-grid .menu-item strong {
  font-size: .7rem;
  font-weight: 700;
  color: #4a5568;
  line-height: 1.3;
  display: block;
}

/* ── ID Card Wrapper ── */
.student-id-card-wrap {
  display: flex;
  justify-content: center;
  padding: .85rem;
}
.student-id-card-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: .75rem;
}

/* ── Safe Bottom ── */
.student-safe-bottom {
  padding-bottom: max(90px, env(safe-area-inset-bottom, 80px));
}

/* ── Attendance Status Today ── */
.student-today-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-bottom: .85rem;
}
.student-today-status .status-chip {
  padding: .85rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #eaecf3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.student-today-status .status-chip .chip-label {
  font-size: .7rem;
  font-weight: 700;
  color: #8898aa;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.student-today-status .status-chip .chip-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1a2336;
}
.student-today-status .status-chip.masuk-ok,
.student-today-status .status-chip.pulang-ok {
  background: #ecfdf5;
  border-color: #bde4d0;
}
.student-today-status .status-chip.masuk-ok .chip-value,
.student-today-status .status-chip.pulang-ok .chip-value {
  color: #0f8a57;
}
.student-today-status .status-chip.status-warning {
  background: #fffbeb;
  border-color: #f de68a;
}
.student-today-status .status-chip .chip-value.warning { color: #b45309; }
.student-today-status .status-chip.status-danger {
  background: #fef2f2;
  border-color: #fecaca;
}
.student-today-status .status-chip .chip-value.danger { color: #b42318; }

/* ── Scan Camera Card ── */
.student-camera-card {
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  margin-bottom: .85rem;
  position: relative;
}
.student-camera-card video {
  width: 100%;
  display: block;
}
.student-camera-card #reader {
  min-height: 280px;
  border-radius: 0;
}
.student-camera-card #reader video {
  border-radius: 0;
}

/* ── Permission / Location Card ── */
.student-perm-card {
  border-radius: 14px;
  padding: .85rem 1rem;
  border: 1px solid #eaecf3;
  background: #fff;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .85rem;
}
.student-perm-card.ok { border-color: #bde4d0; background: #ecfdf5; }
.student-perm-card.warn { border-color: #fde68a; background: #fffbeb; }
.student-perm-card.error { border-color: #fecaca; background: #fef2f2; }
.student-perm-card ion-icon { font-size: 1.3rem; flex-shrink: 0; }
.student-perm-card .perm-text { font-size: .82rem; font-weight: 600; line-height: 1.4; }
.student-perm-card.ok ion-icon { color: #0f8a57; }
.student-perm-card.ok .perm-text { color: #047857; }
.student-perm-card.warn ion-icon { color: #b45309; }
.student-perm-card.warn .perm-text { color: #92400e; }
.student-perm-card.error ion-icon { color: #b42318; }
.student-perm-card.error .perm-text { color: #991b1b; }

/* ── Touch Overrides ── */
button, a, .btn, ion-icon { touch-action: manipulation; }

/* ── Smooth Scroll ── */
html { scroll-behavior: smooth; }

/* ── Mobile Responsive Overrides ── */
@media (max-width: 575.98px) {
  .student-page { padding: 0 12px 100px; }
  .student-action-grid.four-col { grid-template-columns: repeat(4, 1fr); }
  .student-action-grid .action-item .icon-wrap { width: 38px; height: 38px; border-radius: 10px; }
  .student-action-grid .action-item ion-icon { font-size: 1.1rem; }
  .student-action-grid .action-item strong { font-size: .6rem; }
  .student-menu-grid { grid-template-columns: repeat(3, 1fr); gap: .6rem; }
  .student-menu-grid .menu-item { padding: .75rem .4rem; }
  .student-menu-grid .menu-item .icon-circle { width: 40px; height: 40px; border-radius: 10px; }
  .student-menu-grid .menu-item ion-icon { font-size: 1.1rem; }
  .student-menu-grid .menu-item strong { font-size: .65rem; }
  .student-primary-btn { min-height: 48px; }
  .student-today-status { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .student-today-status .status-chip { padding: .65rem; }
  .student-today-status .status-chip .chip-value { font-size: 1rem; }
  .student-history-list .history-item { padding: .75rem .85rem; }
}

/* ── Bottom Nav Phase 4 Polish ── */
.appBottomMenu {
  padding: 5px 0 env(safe-area-inset-bottom, 8px) !important;
  min-height: 62px;
}
.appBottomMenu .item {
  min-width: 56px;
  flex: 1;
  padding: 6px 6px !important;
  border-radius: 14px;
}
.appBottomMenu .item ion-icon { font-size: 1.35rem; }
.appBottomMenu .item strong {
  font-size: .58rem !important;
  letter-spacing: .02em;
}
#appCapsule {
  padding-bottom: max(88px, calc(env(safe-area-inset-bottom, 8px) + 78px)) !important;
}

/* ---- Scrollbar Custom ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #b0b8d0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #8a95aa; }

/* ---- Focus ---------- */
:focus { outline: 0; box-shadow: none; }
button:focus, a:focus, input:focus, select:focus {
  box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.28) !important;
  transition: box-shadow 0.2s ease;
}

/* ---- Loading Spinner ---------- */
.loading {
  display: none;
  position: fixed;
  top: 60px;
  right: 20px;
  z-index: 999999;
}
.loading .spinner-border {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---- Page Loader ---------- */
#loader {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; }
.loading-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  animation: pulse-icon 1.4s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(94,114,228,0.35);
}
@keyframes pulse-icon {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.75; }
}

/* ---- Smooth Transitions Global ---------- */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a, button, input, select, textarea {
  transition: color 0.2s ease, background-color 0.2s ease,
              border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

/* ---- Toast / SweetAlert Polish ---------- */
.swal-text { text-align: center !important; }
.swal-modal { border-radius: 14px !important; border: none !important; box-shadow: 0 12px 40px rgba(0,0,0,0.18) !important; }
.swal-button { border-radius: 8px !important; font-weight: 600 !important; transition: transform 0.15s ease, background 0.15s ease !important; }
.swal-button:hover { transform: translateY(-1px); }
.swal-content { font-size: 14px; color: #555; }

/* ---- Form Controls Polish ---------- */
.form-control {
  border-radius: 10px !important;
  border: 1.5px solid #e2e8f0 !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
.form-control:focus {
  border-color: #5e72e4 !important;
  box-shadow: 0 0 0 3px rgba(94,114,228,0.15) !important;
}
.form-control::placeholder { color: #a0aec0; opacity: 1; }
label.error {
  color: #e53e3e;
  font-size: 12px;
  position: absolute;
  bottom: -22px;
  left: 0;
}

/* ---- Custom Radio ---------- */
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  margin: 0;
  font: inherit;
  color: #5e72e4;
  width: 1.15em;
  height: 1.15em;
  border: 0.15em solid #cbd5e0;
  border-radius: 50%;
  transform: translateY(-0.05em);
  display: grid;
  place-content: center;
  transition: border-color 0.2s ease;
}
input[type="radio"]::before {
  content: "";
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.15s ease-in-out;
  box-shadow: inset 0.6em 0.6em #5e72e4;
  background-color: CanvasText;
}
input[type="radio"]:checked::before { transform: scale(1); }
input[type="radio"]:checked { border-color: #5e72e4; }
input[type="radio"]:focus { outline: max(2px, 0.1em) solid #5e72e4; outline-offset: 2px; }

/* ---- Cards ---------- */
.card {
  border-radius: 14px !important;
  border: none !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease !important;
  overflow: hidden;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.1) !important; }

/* ---- Buttons ---------- */
.btn {
  border-radius: 10px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  padding: 9px 18px !important;
  border: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease !important;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.15) !important; }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, #5e72e4, #8245ef) !important; }
.btn-primary:hover { background: linear-gradient(135deg, #5364d1, #7039e0) !important; }
.btn-success { background: linear-gradient(135deg, #2dce89, #20b27d) !important; }
.btn-success:hover { background: linear-gradient(135deg, #27b97a, #1c9e6d) !important; }
.btn-danger { background: linear-gradient(135deg, #f5365c, #e02444) !important; }
.btn-danger:hover { background: linear-gradient(135deg, #e02444, #c91f3a) !important; }
.btn-warning { background: linear-gradient(135deg, #fb6340, #f14c26) !important; color: #fff !important; }
.btn-warning:hover { background: linear-gradient(135deg, #f14c26, #d93d1a) !important; }
.btn-block { width: 100%; display: block; }

/* ---- DataTables Custom ---------- */
div.dataTables_filter label { font-weight: normal; white-space: nowrap; text-align: left; float: right; }
div.dataTables_paginate ul.pagination { float: right; }
div.dataTables_info { padding-top: 8px; padding-left: 10px; white-space: nowrap; }
.table { font-size: 14px; }
.table thead th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8898aa;
  border-bottom: 2px solid #e9ecef;
  padding: 12px 10px !important;
}
.table tbody td { padding: 10px 10px !important; vertical-align: middle; }
.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover { background-color: #f7f9fe; }

/* ---- Pagination ---------- */
.pagination > li > a, .pagination > li > span {
  margin: 0 1px;
  color: #525f7f;
  padding: 5px 11px;
  line-height: 33px;
  font-weight: 500;
  font-size: 13px;
  background-color: #fff;
  border: solid 1px #e9ecef;
  border-radius: 8px !important;
  transition: all 0.2s ease;
}
.pagination > li > a:hover {
  color: #fff;
  background: #5e72e4;
  border-color: #5e72e4;
}
.pagination > li:first-child > a, .pagination > li:first-child > span {
  border-top-left-radius: 20px !important;
  border-bottom-left-radius: 20px !important;
}
.pagination > li:last-child > a, .pagination > li:last-child > span {
  border-top-right-radius: 20px !important;
  border-bottom-right-radius: 20px !important;
}
.pagination > .active > a,
.pagination > .active > a:focus,
.pagination > .active > a:hover,
.pagination > .active > span,
.pagination > .active > span:focus,
.pagination > .active > span:hover {
  z-index: 2;
  color: #fff;
  cursor: default;
  background: #5e72e4;
  border-color: #5e72e4;
  box-shadow: 0 2px 8px rgba(94,114,228,0.4);
}

/* ---- Avatar Section ---------- */
.avatar-section { position: relative; }
.avatar-section input[type="file"] {
  display: inline-block;
  opacity: 0;
  position: absolute;
  margin-left: 20px;
  margin-right: 20px;
  padding-top: 30px;
  padding-bottom: 67px;
  width: 85%;
  z-index: 99;
  margin-top: 10px;
  cursor: pointer;
}
.avatar .button {
  background: #5e72e4;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, background 0.2s ease;
}
.avatar .button:hover { transform: translate(-50%, -50%) scale(1.1); background: #8245ef; }
.avatar .button input[type="file"] {
  display: inline-block;
  opacity: 0;
  position: absolute;
  margin-left: 20px;
  margin-right: 20px;
  padding-top: 30px;
  padding-bottom: 67px;
  width: 85%;
  z-index: 999;
  margin-top: 10px;
  cursor: pointer;
}

/* ---- Image Sizes ---------- */
.img-60 { height: 60px; width: 60px; object-fit: cover; border-radius: 8px; }
.img-80 { height: 80px; width: 80px; object-fit: cover; border-radius: 10px; }
.img-100 { height: 100px; width: 100px; object-fit: cover; border-radius: 12px; }
.img-140 { height: 140px; width: 140px; object-fit: cover; border-radius: 14px; }
.img-150 { height: 150px; width: 150px; object-fit: cover; border-radius: 14px; }
.img-200 { height: 200px; width: 200px; object-fit: cover; border-radius: 16px; }

/* ---- Select ---------- */
.select {
  cursor: pointer;
  background-color: transparent;
  box-shadow: none;
  border: 0;
  font-size: 15px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 8px;
  color: #5e72e4;
  transition: background 0.2s ease;
}
.select:hover { background: rgba(94,114,228,0.08); }

/* ---- Modal ---------- */
.modal-content {
  border-radius: 16px !important;
  border: none !important;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15) !important;
}
.modal-header {
  border-radius: 16px 16px 0 0 !important;
  border-bottom: 1.5px solid #f0f2f7 !important;
}
.modal-header .close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: all 0.2s ease;
}
.modal-header .close:hover { opacity: 1; background: rgba(0,0,0,0.12); transform: rotate(90deg); }
.modal-backdrop { background: rgba(0,0,0,0.4); }

/* ---- Modal Full Screen ---------- */
.modal-fullscreen-xl { padding: 0 !important; }
.modal-fullscreen-xl .modal-dialog { width: 100%; max-width: none; height: 100%; margin: 0; }
.modal-fullscreen-xl .modal-content { height: 100%; border: 0; border-radius: 0; }
.modal-fullscreen-xl .modal-body { overflow-y: auto; }

/* ---- Upload Media ---------- */
.upload-media {
  background: #ffffff;
  background-size: 100% !important;
  border: solid 1px #e2e8f0;
  height: 100px;
  width: 100px;
  cursor: pointer;
  margin-right: 10px;
  margin-bottom: 10px;
  text-align: center;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.upload-media:hover {
  border-color: #5e72e4;
  box-shadow: 0 4px 16px rgba(94,114,228,0.15);
  transform: scale(1.03);
}
.upload-media input.upload-hidden {
  width: 100%;
  height: 100px;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  padding: 0;
  margin-top: 0;
  margin-left: 0;
  opacity: 0 !important;
  cursor: pointer;
  display: block !important;
}
.upload-media i { font-size: 30px; color: #a0aec0; line-height: 96px; }
.upload-media img {
  vertical-align: middle;
  width: 100px;
  height: 100px;
  background-size: 100%;
  object-fit: contain;
}

/* ---- File Upload Drag & Drop ---------- */
.file-upload {
  background-color: #ffffff;
  width: 100%;
  margin: 0 auto;
  padding: 10px;
  border-radius: 14px;
  -moz-border-radius: 14px;
  border: dotted 1.5px #e2e8f0;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.file-upload:hover { border-color: #5e72e4; background: #f7f9fe; }
.file-upload-input {
  position: absolute;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  outline: none;
  opacity: 0;
  cursor: pointer;
}
.image-upload-wrap { border: 1.5px dashed #cbd5e0; position: relative; border-radius: 14px; transition: border-color 0.2s ease; }
.image-upload-wrap:hover { border-color: #5e72e4; }
.image-title-wrap { padding: 0 15px 15px 15px; color: #525f7f; }
.drag-text { padding: 30px 0; text-align: center; }
.drag-text i { font-size: 42px; color: #5e72e4; margin-bottom: 12px; }
.drag-text h3 { font-size: 15px; font-weight: 500; color: #525f7f; }
.file-upload-image { max-width: 300px; margin: auto; padding: 10px; }
img.file-upload-image {
  padding: 6px;
  margin-bottom: 6px;
  border: dashed 1px #cbd5e0;
  border-radius: 12px;
}
.file-upload-content { display: none; text-align: center; }

/* ---- ID Card ---------- */
.thema-id-card {
  position: relative;
  display: inline-block;
  background: #ffffff;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  width: 300px;
  height: 480px;
  border-radius: 16px;
  border: solid 1px #e2e8f0;
  padding: 20px;
  margin: auto;
  overflow: hidden;
  box-sizing: border-box;
  vertical-align: top;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.thema-id-card .logo { display: inline-block; margin-top: 30px !important; }
.thema-id-card .logo img { height: 33px; }
.thema-id-card h5 { text-transform: uppercase; font-size: 15px; }
.thema-id-card .avatar-idcard { display: inline-block; border: solid 2px #5e72e4; border-radius: 8px; }
.thema-id-card .avatar-idcard img { width: 150px; height: 180px; object-fit: cover; }
.thema-id-card .qrcode { display: inline-block; border: solid 2px #5e72e4; margin-top: 0 !important; border-radius: 8px; }
.thema-id-card .qrcode img { height: 160px; width: 160px; }
.thema-id-card .description { margin-top: 10px; }
.thema-id-card .description p { font-size: 15px; line-height: 23px; padding: 0; margin: auto; text-transform: uppercase; color: #111; }
.thema-id-card .description p.bold { font-size: 16px !important; font-weight: 600; }

/* ---- Webcam ---------- */
.webcam-capture-body { display: inline-block; text-align: center; margin: auto; }
.webcam-capture, .webcam-capture video {
  display: inline-block;
  width: 100% !important;
  height: 350px !important;
  margin: auto;
  text-align: center;
  border-radius: 16px;
  overflow: hidden;
}
#reader { width: 100%; min-height: 300px; border-radius: 22px; overflow: hidden; background: #111827; }
#reader video { border-radius: 22px; }
#reader__scan_region video { width: 700px !important; }

/* ---- Floating Button ---------- */
.btn-floating {
  position: fixed;
  bottom: 70px;
  right: 10px;
  display: grid;
  transition: all 0.25s ease;
  z-index: 100;
}
.btn-floating .btn {
  margin-bottom: 6px;
  border-radius: 50% !important;
  width: 44px;
  height: 44px;
  padding: 0;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.btn-floating .btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(0,0,0,0.25) !important; }
.btn-floating.active { right: -50px; }

/* ---- Wallet Card ---------- */
.wallet-card {
  background: linear-gradient(135deg, #5e72e4 0%, #8245ef 100%);
  border-radius: 20px;
  padding: 16px 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.wallet-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.wallet-card .balance { display: flex; justify-content: space-between; margin-bottom: 16px; }
.wallet-card .balance p { margin: 0; font-size: 13px; color: rgba(255,255,255,0.85); line-height: 1.5; }
.wallet-card .balance b { font-size: 16px; font-weight: 700; }
.wallet-card .wallet-footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wallet-card .wallet-footer .item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.wallet-card .wallet-footer .icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  margin-bottom: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}
.wallet-card .wallet-footer .item:hover .icon-wrapper { transform: scale(1.08); }
.wallet-card .wallet-footer strong { font-size: 11px; color: rgba(255,255,255,0.9); text-align: center; }
.wallet-card hr { border-color: rgba(255,255,255,0.2); margin: 8px 0; }

/* ---- Stat Box ---------- */
.stat-box {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-box:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.stat-box .title { font-size: 12px; font-weight: 600; opacity: 0.85; margin-bottom: 4px; }
.stat-box .value { font-size: 20px; font-weight: 700; }

/* ---- Transaction Items ---------- */
.transactions { display: flex; flex-direction: column; gap: 6px; }
.transactions .item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}
.transactions .item:hover {
  background: #f7f9fe;
  border-color: #5e72e4;
  transform: translateX(4px);
  box-shadow: 0 2px 12px rgba(94,114,228,0.1);
}
.transactions .item .detail { flex: 1; }
.transactions .item .detail p { margin: 0; font-size: 13px; line-height: 1.6; color: #525f7f; }
.transactions .item .right { font-size: 12px; font-weight: 600; }

/* ---- Progress Bar ---------- */
.progress { height: 6px; border-radius: 10px; overflow: hidden; }
.progress-bar {
  border-radius: 10px;
  transition: width 0.6s ease;
  background: linear-gradient(90deg, #5e72e4, #8245ef);
}

/* ---- Section Titles ---------- */
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #32325d;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e9ecef;
}

/* ---- Badge / Badge Custom ---------- */
.badge {
  border-radius: 20px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
}

/* ---- Table Responsive ---------- */
.table-responsive { display: block; overflow-x: auto; }

/* ---- Progress bar override ---------- */
.progress { display: flex; align-items: center; }

/* ---- Hidden Print ---------- */
.hidden-print { display: none !important; }

/* ---- Spinner Border Custom ---------- */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border: 0.2em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

/* ---- App Header Polish ---------- */
.appHeader {
  background: linear-gradient(135deg, #5e72e4 0%, #8245ef 100%) !important;
  transition: box-shadow 0.3s ease;
}
.appHeader:hover { box-shadow: 0 4px 20px rgba(94,114,228,0.35); }

/* ---- Dropdown Menu Polish ---------- */
.dropdown-menu {
  border-radius: 12px !important;
  border: none !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
  padding: 8px !important;
  min-width: 180px;
}
.dropdown-menu .dropdown-item {
  border-radius: 8px !important;
  padding: 8px 14px !important;
  font-size: 14px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.dropdown-menu .dropdown-item:hover {
  background: rgba(94,114,228,0.08) !important;
  transform: translateX(3px);
}

/* ---- App Sidebar Polish ---------- */
.panelbox .modal-content { border-radius: 0 18px 18px 0 !important; }
.panelbox .profileBox {
  background: linear-gradient(135deg, #5e72e4, #8245ef);
  padding: 20px;
}
.listview.flush.transparent.no-line.image-listview .item {
  border-radius: 10px;
  margin: 2px 8px;
  transition: background 0.15s ease;
}
.listview.flush.transparent.no-line.image-listview .item:hover { background: rgba(94,114,228,0.08); }
.listview.flush.transparent.no-line.image-listview .item .icon-box {
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.listview.flush.transparent.no-line.image-listview .item:hover .icon-box { transform: scale(1.1); }

/* ---- Bottom Menu Polish ---------- */
.appBottomMenu {
  background: #fff !important;
  border-top: 1.5px solid #e9ecef !important;
  padding: 6px 0 !important;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.06) !important;
}
.appBottomMenu .item {
  color: #8898aa !important;
  transition: color 0.2s ease, transform 0.2s ease !important;
  border-radius: 12px;
  padding: 4px 8px !important;
}
.appBottomMenu .item:hover, .appBottomMenu .item.active { color: #5e72e4 !important; transform: translateY(-2px); }
.appBottomMenu .item strong { font-size: 10px; font-weight: 600; margin-top: 2px; }

/* ---- Form Links ---------- */
.form-links { display: flex; justify-content: space-between; align-items: center; margin: 8px 0; font-size: 13px; }
.form-links a { color: #5e72e4; font-weight: 600; text-decoration: none; transition: color 0.2s ease; }
.form-links a:hover { color: #8245ef; text-decoration: underline; }

/* ---- App Capsule ---------- */
#appCapsule { padding-bottom: 80px !important; }

/* ---- Responsive ---------- */
@media only screen and (max-width: 480px) {
  .wallet-card .wallet-footer .webcame canvas { width: 100%; height: 230px; }
  #reader__scan_region video { width: 100% !important; }
  div.dataTables_filter label { float: left; }
  div.dataTables_filter input { margin-left: 0.5em; display: inline-block; width: 160px; }
  .wallet-card { padding: 12px 14px; }
  .stat-box .value { font-size: 15px; }
  .hidden-sm { display: none; }
  .btn-floating { bottom: 80px; right: 8px; }
  .btn-floating .btn { width: 40px; height: 40px; }
  .card { border-radius: 12px !important; }
  .form-control { border-radius: 8px !important; }
}

/* ---- Print Styles (ID Card) ---------- */
@media print {
  .hidden-print, header, footer, aside, nav, form, iframe, .menu, .hero, .adslot, .appHeader, .appBottomMenu, .sidebar, .navbar, .wallet-footer, .section.full, .btn, .button, .text-end, .text-right { display: none !important; }
  a[href]:after { content: none !important; }
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; width: 100% !important; height: auto !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .container, .container-fluid, .row, #divToPrint { margin: 0 !important; padding: 0 !important; }
  .row { display: block !important; width: 100% !important; }
  .col-md-3, .col-sm-3, .col-lg-3, .col-xl-3 { float: left !important; display: block !important; width: 50% !important; max-width: 50% !important; flex: none !important; padding: 6mm !important; margin: 0 !important; box-sizing: border-box !important; page-break-inside: avoid !important; break-inside: avoid !important; }
  .thema-id-card { display: block !important; width: 63mm !important; height: 101mm !important; margin: 0 auto !important; padding: 4mm !important; border-radius: 3mm !important; border: solid 0.3mm #cccccc !important; background-size: 100% 100% !important; background-repeat: no-repeat !important; background-position: center center !important; box-shadow: none !important; overflow: hidden !important; page-break-inside: avoid !important; break-inside: avoid !important; }
  .thema-id-card .logo { margin-top: 6mm !important; }
  .thema-id-card .logo img { height: 8mm !important; width: auto !important; }
  .thema-id-card h5 { font-size: 4mm !important; margin: 2mm 0 !important; line-height: 1.2 !important; }
  .thema-id-card .avatar-idcard { border: solid 0.5mm #5e72e4 !important; margin-top: 2mm !important; }
  .thema-id-card .avatar-idcard img { width: 31mm !important; height: 37mm !important; object-fit: cover !important; display: block !important; }
  .thema-id-card .qrcode { border: solid 0.5mm #5e72e4 !important; margin-top: 2mm !important; }
  .thema-id-card .qrcode img { width: 33mm !important; height: 33mm !important; display: block !important; }
  .thema-id-card .description { margin-top: 2mm !important; }
  .thema-id-card .description p { font-size: 3.2mm !important; line-height: 1.25 !important; margin: 0 !important; padding: 0 !important; text-transform: uppercase !important; }
  .thema-id-card .description p.bold { font-size: 3.5mm !important; font-weight: 700 !important; }
  img { max-width: 100% !important; page-break-inside: avoid !important; }
}
@page { size: A4 portrait; margin: 8mm; }

/* ---- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
.animate-fade-in-up { animation: fadeInUp 0.4s ease forwards; }
.animate-slide-in-left { animation: slideInLeft 0.4s ease forwards; }

/* ---- Placeholder shimmer ---------- */
@keyframes shimmer {
  0% { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}
.shimmer {
  background: linear-gradient(to right, #f0f2f7 8%, #e8eaf0 18%, #f0f2f7 33%);
  background-size: 800px 104px;
  animation: shimmer 1.5s linear infinite;
}

/* ---- Status Indicators ---------- */
.status-ok { color: #2dce89; font-weight: 600; }
.status-warn { color: #fb6340; font-weight: 600; }
.status-error { color: #f5365c; font-weight: 600; }
.status-info { color: #11cdef; font-weight: 600; }

/* ---- Text Helpers ---------- */
.text-primary { color: #5e72e4 !important; }
.text-success { color: #2dce89 !important; }
.text-danger { color: #f5365c !important; }
.text-warning { color: #fb6340 !important; }
.text-muted { color: #8898aa !important; }
.font-weight-bold { font-weight: 700; }
.font-weight-semibold { font-weight: 600; }

/* ===== Phase 4: Student Mobile Polish - END ===== */

/* ----- Student: stat-box overrides (Phase 4) ----- */
.stat-box { border-radius: 18px !important; padding: 16px !important; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.stat-box .title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; opacity: .9; }
.stat-box .text-white { font-size: 14px; font-weight: 700; }

/* ----- Student: wallet-footer grid fix for dashboard (Phase 4) ----- */
.wallet-card .wallet-footer {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 8px;
  align-items: start;
  overflow: visible !important;
}
.wallet-card .wallet-footer .item { width: auto !important; min-width: 0; text-align: center; }
.wallet-card .wallet-footer .item a { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-width: 0; height: 100%; }
.wallet-card .wallet-footer .icon-wrapper { width: 56px; height: 56px; margin: 0 auto 8px; border-radius: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wallet-card .wallet-footer .item strong { display: block; width: 100%; max-width: 74px; margin: 0 auto; font-size: 12px; line-height: 1.18; white-space: normal; overflow-wrap: normal; word-break: normal; }
@media (max-width: 390px) { .wallet-card .wallet-footer { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ----- Student: loading overlay (Phase 4) ----- */
.student-loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.92); z-index: 9999; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
.student-loading-overlay .spinner { width: 40px; height: 40px; border: 3px solid #e9ecef; border-top-color: #5e72e4; border-radius: 50%; animation: spin .8s linear infinite; }
.student-loading-overlay .loading-text { font-size: 14px; color: #62789b; font-weight: 500; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Student: bottom nav polish (Phase 4) ----- */
.appBottomMenu { background: rgba(255,255,255,.97) !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid rgba(0,0,0,.06) !important; box-shadow: 0 -4px 20px rgba(0,0,0,.06); }
#appCapsule { padding-bottom: max(90px, env(safe-area-inset-bottom, 80px)); }
@media (max-width: 575.98px) { .stat-box { border-radius: 14px !important; padding: 14px !important; } }