/**
 * Student portal mobile UI only.
 * Scoped to .student-portal / .student-login — admin & desktop layouts stay default above 992px.
 */
:root {
  --st-ink: #0f2a3d;
  --st-muted: #5a6f7e;
  --st-surface: #ffffff;
  --st-bg: #eef3f6;
  --st-line: #d7e2ea;
  --st-primary: #0b6e4f;
  --st-primary-dark: #085540;
  --st-accent: #1a7fc1;
  --st-warn: #c47a12;
  --st-ok: #1e8a4c;
  --st-radius: 16px;
  --st-radius-sm: 12px;
  --st-shadow: 0 10px 28px rgba(15, 42, 61, 0.08);
  --st-bottom-h: 64px;
}

/* ---------- Login ---------- */
body.student-login {
  margin: 0;
  min-height: 100vh;
  background: var(--st-bg);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

body.student-login .st-auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(26, 127, 193, 0.22), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(11, 110, 79, 0.28), transparent 50%),
    linear-gradient(165deg, #0f2a3d 0%, #0b6e4f 48%, #147a9c 100%);
  padding: 20px 16px 28px;
}

body.student-login .st-auth-brand {
  text-align: center;
  padding: 12px 8px 20px;
}

body.student-login .st-auth-brand img {
  max-width: min(280px, 86vw);
  max-height: 88px;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.25));
}

body.student-login .st-auth-card-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.student-login .st-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--st-surface);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

body.student-login .st-auth-card .card-body {
  padding: 1.75rem 1.35rem 1.5rem;
}

body.student-login .st-auth-title {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--st-ink);
  letter-spacing: -0.02em;
}

body.student-login .st-auth-sub {
  margin: 0 0 1.35rem;
  color: var(--st-muted);
  font-size: 0.92rem;
}

body.student-login .st-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--st-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

body.student-login .form-control {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--st-line);
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
}

body.student-login .form-control:focus {
  border-color: var(--st-primary);
  box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.15);
}

body.student-login .btn-st-login {
  min-height: 50px;
  border-radius: 0 !important;
  font-weight: 700;
  font-size: 1.02rem;
  background: var(--st-primary);
  border-color: var(--st-primary);
  margin-top: 0.5rem;
  width: 100%;
}

body.student-login .btn-st-login:hover,
body.student-login .btn-st-login:focus {
  background: var(--st-primary-dark);
  border-color: var(--st-primary-dark);
}

body.student-login .alert {
  border-radius: 12px;
  font-size: 0.92rem;
}

/* ---------- Shared portal polish ---------- */
body.student-portal {
  background: var(--st-bg);
}

body.student-portal .page {
  background: var(--st-bg);
}

body.student-portal .page-title {
  font-weight: 700;
  color: var(--st-ink);
  letter-spacing: -0.02em;
}

body.student-portal .st-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

body.student-portal .st-reg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e7f3ee;
  color: var(--st-primary-dark);
  border: 1px solid #c6e4d7;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

body.student-portal .card {
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow);
  overflow: hidden;
}

body.student-portal .card-header {
  background: #f7fafc;
  border-bottom: 1px solid var(--st-line);
  padding: 0.95rem 1.15rem;
}

body.student-portal .card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--st-ink);
}

body.student-portal .card-body {
  padding: 1.15rem;
}

body.student-portal .btn,
body.student-portal a.btn,
body.student-portal button.btn,
body.student-portal input.btn,
body.student-login .btn,
body.student-login a.btn,
body.student-login button.btn,
body.student-login input.btn,
body.student-login .btn-st-login {
  border-radius: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  vertical-align: middle;
  font-weight: 600;
  min-height: 40px;
}

body.student-portal .btn i,
body.student-portal a.btn i,
body.student-login .btn i,
body.student-login .btn-st-login i {
  margin: 0;
  line-height: 1;
}

body.student-portal .btn-primary {
  background: var(--st-primary);
  border-color: var(--st-primary);
}

body.student-portal .btn-primary:hover {
  background: var(--st-primary-dark);
  border-color: var(--st-primary-dark);
}

body.student-portal .btn-success {
  background: var(--st-ok);
  border-color: var(--st-ok);
}

body.student-portal .btn-info {
  background: var(--st-accent);
  border-color: var(--st-accent);
}

body.student-portal .alert {
  border-radius: var(--st-radius-sm);
}

body.student-portal .st-empty {
  text-align: center;
  padding: 1.75rem 1rem;
  color: var(--st-muted);
}

body.student-portal .st-empty i {
  font-size: 2rem;
  color: #9bb0bf;
  margin-bottom: 0.5rem;
  display: block;
}

/* Dashboard */
body.student-portal .st-dash-hero {
  background: linear-gradient(135deg, #0f2a3d 0%, #0b6e4f 100%);
  color: #fff;
  border-radius: var(--st-radius);
  padding: 1.25rem 1.2rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--st-shadow);
}

body.student-portal .st-dash-hero h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
}

body.student-portal .st-dash-hero p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.92rem;
}

body.student-portal .st-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.student-portal .st-feature-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius);
  padding: 1rem 0.9rem;
  text-decoration: none !important;
  color: inherit;
  box-shadow: var(--st-shadow);
  min-height: 118px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.student-portal .st-feature-card:active {
  transform: scale(0.98);
}

body.student-portal .st-feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}

body.student-portal .st-feature-icon.fees { background: var(--st-primary); }
body.student-portal .st-feature-icon.result { background: var(--st-accent); }
body.student-portal .st-feature-icon.hall { background: var(--st-warn); }
body.student-portal .st-feature-icon.logout { background: #6c7a89; }

body.student-portal .st-feature-card h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--st-ink);
}

body.student-portal .st-feature-card span {
  font-size: 0.8rem;
  color: var(--st-muted);
  line-height: 1.35;
}

/* Exam fees table container */
body.student-portal .st-fee-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
}

body.student-portal .st-top-title {
  display: none;
}

body.student-portal .st-bottom-nav {
  display: none;
}

/* ---------- Mobile layout ---------- */
@media (max-width: 991.98px) {
  body.student-portal #header_top.header_top {
    background: linear-gradient(90deg, #0f2a3d, #0b6e4f) !important;
    box-shadow: 0 4px 16px rgba(15, 42, 61, 0.18);
    border: 0;
  }

  body.student-portal #header_top .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    max-width: 100%;
  }

  body.student-portal #header_top .hleft {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  body.student-portal #header_top .hleft img {
    height: 36px !important;
    width: 36px !important;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
  }

  body.student-portal #header_top .nav-link.icon {
    color: #fff !important;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
  }

  body.student-portal #header_top .st-top-title {
    display: inline-block;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.15;
    margin-left: 2px;
  }

  body.student-portal #header_top .st-top-title small {
    display: block;
    font-weight: 500;
    font-size: 0.68rem;
    opacity: 0.85;
  }

  body.student-portal #left-sidebar.sidebar {
    background: #fff !important;
    box-shadow: 8px 0 28px rgba(15, 42, 61, 0.18);
  }

  body.student-portal #left-sidebar .brand-name {
    color: var(--st-ink) !important;
    font-size: 1.15rem;
    padding: 1rem 1rem 0.4rem;
  }

  body.student-portal #left-sidebar .nav-tabs {
    border: 0;
    padding: 0 1rem;
  }

  body.student-portal #left-sidebar .nav-tabs .nav-link {
    border: 0;
    color: var(--st-muted);
    font-weight: 600;
    padding-left: 0;
  }

  body.student-portal #left-sidebar .metismenu > li > a {
    border-radius: 12px;
    margin: 4px 10px;
    padding: 12px 14px;
    font-weight: 600;
    color: var(--st-ink) !important;
    min-height: 46px;
  }

  body.student-portal #left-sidebar .metismenu > li > a i {
    width: 22px;
    margin-right: 10px;
    color: var(--st-primary);
  }

  body.student-portal .page {
    padding-bottom: calc(var(--st-bottom-h) + 18px) !important;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.student-portal .section-body,
  body.student-portal .container-fluid,
  body.student-portal .card,
  body.student-portal .card-body {
    max-width: 100%;
  }

  body.student-portal .section-body > .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }

  body.student-portal .page-header-tab {
    display: none !important;
  }

  body.student-portal .st-page-head .page-title {
    font-size: 1.35rem;
  }

  /* Exam Fees list: keep TABLE, scroll only inside wrapper */
  body.student-portal .st-fee-table-wrap,
  body.student-portal .card-body > .table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--st-line);
  }

  body.student-portal #examFeesListTable {
    width: 100%;
    min-width: 640px;
    margin-bottom: 0;
  }

  body.student-portal #examFeesListTable th,
  body.student-portal #examFeesListTable td {
    font-size: 0.8rem;
    vertical-align: middle;
    padding: 0.55rem 0.45rem;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  body.student-portal #examFeesListTable th:nth-child(1),
  body.student-portal #examFeesListTable td:nth-child(1),
  body.student-portal #examFeesListTable th:nth-child(2),
  body.student-portal #examFeesListTable td:nth-child(2),
  body.student-portal #examFeesListTable th:nth-child(5),
  body.student-portal #examFeesListTable td:nth-child(5),
  body.student-portal #examFeesListTable th:last-child,
  body.student-portal #examFeesListTable td:last-child {
    white-space: nowrap;
  }

  body.student-portal #examFeesListTable td:last-child .btn {
    margin: 2px;
    min-height: 36px;
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
  }

  body.student-portal .btn-lg {
    width: 100%;
    margin: 0 0 8px !important;
  }

  body.student-portal .text-center.mb-4 .d-inline,
  body.student-portal .text-center.mb-4 form.d-inline {
    display: block !important;
    width: 100%;
  }

  body.student-portal .st-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    height: var(--st-bottom-h);
    background: #fff;
    border-top: 1px solid var(--st-line);
    box-shadow: 0 -6px 20px rgba(15, 42, 61, 0.08);
    padding: 0 4px env(safe-area-inset-bottom, 0);
  }

  body.student-portal .st-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--st-muted);
    font-size: 0.68rem;
    font-weight: 600;
    min-height: 48px;
  }

  body.student-portal .st-bottom-nav a i {
    font-size: 1.15rem;
  }

  body.student-portal .st-bottom-nav a.is-active,
  body.student-portal .st-bottom-nav a:active {
    color: var(--st-primary);
  }

  body.student-portal .footer {
    display: none;
  }

  body.student-portal .exam_datail th,
  body.student-portal .exam_datail td {
    font-size: 13px !important;
    line-height: 1.35 !important;
    padding: 8px 6px !important;
  }

  body.student-portal .exam_datail img#icon {
    width: 100%;
    height: auto;
  }

  body.student-portal .table-responsive {
    max-width: 100%;
  }
}

@media (max-width: 575.98px) {
  body.student-portal .st-feature-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  body.student-portal .st-feature-card {
    min-height: 110px;
    padding: 0.85rem 0.75rem;
  }

  body.student-portal .st-dash-hero {
    padding: 1.1rem 1rem;
  }
}

@media (min-width: 992px) {
  body.student-portal .st-bottom-nav {
    display: none !important;
  }

  body.student-portal .st-page-head:has(.page-header-tab) .st-reg-chip {
    display: none;
  }

  body.student-portal .st-fee-table-wrap {
    overflow-x: visible;
    border: 0;
  }

  body.student-portal #examFeesListTable {
    min-width: 0;
  }
}
