:root {
  --brand: #7a1f2b;      /* maroon, common in college letterheads */
  --brand-dark: #591620;
  --brand-light: #fdf4f5;
}

body {
  background: #f2f4f7;
  font-family: 'Segoe UI', Arial, sans-serif;
}

::placeholder {
  color: #bbc0c8 !important;
  opacity: 1;
}

.navbar-brand-college {
  font-weight: 700;
  letter-spacing: .5px;
}

.brand-bar {
  background: var(--brand);
  color: #fff;
}

.brand-bar a {
  color: #fff;
}

.card-header-brand {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-brand:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.form-section-title {
  background: var(--brand-light);
  border-left: 4px solid var(--brand);
  padding: 8px 12px;
  font-weight: 600;
  margin: 22px 0 14px 0;
}

.photo-preview, .payment-preview {
  width: 100%;
  max-width: 220px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px;
  background: #fff;
}

.thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.status-badge-Paid { background:#198754; }
.status-badge-Partial { background:#fd7e14; }
.status-badge-Pending { background:#dc3545; }

/* Used by admin/view.php and teacher/view.php on-screen detail tables (not the compact print sheet) */
.print-table td, .print-table th {
  padding: 6px 10px;
  vertical-align: top;
}
.print-table th {
  width: 220px;
  color: #444;
  font-weight: 600;
  background: #fafafa;
}

/* ================= PRINT VIEW (print.php compact single-page sheet) ================= */
.print-sheet {
  background: #fff;
  padding: 14px 22px;
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid #ddd;
  font-size: 12px;
  color: #111;
}
.print-sheet h3, .print-sheet h5 { color: var(--brand); }

.print-header-logo {
  width: 64px;
  flex: 0 0 64px;
}
.print-header-logo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.print-header-text h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0 !important;
}
.print-header-text h4 {
  letter-spacing: 1px;
  font-size: 1rem;
}
.print-header-text p { font-size: 11px; margin-bottom: 0 !important; }
.print-header { margin-bottom: 8px !important; }
.print-header hr, .print-sheet hr { margin: 6px 0; }

/* Dense two-column field grid — replaces the old tall table for print */
.print-fields {
  display: grid;
  grid-template-columns: 108px 1fr 108px 1fr;
  gap: 2px 8px;
  font-size: 11px;
  margin-bottom: 6px;
}
.print-fields .pf-label {
  font-weight: 600;
  color: #444;
  padding: 2px 0;
  border-bottom: 1px dotted #ddd;
}
.print-fields .pf-value {
  padding: 2px 0;
  border-bottom: 1px dotted #ddd;
  word-break: break-word;
}
.print-fields .pf-full {
  grid-column: 1 / -1;
}

.print-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #888;
  margin: 6px 0 2px 0;
  border-top: 1px solid #ccc;
  padding-top: 4px;
}

/* Compact photo + portrait payment screenshot, side-aligned */
.print-photo-box {
  width: 90px;
  height: 110px;
  border: 1px solid #999;
  padding: 2px;
  background: #fff;
}
.print-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.print-screenshot-box {
  width: 130px;
  max-height: 230px;
  border: 1px solid #999;
  padding: 2px;
  background: #fff;
  margin: 0 auto;
}
.print-screenshot-box img {
  width: 100%;
  height: auto;
  max-height: 226px;
  object-fit: contain;
  display: block;
}
.print-image-caption {
  font-size: 9px;
  color: #777;
  text-align: center;
  margin: 2px 0 8px 0;
}

.print-signatures {
  margin-top: 22px;
  font-size: 10px;
}
.print-signatures .sig-line {
  border-top: 1px solid #333;
  padding-top: 3px;
  text-align: center;
}

.print-images img {
  max-width: 260px;
  max-height: 260px;
  border: 1px solid #ccc;
  padding: 4px;
  background: #fff;
  object-fit: contain;
}

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .no-print { display: none !important; }
  .print-sheet { border: none; padding: 0; font-size: 11px; }
  a { text-decoration: none; color: #000; }
  .sidebar, .topbar, .sidebar-overlay { display: none !important; }
  .main-wrapper { display: block !important; }
  .page-content { padding: 0 !important; }
}

/* ===========================
   Sidebar Layout
   =========================== */
.sidebar-wrapper {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--brand);
  transition: width 0.25s ease, min-width 0.25s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar.collapsed {
  width: 0;
  min-width: 0;
}
.sidebar-brand {
  padding: 18px 20px 15px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  white-space: nowrap;
}
.sidebar-brand-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  display: block;
}
.sidebar-brand-sub {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.65);
  display: block;
}
.sidebar-nav {
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
}
.sidebar-link.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}
.sidebar-divider {
  border-color: rgba(255,255,255,0.15);
  margin: 5px 16px;
}
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f2f4f7;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid #e0e3e8;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--brand);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}
.sidebar-toggle:hover { background: var(--brand-light); }
.topbar-title {
  font-weight: 600;
  color: var(--brand);
  font-size: 0.95rem;
}
.topbar-user {
  font-size: 0.82rem;
  color: #666;
}
.page-content { padding: 24px; }

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 240px !important;
    min-width: 240px !important;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1040;
  }
  .sidebar-overlay.show { display: block; }
  .main-wrapper { width: 100%; }
  .page-content { padding: 14px; }
}

/* ===========================
   Form AJAX Validation
   =========================== */
.field-error {
  border-color: #dc3545 !important;
}
.field-error-msg {
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: 4px;
}
.category-error-wrap {
  border: 1px solid #dc3545;
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff5f5;
}
#formAlertBox {
  display: none;
}

/* ===========================
   Status Timeline
   =========================== */
.status-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.status-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  position: relative;
}
.status-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 46px;
  bottom: -14px;
  width: 2px;
  background: #dee2e6;
}
.step-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  background: #dee2e6;
  color: #6c757d;
}
.status-step.done .step-icon       { background: #198754; color: #fff; }
.status-step.done::after           { background: #198754; }
.status-step.rejected .step-icon   { background: #dc3545; color: #fff; }
.status-step.query .step-icon      { background: #0dcaf0; color: #000; }
.status-step.pending .step-icon    { background: #ffc107; color: #000; }
.status-step.waiting .step-icon    { background: #e9ecef; color: #adb5bd; }

.step-title {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.step-sub {
  font-size: 0.8rem;
  margin-top: 2px;
}
.step-remark {
  font-size: 0.85rem;
  margin-top: 6px;
  background: #f8f9fa;
  border-left: 3px solid #dee2e6;
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  color: #495057;
}
