:root {
  --nc-primary: #0b2545;
  --nc-primary-dark: #071a31;
  --nc-accent: #c5a059;
  --nc-accent-dark: #a8841f;
  --nc-teal: #0e6b66;
  --nc-success: #0e6b66;
  --nc-bg: #f4f6f9;
  --nc-sidebar: #0b2545;
  --nc-sidebar-text: #f4f1ea;
  --nc-card-shadow: 0 18px 40px rgba(11, 37, 69, 0.08);
  --nc-radius: 16px;
  --nc-font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --nc-serif: "Libre Caslon Text", Georgia, serif;
}

* { box-sizing: border-box; }
body {
  font-family: var(--nc-font);
  background: var(--nc-bg);
  min-height: 100vh;
  color: #172033;
}
h1, h2, h3, h4, h5, .side-brand, .panel-header h5 {
  font-family: var(--nc-serif);
  font-weight: 500;
}

/* Portal landing */
.portal-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(197, 160, 89, 0.18), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(14, 107, 102, 0.15), transparent 50%),
    linear-gradient(160deg, #071a31 0%, #0b2545 50%, #0e6b66 100%);
}
.portal-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  max-width: 920px;
  width: 100%;
  overflow: hidden;
}
.portal-brand {
  background: linear-gradient(135deg, var(--nc-primary), var(--nc-accent));
  color: #fff;
  padding: 2rem;
  text-align: center;
}
.portal-brand h1 { font-size: 1.75rem; font-weight: 700; margin: 0; letter-spacing: .02em; }
.portal-brand p { opacity: .9; margin: .5rem 0 0; }
.portal-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 1.75rem; }
@media (max-width: 768px) { .portal-links { grid-template-columns: 1fr; } }
.portal-link {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid #dce8ee; border-radius: var(--nc-radius);
  padding: 1.25rem; text-align: center; transition: .2s;
  background: #fafcfd;
}
.portal-link:hover {
  border-color: var(--nc-accent); transform: translateY(-2px);
  box-shadow: var(--nc-card-shadow); color: var(--nc-primary);
}
.portal-link i { font-size: 2rem; color: var(--nc-primary); margin-bottom: .5rem; display: block; }
.portal-link strong { display: block; font-size: 1.05rem; }

/* New Student Registration CTA animation */
.btn-reg-animate {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0e6b66 0%, #0b2545 50%, #0e6b66 100%);
  background-size: 200% 200%;
  border: 0;
  color: #fff !important;
  font-weight: 600;
  letter-spacing: .02em;
  box-shadow: 0 4px 14px rgba(11, 37, 69, 0.35);
  animation:
    regPulse 2.2s ease-in-out infinite,
    regGradient 4s ease infinite;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-reg-animate::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  animation: regShine 2.8s ease-in-out infinite;
  pointer-events: none;
}
.btn-reg-animate i {
  display: inline-block;
  animation: regIconBounce 2.2s ease-in-out infinite;
}
.btn-reg-animate:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 22px rgba(197, 160, 89, 0.45);
  animation-play-state: paused;
  color: #fff !important;
}
.btn-reg-animate:hover::after,
.btn-reg-animate:hover i {
  animation-play-state: paused;
}
.btn-reg-animate:active {
  transform: translateY(0) scale(0.98);
}

@keyframes regPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(11, 37, 69, 0.3); }
  50% { box-shadow: 0 6px 24px rgba(197, 160, 89, 0.45); }
}
@keyframes regGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes regShine {
  0%, 40% { left: -120%; }
  70% { left: 130%; }
  100% { left: 130%; }
}
@keyframes regIconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-reg-animate,
  .btn-reg-animate::after,
  .btn-reg-animate i {
    animation: none;
  }
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(197,160,89,.18), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(14,107,102,.16), transparent 40%),
    linear-gradient(145deg, #071a31, #0b2545);
}
.login-box {
  background: #fff; border-radius: 22px; width: 100%; max-width: 420px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28); padding: 2rem;
  border-top: 4px solid var(--nc-accent);
}
.login-box .brand { text-align: center; margin-bottom: 1.5rem; }
.login-box .brand img.login-logo {
  max-width: 180px; max-height: 120px; width: auto; height: auto;
  margin: 0 auto .75rem; object-fit: contain;
}
.login-box .brand h2 { color: var(--nc-primary); font-size: 1.35rem; margin: .5rem 0 0; }
.login-box .brand small { color: #6b7c86; }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 260px; background: var(--nc-sidebar);
  color: var(--nc-sidebar-text); flex-shrink: 0;
  position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 1040;
  transition: transform .25s;
}
.app-sidebar .side-brand {
  padding: 1rem 1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.1);
  font-weight: 700; font-size: .95rem; line-height: 1.3;
  display: flex; align-items: center; gap: .75rem;
}
.app-sidebar .side-brand img {
  width: 48px; height: 48px; object-fit: contain; flex: none;
  background: #fff; border-radius: 12px; padding: 3px;
}
.app-sidebar .side-brand .side-brand-text { min-width: 0; }
.app-sidebar .side-brand .side-brand-text div {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-sidebar .nav-link {
  color: rgba(255,255,255,.82); padding: .55rem 1rem; border-radius: 0;
  display: flex; align-items: center; gap: .6rem; font-size: .92rem;
}
.app-sidebar .nav-link:hover, .app-sidebar .nav-link.active {
  background: rgba(255,255,255,.08); color: #fff;
  box-shadow: inset 3px 0 0 var(--nc-accent);
}
.app-sidebar .nav-section {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.45); padding: 1rem 1rem .35rem;
}
.app-main { margin-left: 260px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  background: rgba(251, 250, 247, .94); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(27, 42, 74, 0.12); padding: .75rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  position: sticky; top: 0; z-index: 1020;
}
.app-content { padding: 1.25rem; flex: 1; }

.btn-primary {
  --bs-btn-bg: #0b2545;
  --bs-btn-border-color: #0b2545;
  --bs-btn-hover-bg: #071a31;
  --bs-btn-hover-border-color: #071a31;
  --bs-btn-active-bg: #071a31;
  --bs-btn-active-border-color: #071a31;
  border-radius: 999px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--nc-teal);
  box-shadow: 0 0 0 .2rem rgba(14, 107, 102, .16);
}
.app-foot {
  padding: .85rem 1.25rem 1.1rem;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--nc-accent);
  border-top: 1px solid rgba(11, 37, 69, 0.1);
}
.ws-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: start; }
.ws-tabs { display: flex; flex-direction: column; gap: .25rem; position: sticky; top: 4.5rem; }
.ws-tabs a {
  text-decoration: none; color: var(--nc-primary); padding: .55rem .75rem;
  border-left: 2px solid transparent; font-size: .92rem;
}
.ws-tabs a.active, .ws-tabs a:hover { border-left-color: var(--nc-accent); background: #fff; }
.ws-view { margin-top: .6rem; color: var(--nc-accent) !important; }
.ws-list { margin: 1.25rem 0; padding-top: 1rem; border-top: 1px solid rgba(27,42,74,.12); }
.ws-row {
  display: grid; gap: .6rem; padding: .85rem; margin-bottom: .7rem;
  background: #f7f4ee; border: 1px solid rgba(27,42,74,.08);
}
.ws-row label span { display: block; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: #5c6573; margin-bottom: .2rem; }
.stat-card {
  background: #fff; border-radius: var(--nc-radius); box-shadow: var(--nc-card-shadow);
  padding: 1.15rem 1.25rem; border-left: 3px solid var(--nc-primary); height: 100%;
}
.stat-card.accent { border-left-color: var(--nc-accent); }
.stat-card.success { border-left-color: var(--nc-success); }
.stat-card.warning { border-left-color: #e9c46a; }
.stat-card .label { color: #6b7c86; font-size: .85rem; margin-bottom: .25rem; }
.stat-card .value { font-size: 1.75rem; font-weight: 700; color: var(--nc-primary); line-height: 1.2; }
.stat-card .sub { font-size: .78rem; color: #8a9ba5; margin-top: .25rem; }

.panel {
  background: #fff; border-radius: var(--nc-radius); box-shadow: var(--nc-card-shadow);
  margin-bottom: 1.25rem;
}
.panel-header {
  padding: .9rem 1.15rem; border-bottom: 1px solid #e8eef2;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
}
.panel-header h5 { margin: 0; font-size: 1.05rem; color: var(--nc-primary); }
.panel-body { padding: 1.15rem; }

.avatar-sm {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  background: #dce8ee; display: inline-block;
}
.avatar-lg {
  width: 120px; height: 140px; object-fit: cover; border-radius: 8px;
  border: 1px solid #dce8ee; background: #f0f4f7;
}

.wizard-steps {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem;
}
.wizard-steps .step {
  flex: 1; min-width: 110px; text-align: center; padding: .65rem .5rem;
  border-radius: 8px; background: #eef4f7; color: #5a6d78; font-size: .8rem; font-weight: 600;
}
.wizard-steps .step.active { background: var(--nc-primary); color: #fff; }
.wizard-steps .step.done { background: var(--nc-success); color: #fff; }
.wizard-pane { display: none; }
.wizard-pane.active { display: block; }

.required::after { content: " *"; color: #c1121f; }
.table-photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

.cred-box {
  background: #f4f8f8; border: 2px dashed var(--nc-accent); border-radius: 12px;
  padding: 1.5rem; text-align: center; margin: 1rem 0;
}
.cred-box .cred-value {
  font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem;
  font-weight: 700; color: var(--nc-primary); letter-spacing: .04em;
}
.warning-banner {
  background: #fff3cd; border: 1px solid #ffecb5; color: #664d03;
  border-radius: 8px; padding: .85rem 1rem; margin: 1rem 0;
}

@media (max-width: 800px) {
  .ws-layout { grid-template-columns: 1fr; }
  .ws-tabs { position: static; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.show { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035;
  }
  .sidebar-backdrop.show { display: block; }
}

@media print {
  .app-sidebar, .app-topbar, .no-print, .btn, .pagination, nav { display: none !important; }
  .app-main { margin-left: 0 !important; }
  .app-content { padding: 0 !important; }
  body { background: #fff !important; }
  .panel { box-shadow: none; border: 1px solid #ccc; }
}

/* Print credential slip */
.print-slip {
  max-width: 800px; margin: 0 auto; padding: 1.5rem;
  border: 2px solid var(--nc-primary); border-radius: 8px; background: #fff;
}
.print-slip .header { text-align: center; border-bottom: 2px solid var(--nc-primary); padding-bottom: 1rem; margin-bottom: 1rem; }
.print-slip .header h2 { color: var(--nc-primary); margin: 0; }
.print-slip .meta-table td { padding: .4rem .5rem; }
