/* Navy & Gold Result Portal */
:root {
  --navy-900: #0a1733;
  --navy-800: #0f2350;
  --navy-700: #16306e;
  --navy-600: #1e3a8a;
  --gold-500: #d4af37;
  --gold-400: #e6c659;
  --gold-300: #f1d97a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; color: #0a1733; }
body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0a1733 0%, #0f2350 45%, #16306e 100%);
  background-attachment: fixed;
  background-size: 200% 200%;
  animation: gradientShift 18s ease infinite;
}
@keyframes gradientShift {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Glass card */
.glass {
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(31,38,135,0.25);
}

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; padding: 20px; margin: 16px; position: sticky; top: 16px;
  height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 8px;
  animation: slideInLeft .5s ease;
}
@keyframes slideInLeft { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sidebar .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sidebar .brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: #fff; }
.sidebar .brand h1 { font-size: 1.05rem; line-height: 1.2; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.2); word-break: break-word; }
.sidebar .role-tag { font-size: 11px; color: rgba(255,255,255,.85); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px;
  color: #fff; font-weight: 500; transition: all .25s ease;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,0.28); transform: translateX(4px); }
.nav .icon { width: 18px; text-align: center; }
.nav .spacer { flex: 1; }

.main { flex: 1; padding: 24px; min-width: 0; animation: fadeInUp .5s ease; }
@keyframes fadeInUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding: 14px 18px; }
.topbar .title { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 1.1rem; font-weight: 600; }
.topbar .title img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; background: #fff; }
.topbar .user { color: #fff; font-size: .9rem; opacity: .95; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 12px;
  background: rgba(255,255,255,0.25); border: 1px solid rgba(255,255,255,.4); color: #fff;
  cursor: pointer; font-weight: 600; transition: all .25s; text-decoration: none; font-size: .9rem;
}
.btn:hover { background: rgba(255,255,255,0.4); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.btn-primary { background: linear-gradient(135deg,var(--gold-500),var(--gold-400)); border-color: transparent; color: var(--navy-900); }
.btn-primary:hover { color: var(--navy-900); }
.btn-danger { background: linear-gradient(135deg,#b91c1c,#ef4444); border-color: transparent; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }

/* Forms */
.form { padding: 24px; max-width: 720px; }
.form h2 { color: #fff; margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; color: #fff; margin-bottom: 6px; font-size: .85rem; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,0.85); font-size: .95rem; outline: none; transition: all .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.4); }

/* Table */
.card { padding: 20px; margin-bottom: 20px; }
.card h2 { color: #fff; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,0.85); border-radius: 12px; overflow: hidden; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid rgba(0,0,0,.06); font-size: .9rem; }
th { background: rgba(212,175,55,.18); font-weight: 600; }
tr:hover td { background: rgba(212,175,55,.08); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-unpaid { background: #fef3c7; color: #92400e; }
.badge-expired { background: #fee2e2; color: #991b1b; }

/* Flash */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; color: #fff; font-weight: 500; animation: fadeInUp .3s; }
.flash-info { background: rgba(59,130,246,.85); }
.flash-success { background: rgba(16,185,129,.85); }
.flash-error { background: rgba(239,68,68,.85); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 420px; padding: 36px; animation: scaleIn .4s ease; }
@keyframes scaleIn { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.login-card h1 { color: #fff; text-align: center; margin-bottom: 6px; font-size: 1.5rem; }
.login-card p { color: rgba(255,255,255,.85); text-align: center; margin-bottom: 24px; font-size: .9rem; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; background: rgba(255,255,255,.15); padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; padding: 9px; border: none; border-radius: 9px; background: transparent; color: #fff; cursor: pointer; font-weight: 600; transition: all .2s; }
.tabs button.active { background: rgba(255,255,255,.85); color: #1a1a2e; }

/* Mobile menu */
.menu-toggle { display: none; background: rgba(255,255,255,.25); border: 1px solid rgba(255,255,255,.4); color: #fff; padding: 8px 12px; border-radius: 10px; cursor: pointer; font-size: 1.2rem; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 20px; color: #fff; }
.stat .label { font-size: .8rem; opacity: .9; text-transform: uppercase; letter-spacing: 1px; }
.stat .val { font-size: 2rem; font-weight: 700; margin-top: 4px; }

/* Student dashboard doodles */
.doodles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; opacity: .25; }
.doodle { position: absolute; font-size: 3rem; animation: float 8s ease-in-out infinite; }
.doodle:nth-child(1) { top: 8%; left: 5%; animation-delay: 0s; }
.doodle:nth-child(2) { top: 20%; right: 8%; animation-delay: 1s; }
.doodle:nth-child(3) { bottom: 15%; left: 12%; animation-delay: 2s; }
.doodle:nth-child(4) { bottom: 25%; right: 10%; animation-delay: 3s; }
.doodle:nth-child(5) { top: 50%; left: 50%; animation-delay: 4s; }
.doodle:nth-child(6) { top: 70%; left: 30%; animation-delay: 2.5s; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-20px) rotate(5deg); } }
.dash-content { position: relative; z-index: 1; }

/* Print */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print { display: none !important; }
  .main { padding: 0; }
  .glass { background: #fff; border: none; box-shadow: none; }
}

/* Mobile */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { position: fixed; left: -100%; top: 0; bottom: 0; margin: 0; height: 100vh; z-index: 100; width: 80%; max-width: 300px; border-radius: 0; transition: left .3s; }
  .sidebar.open { left: 0; }
  .main { padding: 14px; }
  .topbar .title { font-size: .95rem; }
  .topbar .title img { width: 30px; height: 30px; }
  .menu-toggle { display: inline-flex; }
  .stat .val { font-size: 1.5rem; }
  .form { padding: 16px; }
  table { font-size: .8rem; }
  th, td { padding: 8px; }
  .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; display: none; }
  .backdrop.open { display: block; }
}

/* Fixed header (topbar) + footer */
.main { display: flex; flex-direction: column; min-height: 100vh; padding-top: 54px; padding-bottom: 64px; }
.topbar {
  position: fixed;
  top: 0;
  left: 292px;
  right: 16px;
  z-index: 50;
  margin: 6px 0 0 0;
  margin-bottom: 0;
  padding: 8px 16px;
}
.appfooter {
  position: fixed;
  bottom: 0;
  left: 292px;
  right: 16px;
  margin: 0 0 16px 0;
  padding: 12px 18px;
  z-index: 40;
}
.appfooter-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: #fff; font-size: .85rem; flex-wrap: wrap;
}
.appfooter-inner, .appfooter-inner div, .appfooter-inner span { color: #fff; }
.appfooter-links { display: flex; align-items: center; gap: 8px; opacity: .9; color: #fff; }
.appfooter-links a { color: #fff; }
.appfooter-links a:hover { color: #fff; opacity: .8; }

@media (max-width: 900px) {
  .topbar { left: 8px; right: 8px; margin-top: 6px; padding: 8px 12px; }
  .appfooter { left: 8px; right: 8px; margin-bottom: 8px; padding: 10px 14px; }
  .appfooter-inner { font-size: .75rem; justify-content: center; text-align: center; }
  .main { padding-top: 58px; padding-bottom: 56px; }
}

@media print {
  .appfooter { display: none !important; }
}


/* Sidebar close button */
.sidebar-close { display:none; position:absolute; top:10px; right:10px; background:rgba(255,255,255,.25); border:1px solid rgba(255,255,255,.4); color:#fff; width:36px; height:36px; border-radius:10px; cursor:pointer; font-size:1.1rem; align-items:center; justify-content:center; }
/* sidebar positioning handled by base (sticky) and mobile (fixed) rules above */
@media (max-width: 900px) {
  .sidebar-close { display:inline-flex; }
}
