/* ── Layout ─────────────────────────────────────────────────── */

:root {
  --sidebar-width: 240px;
}

body {
  background-color: #f1f3f5;
}

/* Desktop: fixed sidebar + offset main */
@media (min-width: 992px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    z-index: 1040;
  }

  .main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
  }
}

/* Mobile: full-width main (offcanvas handles sidebar) */
@media (max-width: 991.98px) {
  .main-content {
    margin-left: 0;
  }
}

/* ── Sidebar nav links ──────────────────────────────────────── */

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: 0.375rem;
  color: #adb5bd;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 500;
}

/* ── User avatar circle ─────────────────────────────────────── */

.user-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  font-size: 1rem;
}

/* ── Cards ──────────────────────────────────────────────────── */

.card {
  border-radius: 0.6rem;
}

.stat-card {
  border: none;
  border-radius: 0.6rem;
  transition: transform 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

/* ── Tables ─────────────────────────────────────────────────── */

.table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  border-top: none;
}

/* ── Stat cards ─────────────────────────────────────────────── */

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-label {
  font-size: 0.75rem;
  color: #6c757d;
  white-space: nowrap;
}

/* ── Student profile dl ─────────────────────────────────────── */

.profile-dl dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  padding-top: 0.35rem;
}

.profile-dl dd {
  padding-top: 0.35rem;
  margin-bottom: 0;
}

/* ── Receipt ─────────────────────────────────────────────────── */

.receipt-card {
  border-radius: 0.6rem;
  font-size: 0.95rem;
}

.receipt-header {
  background: #f8f9fa;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.3rem 0;
  border-bottom: 1px dashed #e9ecef;
}

.receipt-row:last-child {
  border-bottom: none;
}

.receipt-label {
  color: #6c757d;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  margin-right: 1rem;
}

.receipt-value {
  text-align: right;
}

/* ── Print styles ────────────────────────────────────────────── */

@media print {
  /* Global: clean white canvas, no chrome */
  body           { background: white !important; }
  .main-content  { margin-left: 0 !important; padding: 0 !important; }

  /* Hide navigation & interactive elements on every page */
  #sidebar,
  #sidebarOffcanvas,
  .navbar,
  .offcanvas-backdrop,
  .d-print-none,
  .btn,
  .alert        { display: none !important; }

  /* Remove card shadows and soften borders for reports */
  .card         { box-shadow: none !important; border: 1px solid #ccc !important; }

  /* Receipt card: tighter border, legible font */
  #receiptCard {
    border: 1px solid #ccc !important;
    max-width: 100% !important;
    font-size: 11pt;
    color: #000 !important;
  }

  .receipt-header { background: white !important; }

  /* Force black text on coloured helpers */
  .text-success,
  .text-danger,
  .text-info,
  .text-muted,
  .text-secondary,
  .text-primary  { color: #000 !important; }

  /* Badges: strip colour, keep text */
  .badge {
    background: none !important;
    color: #000 !important;
    border: 1px solid #999 !important;
  }

  /* Progress bars: show as thin grey lines (colour doesn't print well) */
  .progress        { border: 1px solid #ccc !important; background: #eee !important; }
  .progress-bar    { background: #555 !important; }

  /* Tables: keep borders visible */
  .table           { border-collapse: collapse !important; }
  .table td,
  .table th        { border: 1px solid #ddd !important; }
  .table-light,
  .table-dark      { background: #f5f5f5 !important; color: #000 !important; }

  /* Ensure code elements are readable */
  code { color: #000 !important; background: #f0f0f0 !important; }

  /* Default page setup — A4 portrait for reports */
  @page {
    size: A4 portrait;
    margin: 1.5cm;
  }

  /* Receipt pages override to A5 via inline <style> in receipt.html */
}

/* ── Badges ─────────────────────────────────────────────────── */

.badge-paid {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-due,
.badge-pending {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-admin {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-staff {
  background-color: #dbeafe;
  color: #1e40af;
}

/* ── Form focus ring ────────────────────────────────────────── */

.form-control:focus,
.form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.2);
}

/* ── Amount inputs: right-aligned monospace ─────────────────── */

.amount-input {
  text-align: right;
  font-family: var(--bs-font-monospace, monospace);
  font-size: 1rem;
}

/* ── Metric cards: consistent height, bold amount ───────────── */

.stat-value {
  font-size: 1.375rem;  /* 22px */
  font-weight: 700;
  line-height: 1.2;
}

.stat-card.h-100 {
  height: 100% !important;
}
