body {
  font-family: Arial, sans-serif;
  margin: 0;
}

h2 {
  text-align: center;
}

/* === Dashboard Layout === */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  flex-wrap: nowrap;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: #2f3e46;
  color: white;
  padding: 20px;
  flex-shrink: 0;
  transition: transform 0.3s ease-in-out;
}

.sidebar h2 {
  text-align: center;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin: 10px 0;
}

.sidebar a {
  color: white;
  text-decoration: none;
  display: block;
  padding: 8px;
  border-radius: 5px;
}

.sidebar a:hover {
  background: #354f52;
}

/* Hamburger button */
.menu-toggle {
  display: none;
  background: #f9f9f9;
  color: #2f3e46;
  border: none;
  padding: 10px 15px;
  font-size: 30px;
  cursor: pointer;
  border-radius: 4px;
}

.menu-toggle button:hover {
  background: #f9f9f9;
}

/* Sidebar collapsible menu */
.submenu {
  display: none;
  list-style: none;
  margin-left: 15px;
  padding-left: 10px;
  border-left: 2px solid #52796f;
}

.submenu li {
  margin: 6px 0;
}

.has-children > a {
  cursor: pointer;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.has-children > a::after {
  content: "►";
  font-size: 12px;
}

.has-children.open > a::after {
  content: "▼";
}

/* Main content */
.main-content {
  flex: 1;
  padding: 20px;
  background: #f9f9f9;
}

.content-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

label {
  display: block;
  justify-self: center;
}

/* Inputs, selects, buttons */
input, select, textarea, button {
  display: block;
  margin: 20px auto;
  padding: 10px;
  /* width: 80%; */
  max-width: 80%;
  border: 1px solid #000;
  border-radius: 6px;
}

button {
  background: #52796f;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 6px;
}

button:hover {
  background: #354f52;
}

.receipt {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid black;
}

#receiptList h3 {
  text-align: center;
}

#receiptList ul {
  list-style: none;
  padding: 0;
}

#receiptList li.receipt-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  margin-bottom: 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}

#receiptList li.receipt-item span {
  flex: 1;
}

#receiptList li.receipt-item button {
  margin-left: 12px;
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  background: #52796f;
  color: white;
  cursor: pointer;
  width: 30%;
}

#receiptList li.receipt-item button:hover {
  background: #354f52;
}

#filterClass, #filterStudent, #filterSession {
  max-width: 100%;
  padding: 5px;
  margin: 20px auto;
  border: solid 1px #000;
  border-radius: 6px;
}


/* === Print Styles === */
@media print {
  .no-print { 
    display: none; 
  }

  @page { 
    size: A5 landscape; 
    margin: -5mm; 
    padding: 10mm 10mm 0mm 10mm;
  } 
  body * { 
    visibility: hidden; 
  } 
  #receipt, #receipt * { 
    visibility: visible; 
  } 
  #receipt { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    background: white; 
    padding: 10mm; 
    box-sizing: border-box; 
    overflow: hidden; 
    page-break-after: avoid;
  } 
  #receipt h2 { 
    font-size: 30px; 
    margin: 0; 
    color: rgb(255, 58, 91); 
  } 
  #receipt p { 
    font-size: 15px; 
    line-height: 10px;
  } 
  /* Header: logos left + right, school info centered */ 
  .receipt-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
    position: relative; 
  } 
  .receipt-header .school-info { 
    text-align: center; 
    flex: 1;
  } 
  .receipt-header .logo { 
    width: 60px; 
    height: auto; 
    margin-top: 0px;
    padding-top: 0px;
  } 
  /* Watermark diagonal stripes */ 
  #receipt::after { 
    content: "Original Receipt Original Receipt Original Receipt"; 
    position: absolute; 
    top: 0; 
    left: 10%; 
    width: 50%; 
    height: auto; 
    font-size: 30px; 
    font-weight: bold; 
    color: pink; 
    opacity: 0.12; 
    line-height: 120px; 
    white-space: pre; 
    transform: rotate(30deg); 
    transform-origin: top left; 
    pointer-events: none; 
    margin: 0;
    padding: 0;
  }
  
  #receipt button { 
    display: none;
  }
}



/* === Responsive Tables === */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 10px;
  border-radius: 6px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.report-table th,
.report-table td {
  padding: 8px 12px;
  text-align: left;
  border: 1px solid #ddd;
  white-space: nowrap;
}

.report-table th {
  background: #f5f5f5;
  font-weight: 600;
}
#reprintReceipt table {
    text-align: center;
  }

/* === Filters === */
.filters {
  display: block;
  text-align: center;
  gap: 8px;
  margin-bottom: 12px;
}

.filters select,
.filters input {
  flex: 1 1 150px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
}


/* === Global Responsiveness === */

/* Medium screens (tablets) */
@media (max-width: 1030px) {
  .dashboard-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    position: relative;
    transform: translateX(0);
  }
  .main-content {
    padding: 15px;
  }

  input, select, textarea, button {
    width: 80%;
    max-width: none;
    padding: 15px 5px;
    margin: 25px auto;
    border: solid 1px #000;
    border-radius: 6px;
  }
  #filterload, #filterprint {
    max-width: 30%;
  }
}


@media (max-width: 850px) {
  h2 { 
    font-size: 1.4rem;
    margin-bottom: 5px; 
  }
  body { font-size: 0.95rem; }
  #reprintReceipt table {
    font-size: 0.9rem;
  }
  input, select, textarea, button {
    width: 80%;
    max-width: none;
    padding: 15px 5px;
    margin: 25px auto;
    border: solid 1px #000;
    border-radius: 6px;
  }

  #outstandingPayments button {
    font-size: 8px;
    padding: 5px;
    border-radius: 5px;
    margin: 5px auto;
  }
  #filterload, #filterprint {
    max-width: 30%;
  }
}

/* Text scaling */
@media (max-width: 768px) {
  h2 { 
    font-size: 1.4rem;
    margin-bottom: 5px; 
  }
  body { font-size: 0.95rem; }
  #reprintReceipt table {
    font-size: 0.5rem;
  }
  input, select, textarea, button {
    width: 80%;
    max-width: none;
    padding: 15px 5px;
    margin: 25px auto;
    border: solid 1px #000;
    border-radius: 6px;
  }

  #outstandingPayments tr {
    font-size: 8px;
  }
  #outstandingPayments button {
    font-size: 8px;
    padding: 5px;
    border-radius: 5px;
    margin: 5px auto;
  }
  #filterload, #filterprint {
    max-width: 30%;
  }
}

/* Small screens (phones) */
@media (max-width: 600px) {
  /* Sidebar becomes toggleable */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 140px;
    transform: translateX(-100%);
    z-index: 1000;
  }
  .sidebar.active {
    transform: translateX(0);
  }

  .menu-toggle {
    display: block;
    margin-top: 0px;
    width: 100%;
    padding-bottom: 10px;
    text-align: right;
  }

  .menu-toggle button {
    background: white;
  }
  .menu-toggle:hover {
    background: none;
  }

  .main-content {
    margin-left: 0;
    padding: 12px;
  }

  /* Inputs and buttons full width */
  input, select, textarea, button {
    width: 80%;
    max-width: none;
    padding: 10px;
    border: solid 1px #000;
    border-radius: 6px;
  }

  /* Table becomes card view */
  .report-table thead {
    display: none;
  }
  .report-table tr {
    display: flex;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    background: #fff;
    vertical-align: middle;
    
  }
  .report-table td {
    display: flex;
    justify-content: space-between;
    padding: 6px;
    border: none;
    border-bottom: 1px solid #eee;
  }
  .report-table td:last-child {
    border-bottom: none;
  }
  .report-table td::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 8px;
    color: #555;
  }
  #outstandingPayments button {
    font-size: 8px;
    padding: 5px;
    border-radius: 5px;
    margin: 5px auto;
  }
  #filterload, #filterprint {
    max-width: 40%;
  }
}


@media (max-width: 550px) {
  /* Inputs and buttons full width */
  input, select, textarea, button {
    width: 80%;
    max-width: none;
    padding: 10px 5px;
    margin: 10px auto;
  }
  #outstandingPayments button {
    font-size: 8px;
    padding: 5px;
    border-radius: 5px;
    margin: 5px auto;
  }
  #filterload, #filterprint {
    max-width: 40%;
  }
}

@media (max-width: 420px) {
  /* Inputs and buttons full width */
  input, select, textarea, button {
    width: 80%;
    max-width: none;
    padding: 10px 5px;
    margin: 10px auto;
    border: solid 1px #000;
    border-radius: 6px;
  }
  #outstandingPayments button {
    font-size: 8px;
    padding: 5px;
    border-radius: 5px;
    margin: 5px auto;
  }
  #filterload, #filterprint {
    max-width: 40%;
  }
}
@media (max-width: 370px) {
  /* Inputs and buttons full width */
  input, select, textarea, button {
    width: 80%;
    max-width: none;
    padding: 10px 5px;
    margin: 10px auto;
    border: solid 1px #000;
    border-radius: 6px;
  }
  #outstandingPayments button {
    font-size: 8px;
    padding: 5px;
    border-radius: 5px;
    margin: 5px auto;
  }
  #filterload, #filterprint {
    max-width: 40%;
  }
}