/* Goat Farm — custom styles */

/* ---- Sidebar ---- */
.sidebar {
  min-height: calc(100vh - 56px);
}
.sidebar .nav-link {
  color: #333;
  padding: .5rem 1rem;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: #f1f3f5;
  color: #000;
}
.sidebar-heading {
  font-size: .75rem;
  letter-spacing: .05em;
}

/* ---- Mobile responsive tweaks ---- */
@media (max-width: 767.98px) {
  /* Let the main content use full width when sidebar is hidden */
  main {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Smaller summary cards on mobile */
  .card-body.py-2 .h3,
  .card-body.py-2 .h4 {
    font-size: 1.15rem;
  }

  /* Tighter table cells on small screens */
  .table-sm td, .table-sm th {
    padding: .3rem .4rem;
    font-size: .82rem;
  }

  /* The filter cards can get cramped; stack vertically */
  .card-body .row.g-2 > [class*="col-md-"] {
    margin-bottom: .25rem;
  }

  /* Statement table: allow horizontal scroll and hint it */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  /* Dashboard quick actions stack nicely already via d-grid */
}

/* ---- Print-friendly styles ---- */
@media print {
  /* Hide navigation, sidebar, filters, buttons, footer */
  .navbar,
  #sidebarMenu,
  .d-print-none,
  footer,
  .sidebar-heading,
  .btn,
  .btn-group {
    display: none !important;
  }

  /* Main content takes full width, no margin */
  main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Remove card shadows and borders for clean print */
  .card {
    border: none !important;
    box-shadow: none !important;
  }
  .card-body {
    padding: .5rem 0 !important;
  }

  /* Tables: full width, tighter, visible borders */
  .table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: .8rem !important;
  }
  .table th,
  .table td {
    border: 1px solid #ccc !important;
    padding: .25rem .4rem !important;
  }
  .table-light th,
  .table-light td,
  thead.table-light {
    background: #f8f8f8 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Summary cards: inline row for compact print */
  .row.g-2.mb-3 {
    display: flex !important;
    flex-wrap: nowrap !important;
  }
  .row.g-2.mb-3 > [class*="col-"] {
    flex: 1 !important;
    max-width: none !important;
  }

  /* Keep colours for badges */
  .badge {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border: 1px solid #999;
  }

  /* Hide the "coming soon" sidebar placeholder text */
  .text-muted.small.px-3 {
    display: none !important;
  }

  /* Page title for context */
  h1.h3 {
    font-size: 1.2rem !important;
    margin-bottom: .5rem !important;
  }

  /* Avoid page breaks inside table rows */
  tr {
    page-break-inside: avoid;
  }
}
