/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #1a3a5c;
  --navy-dark: #0f2540;
  --navy-mid:  #2a4f78;
  --accent:    #c9973a;
  --accent-lt: #f5e6c8;
  --green:     #2e7d52;
  --green-lt:  #d4edda;
  --red:       #b92c2c;
  --red-lt:    #fde8e8;
  --amber:     #b97c2c;
  --amber-lt:  #fff3cd;
  --gray-50:   #f8f9fb;
  --gray-100:  #f0f2f5;
  --gray-200:  #e2e6ec;
  --gray-400:  #9aa5b4;
  --gray-600:  #5a6778;
  --gray-800:  #2d3748;
  --white:     #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.13), 0 4px 12px rgba(0,0,0,.06);
  --radius:    12px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

.hidden { display: none !important; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ===== HEADER ===== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { display: flex; }
.brand-name {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 700; color: var(--navy);
  line-height: 1.1;
}
.brand-sub { display: block; font-size: .72rem; color: var(--gray-400); font-weight: 400; letter-spacing: .04em; text-transform: uppercase; }
.live-date { font-size: .82rem; color: var(--gray-600); }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy-mid) 60%, #2e5f8a 100%);
  padding: 72px 24px 80px;
  position: relative; overflow: hidden;
}
.hero-bg-pattern {
  position: absolute; inset: 0; opacity: .06;
  background-image: radial-gradient(circle, white 1px, transparent 1px);
  background-size: 32px 32px;
}
.hero-content {
  max-width: 680px; margin: 0 auto; text-align: center; position: relative;
}
.hero-eyebrow {
  display: inline-block; background: rgba(201,151,58,.2); border: 1px solid rgba(201,151,58,.4);
  color: #f0c97a; font-size: .78rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; padding: 4px 14px; border-radius: 20px; margin-bottom: 18px;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; color: var(--white);
  line-height: 1.18; margin-bottom: 16px;
}
.hero-desc {
  color: rgba(255,255,255,.72); font-size: 1.02rem; font-weight: 300;
  max-width: 520px; margin: 0 auto 36px;
}

/* SEARCH CARD */
.search-card {
  background: var(--white); border-radius: var(--radius);
  padding: 28px 28px 20px; box-shadow: var(--shadow-lg);
  text-align: left;
}
.search-row { display: flex; gap: 12px; align-items: flex-end; }
.input-group { flex: 1; }
.input-group label {
  display: block; font-size: .8rem; font-weight: 600; color: var(--gray-600);
  letter-spacing: .04em; text-transform: uppercase; margin-bottom: 7px;
}
.input-group input {
  width: 100%; height: 48px; padding: 0 16px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 1rem; color: var(--gray-800);
  background: var(--gray-50); transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.input-group input:focus {
  border-color: var(--navy); background: var(--white);
  box-shadow: 0 0 0 3px rgba(26,58,92,.12);
}
.btn-search {
  height: 48px; padding: 0 24px;
  background: var(--navy); color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: .95rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: background .2s, transform .1s; white-space: nowrap;
}
.btn-search:hover { background: var(--navy-dark); }
.btn-search:active { transform: scale(.98); }
.search-hint { font-size: .79rem; color: var(--gray-400); margin-top: 12px; }

/* ERROR BANNER */
.error-banner {
  margin-top: 16px; background: var(--red-lt); border: 1px solid #f5c6c6;
  border-radius: var(--radius-sm); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  color: var(--red); font-size: .9rem; font-weight: 500;
}

/* ===== IDENTITY BAR ===== */
.identity-bar {
  background: var(--white); border-bottom: 1px solid var(--gray-200);
  padding: 20px 0; box-shadow: var(--shadow-sm);
}
.identity-inner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.student-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.student-meta h2 {
  font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 700;
  color: var(--navy); line-height: 1.2;
}
.student-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.tag {
  font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px;
  background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200);
}
.tag-id { background: var(--accent-lt); color: var(--accent); border-color: #e8c97a; }
.status-badge {
  padding: 6px 16px; border-radius: 20px;
  background: var(--green-lt); color: var(--green);
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid #a8d5b8; display: inline-block;
}

/* ===== TABS ===== */
.tabs-container { padding-top: 32px; padding-bottom: 60px; }
.tab-nav {
  display: flex; gap: 4px; border-bottom: 2px solid var(--gray-200);
  margin-bottom: 28px;
}
.tab-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 20px; border: none; background: none;
  font-family: 'DM Sans', sans-serif; font-size: .9rem; font-weight: 500;
  color: var(--gray-600); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color .2s, border-color .2s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }

/* ===== PANELS ===== */
.tab-panel { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel-header { margin-bottom: 24px; }
.panel-header h3 {
  font-family: 'Playfair Display', serif; font-size: 1.45rem;
  font-weight: 700; color: var(--navy); margin-bottom: 4px;
}
.panel-header p { color: var(--gray-600); font-size: .9rem; }

/* INFO GRID (Personal) */
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.info-card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s;
}
.info-card:hover { box-shadow: var(--shadow-md); }
.info-card .ic-label {
  font-size: .74rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gray-400); margin-bottom: 5px;
}
.info-card .ic-value {
  font-size: 1.02rem; font-weight: 500; color: var(--gray-800);
}

/* FEE SUMMARY */
.fee-summary {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.fee-stat {
  flex: 1; min-width: 160px; background: var(--white);
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--gray-200);
}
.fee-stat.paid { border-left-color: var(--green); }
.fee-stat.due  { border-left-color: var(--red); }
.fee-stat.total{ border-left-color: var(--navy); }
.fee-stat .fs-label { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-400); margin-bottom: 4px; }
.fee-stat .fs-value { font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700; color: var(--gray-800); }

/* RESULT OVERVIEW */
.result-overview {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.ro-card {
  flex: 1; min-width: 150px; background: var(--white);
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 18px 20px; text-align: center; box-shadow: var(--shadow-sm);
}
.ro-card .ro-label { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-400); margin-bottom: 6px; }
.ro-card .ro-value { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; color: var(--navy); }
.ro-card .ro-sub { font-size: .8rem; color: var(--gray-400); margin-top: 2px; }

/* TABLE */
.table-wrap { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.data-table thead { background: var(--navy); }
.data-table thead th {
  padding: 13px 16px; text-align: left;
  font-size: .78rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: rgba(255,255,255,.85);
}
.data-table tbody tr { border-bottom: 1px solid var(--gray-100); transition: background .15s; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody td { padding: 13px 16px; font-size: .93rem; color: var(--gray-800); }

/* STATUS PILLS */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.pill-paid    { background: var(--green-lt); color: var(--green); }
.pill-unpaid  { background: var(--red-lt);   color: var(--red);   }
.pill-partial { background: var(--amber-lt); color: var(--amber); }
.pill-a  { background: #e8f5e9; color: #2e7d52; }
.pill-b  { background: #e3f2fd; color: #1565c0; }
.pill-c  { background: var(--amber-lt); color: var(--amber); }
.pill-d  { background: #fff3e0; color: #e65100; }
.pill-f  { background: var(--red-lt);   color: var(--red);   }

/* PROGRESS BAR for result */
.mark-bar { display: flex; align-items: center; gap: 8px; }
.bar-bg { flex: 1; height: 6px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--navy); transition: width .6s ease; }

/* ===== LOADING ===== */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(15,37,64,.55);
  display: flex; align-items: center; justify-content: center; z-index: 999;
  backdrop-filter: blur(2px);
}
.loader-card {
  background: var(--white); border-radius: var(--radius);
  padding: 32px 40px; text-align: center; box-shadow: var(--shadow-lg);
}
.spinner {
  width: 38px; height: 38px; border: 3px solid var(--gray-200);
  border-top-color: var(--navy); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-card p { font-size: .92rem; color: var(--gray-600); }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--gray-200); background: var(--white);
  padding: 20px 0; text-align: center;
}
.site-footer p { font-size: .82rem; color: var(--gray-400); }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .search-row { flex-direction: column; }
  .btn-search { width: 100%; justify-content: center; }
  .identity-inner { gap: 12px; }
  .status-badge { margin-left: 0; }
  .tab-btn { padding: 10px 12px; font-size: .82rem; }
  .tab-btn span { display: none; }
}

/* ===== STUDENT PHOTO ===== */
.student-photo-wrap { position: relative; flex-shrink: 0; }
.student-photo {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.father-name-bar {
  font-size: .85rem; color: var(--gray-400); font-weight: 400;
  margin: 3px 0 6px; letter-spacing: .01em;
}

/* ===== INFO SECTIONS ===== */
.info-section { margin-bottom: 32px; }
.info-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--navy);
  padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 2px solid var(--gray-200);
}

/* ===== RESULT SUMMARY CARDS ===== */
.result-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 8px;
}
.rs-card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 18px 16px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px;
  transition: box-shadow .2s;
}
.rs-card:hover { box-shadow: var(--shadow-md); }
.rs-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.rs-label {
  font-size: .74rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gray-400);
}
.rs-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-weight: 700; color: var(--gray-800);
  line-height: 1;
}
.rs-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem; color: var(--gray-400); font-weight: 400;
}

@media (max-width: 600px) {
  .result-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .rs-value { font-size: 1.3rem; }
}

/* ===== IDENTITY RIGHT (status + profile updated) ===== */
.identity-right {
  margin-left: auto;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.profile-updated {
  font-size: .74rem;
  color: var(--gray-400);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  line-height: 1.4;
}
/* ===== HEADER NAV — mobile responsive ===== */
.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.hdr-link {
  font-size: .76rem; font-weight: 600; color: var(--gray-600);
  text-decoration: none; padding: 6px 11px;
  border: 1px solid var(--gray-200); border-radius: 7px;
  white-space: nowrap; transition: all .2s;
}
.hdr-link:hover { color: var(--navy); border-color: var(--navy); background: rgba(26,58,92,.04); }
.hdr-btn {
  padding: 6px 13px; background: rgba(26,58,92,.08);
  border: 1px solid #e2e6ec; border-radius: 8px;
  font-size: .76rem; font-weight: 600; color: #1a3a5c;
  text-decoration: none; display: inline-flex; align-items: center;
  gap: 6px; white-space: nowrap; transition: all .2s;
}
.hdr-btn:hover { background: rgba(26,58,92,.14); border-color: var(--navy); }

/* Hamburger — hidden on desktop */
.hdr-toggle {
  display: none;
  flex-direction: column; gap: 5px;
  width: 36px; height: 36px;
  background: var(--gray-100); border: none; border-radius: 8px;
  cursor: pointer; align-items: center; justify-content: center; padding: 8px;
  flex-shrink: 0;
}
.hdr-toggle span {
  display: block; width: 17px; height: 2px;
  background: var(--navy); border-radius: 2px; transition: all .22s;
}
.hdr-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hdr-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hdr-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile dropdown — hidden by default always */
.hdr-mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 6px 16px 10px;
}
.hdr-mobile-menu.open { display: flex; }
.hdr-mob-link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 6px; font-size: .9rem; font-weight: 600;
  color: var(--gray-700); text-decoration: none;
  border-bottom: 1px solid var(--gray-100); transition: color .15s;
}
.hdr-mob-link:last-child { border-bottom: none; }
.hdr-mob-link:hover { color: var(--navy); }
.hdr-mob-login {
  color: var(--navy); margin-top: 4px;
  background: rgba(26,58,92,.06); border-radius: 8px;
  padding: 11px 10px; border-bottom: none;
}
.hdr-mob-login:hover { background: rgba(26,58,92,.12); }

/* On mobile: hide desktop nav, show hamburger */
@media (max-width: 640px) {
  .header-inner { height: 56px; }
  .header-nav   { display: none; }
  .hdr-toggle   { display: flex; }
  .brand-name   { font-size: 1rem; }
  .brand-sub    { display: none; }
}
