/* ============================================================
   SCHOOL BUDDY 3.0 — THEME
   Premium design system for the Fee Portal
   ============================================================ */

:root {
  --app-primary:       #1769e0;
  --app-primary-deep:  #0b2559;
  --app-primary-light: rgba(23,105,224,.09);
  --app-accent:        #0f766e;
  --app-success:       #047857;
  --app-success-light: rgba(4,120,87,.09);
  --app-danger:        #dc2626;
  --app-bg:            #f6f8fc;
  --app-text:          #182230;
  --app-muted:         #667085;
  --app-card:          #ffffff;
  --app-border:        rgba(15,23,42,0.08);
  --app-shadow:        0 18px 48px rgba(15,23,42,.10);
  --app-shadow-soft:   0 8px 28px rgba(15,23,42,.07);
  --app-radius:        1.1rem;
  --app-radius-sm:     0.7rem;
}

/* ── RESET ─────────────────────────────────────────────── */
* { box-sizing: border-box; }

/* ── BODY / BACKGROUND ─────────────────────────────────── */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--app-text);
  background: linear-gradient(180deg, #eef4fb 0%, #f7f9fc 42%, #ffffff 100%);
  min-height: 100vh;
}

/* ── NAVBAR ─────────────────────────────────────────────── */
.app-navbar {
  backdrop-filter: saturate(180%) blur(16px);
  background: linear-gradient(135deg, rgba(11,37,89,.98), rgba(23,105,224,.96));
  border-bottom: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 32px rgba(2,6,23,.18);
}

.navbar-brand,
.nav-link,
.navbar-toggler { color: #fff !important; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  padding: .62rem .45rem !important;
  border-radius: var(--app-radius-sm);
  font-weight: 600;
  font-size: .88rem;
  transition: background .18s ease, color .18s ease, transform .18s ease;
  position: relative;
}

.nav-label {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.18;
}

.nav-link:hover,
.nav-link:focus {
  background: rgba(255,255,255,.14);
  transform: translateY(-1px);
}

/* Active page indicator */
.nav-link.active,
.nav-link[aria-current="page"] {
  background: rgba(255,255,255,.20);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.24), 0 8px 22px rgba(2,6,23,.16);
}

@media (min-width: 992px) {
  .app-nav-menu {
    flex-wrap: nowrap;
    justify-content: flex-end;
    column-gap: .35rem;
  }
}

.app-navbar .dropdown-menu {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: .85rem;
  box-shadow: 0 18px 42px rgba(2,6,23,.16);
  padding: .45rem;
}

.app-navbar .dropdown-item {
  display: flex;
  align-items: center;
  border-radius: .65rem;
  font-weight: 700;
  color: #1d2939;
  padding: .62rem .8rem;
}

.app-navbar .dropdown-item:hover,
.app-navbar .dropdown-item:focus {
  background: rgba(23,105,224,.09);
  color: var(--app-primary-deep);
}

.app-navbar .dropdown-item.active {
  background: var(--app-primary);
  color: #fff;
}

/* Mobile collapsed nav spacing */
@media (max-width: 991px) {
  .navbar-collapse .nav-link { margin-bottom: .25rem; }
}

.brand-badge {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .8rem;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.12));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 8px 18px rgba(0,0,0,.12);
  flex-shrink: 0;
}

/* ── CARDS ──────────────────────────────────────────────── */
.glass-card,
.app-card {
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(15,23,42,.07);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.glass-card { backdrop-filter: blur(12px); }

.glass-card.p-4 {
  padding: 1.35rem !important;
}

.glass-card.text-center .section-title {
  margin-bottom: .25rem;
}

/* Clickable card hover (add class="glass-card clickable") */
.glass-card.clickable,
.app-card.clickable {
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.glass-card.clickable:hover,
.app-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(15,23,42,.14);
}

/* ── HERO / PAGE HEADER ─────────────────────────────────── */
.hero-card { padding: 2rem; }

.home-hero {
  padding: 2.25rem;
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(241,248,255,.94));
  border: 1px solid rgba(11,94,215,.12);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}

.home-title {
  max-width: 680px;
  color: var(--app-primary-deep);
  font-weight: 800;
  font-size: clamp(2.25rem, 4vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.home-copy {
  max-width: 660px;
  color: var(--app-muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

.home-status-panel {
  height: 100%;
  padding: 1.35rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(11,94,215,.12);
  box-shadow: 0 10px 30px rgba(2,6,23,.08);
}

.home-status-panel .icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  background: var(--app-primary-light);
  color: var(--app-primary);
  font-size: 1.3rem;
  flex: 0 0 3rem;
}

.home-checklist {
  display: grid;
  gap: .65rem;
  color: #334155;
  font-weight: 600;
}

.home-checklist div {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 1.5rem;
}

.home-checklist i {
  color: var(--app-success);
  flex: 0 0 auto;
}

.home-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.info-tile {
  min-height: 100%;
  padding: 1.15rem;
  border-radius: 1rem;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 10px 28px rgba(15,23,42,.07);
  color: inherit;
  text-decoration: none;
}

.info-tile .icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .9rem;
  display: grid;
  place-items: center;
  margin-bottom: .8rem;
  background: rgba(20,184,166,.10);
  color: #0f766e;
  font-size: 1.2rem;
}

.info-tile h5 {
  margin-bottom: .4rem;
  color: #0f172a;
  font-weight: 800;
}

.info-tile p {
  margin-bottom: 0;
  color: var(--app-muted);
  line-height: 1.55;
}

.info-link {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.info-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(15,23,42,.10);
  border-color: rgba(11,94,215,.24);
  color: inherit;
}

.info-link span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .85rem;
  color: var(--app-primary);
  font-weight: 800;
}

.closed-panel {
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  border: 1px solid rgba(245,158,11,.25);
  background: rgba(255,251,235,.9);
  color: #78350f;
}

@media (max-width: 991px) {
  .home-info-grid { grid-template-columns: 1fr; }
  .home-hero { padding: 1.5rem; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(23,105,224,.09);
  color: var(--app-primary-deep);
  border: 1px solid rgba(23,105,224,.16);
  border-radius: 999px;
  padding: .45rem .9rem;
  font-weight: 700;
  font-size: .875rem;
}

.school-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border-radius: 1rem;
  background: #fff;
  padding: .4rem;
  box-shadow: var(--app-shadow-soft);
}

.section-title {
  font-weight: 800;
  color: var(--app-primary-deep);
  letter-spacing: 0;
}

.subtle { color: var(--app-muted); }

/* ── QUICK ACTION BUTTONS (index page) ─────────────────── */
.quick-action {
  border: 1px solid rgba(11,94,215,.12);
  border-radius: 1rem;
  padding: 1.1rem;
  height: 100%;
  background: linear-gradient(160deg, #fff 60%, #f3f8ff);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  box-shadow: 0 8px 28px rgba(2,6,23,.06);
  text-decoration: none;
  color: inherit;
  display: block;
}

.quick-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(2,6,23,.11);
  border-color: rgba(11,94,215,.30);
  color: inherit;
}

.quick-action .icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  margin-bottom: .75rem;
  background: var(--app-primary-light);
  color: var(--app-primary);
  font-size: 1.3rem;
}

/* ── BUTTONS ────────────────────────────────────────────── */
.app-btn-primary {
  background: linear-gradient(135deg, #0f5bd7, #2f80ed);
  border: 0;
  border-radius: .78rem;
  color: #fff !important;
  font-weight: 700;
  padding: .75rem 1.4rem;
  box-shadow: 0 10px 24px rgba(23,105,224,.25);
  transition: filter .18s ease, box-shadow .18s ease, transform .15s ease;
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
}

.app-btn-primary:hover {
  filter: brightness(1.07);
  box-shadow: 0 12px 28px rgba(11,94,215,.36);
  transform: translateY(-1px);
}

.app-btn-primary:active { transform: translateY(0); filter: brightness(.97); }

.app-btn-success {
  background: linear-gradient(135deg, var(--app-success), #0d9488);
  border: 0;
  border-radius: .78rem;
  color: #fff !important;
  font-weight: 700;
  padding: .75rem 1.4rem;
  box-shadow: 0 8px 20px rgba(5,150,105,.26);
  transition: filter .18s ease, box-shadow .18s ease, transform .15s ease;
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
}

.app-btn-success:hover {
  filter: brightness(1.07);
  box-shadow: 0 12px 28px rgba(5,150,105,.34);
  transform: translateY(-1px);
}

.app-btn-success:active { transform: translateY(0); filter: brightness(.97); }

/* btn-lg / btn-sm size overrides */
.app-btn-primary.btn-lg,
.app-btn-success.btn-lg  { padding: .9rem 1.6rem; font-size: 1.05rem; }

.app-btn-primary.btn-sm,
.app-btn-success.btn-sm  { padding: .4rem .85rem; font-size: .82rem; border-radius: .65rem; }

/* ── FORM CONTROLS ──────────────────────────────────────── */
.form-control,
.form-select {
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--app-radius-sm);
  background: rgba(255,255,255,.98);
  color: var(--app-text);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 4px rgba(23,105,224,.12);
  outline: none;
}

.form-label {
  font-weight: 700;
  color: #344054;
  margin-bottom: .45rem;
}

/* ── TABLES ─────────────────────────────────────────────── */
.table-modern {
  --bs-table-bg: transparent;
  border-radius: 1rem;
  overflow: hidden;
}

.table-modern thead th {
  background: #0f172a;
  color: #fff;
  border-color: #1e293b;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .01em;
}

.table-modern tbody tr { background: rgba(255,255,255,.88); }
.table-modern tbody tr:hover { background: #eef5ff; transition: background .15s; }

/* Regular bordered table used inside glass-card */
.glass-card .table-bordered th,
.glass-card .table-bordered td {
  border-color: rgba(15,23,42,.08);
  vertical-align: middle;
}

.glass-card .table-bordered thead th {
  background: #f0f5fb;
  color: #1d2939;
  font-weight: 700;
  font-size: .88rem;
}

.table {
  color: #344054;
}

.table tbody tr:hover {
  background: #f8fbff;
}

/* ── DETAIL GRID (used in fee/tc detail boxes) ──────────── */
.detail-grid {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  overflow: hidden;
}

.detail-grid .cell {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--app-border);
}

.detail-grid .cell:last-child { border-bottom: 0; }

.detail-grid .cell-label {
  font-size: .78rem;
  color: var(--app-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .2rem;
}

.detail-grid .cell-value { font-weight: 600; color: var(--app-text); }

.glass-card .row.g-0 {
  background: #fff;
}

.glass-card .row.g-0 .subtle.small {
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .72rem;
  font-weight: 800;
  color: #667085;
}

.glass-card .row.g-0 .fw-semibold {
  color: #1d2939;
}

/* ── STATUS BADGES ──────────────────────────────────────── */
.badge-success {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--app-success-light);
  color: var(--app-success);
  border: 1px solid rgba(5,150,105,.22);
  border-radius: 999px;
  padding: .4rem 1rem;
  font-weight: 700;
  font-size: .88rem;
}

.badge-danger {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(220,38,38,.07);
  color: var(--app-danger);
  border: 1px solid rgba(220,38,38,.18);
  border-radius: 999px;
  padding: .4rem 1rem;
  font-weight: 700;
  font-size: .88rem;
}

/* ── STAT CHIP ───────────────────────────────────────────── */
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border-radius: 999px;
  padding: .45rem .85rem;
  background: rgba(20,184,166,.10);
  color: #0f766e;
  font-weight: 700;
  font-size: .875rem;
}

/* ── RECEIPT ─────────────────────────────────────────────── */
.receipt-shell { max-width: 900px; }
.receipt-title { font-weight: 800; letter-spacing: -.02em; }
.receipt-meta  { color: var(--app-muted); font-size: .95rem; }

.receipt-summary .list-group-item {
  background: transparent;
  border-color: rgba(148,163,184,.22);
}

.qr-box {
  background: linear-gradient(180deg, #fff, #f8fafc);
  border: 1px dashed rgba(15,23,42,.15);
  border-radius: 1rem;
  padding: 1rem;
}

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
  background: linear-gradient(180deg, #0b1220, #111827);
  color: white;
  box-shadow: 0 -16px 35px rgba(2,6,23,.12);
}

.payment-strip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
}

.payment-title {
  color: rgba(255,255,255,.58);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.payment-strip span {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .44rem .72rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.07));
  border: 1px solid rgba(255,255,255,.16);
  font-size: .76rem;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 18px rgba(0,0,0,.10);
}

.payment-strip i {
  color: #7dd3fc;
  font-size: .9rem;
}

/* ── ALERTS / INFO BOXES ─────────────────────────────────── */
.info-box {
  border-radius: var(--app-radius-sm);
  padding: 1rem 1.1rem;
  font-size: .9rem;
}

.info-box-success {
  background: var(--app-success-light);
  border: 1px solid rgba(5,150,105,.20);
  color: #064e3b;
}

.info-box-danger {
  background: rgba(220,38,38,.06);
  border: 1px solid rgba(220,38,38,.15);
  color: #7f1d1d;
}

.info-box-warning {
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.20);
  color: #78350f;
}

/* ── PRINT ───────────────────────────────────────────────── */
.print-only { display: none; }

@media print {
  body { background: #fff !important; }
  .app-navbar, .site-footer, .no-print { display: none !important; }
  .print-only { display: block; }
  .glass-card, .app-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    backdrop-filter: none !important;
  }
}

/* ── UTILITY ─────────────────────────────────────────────── */
.page-shell    { padding: 2rem 0 3rem; }
.response-page { min-height: calc(100vh - 120px); }

.container.mt-4 {
  margin-top: 1.75rem !important;
}

@media (max-width: 575px) {
  .container.mt-4,
  .page-shell {
    padding-left: .85rem;
    padding-right: .85rem;
  }

  .glass-card.p-4 {
    padding: 1rem !important;
  }

  .nav-link {
    width: 100%;
  }

  .btn-lg,
  .form-control-lg,
  .form-select-lg {
    min-height: 48px;
  }

  .table-responsive {
    border-radius: 8px;
  }
}

/* Make hamburger icon completely white */
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Optional: white border for toggler */
.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.8) !important;
}
