body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  background-color: #f4f4f4;
  color: #333;
}

/* Layout wrapper */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
  align-items: stretch; /* ensure sidebar and main content both stretch full height */
}

/* Main content */
.main-content {
  flex: 1 1 auto; /* allow shrinking/growing inside flex container */
  padding: 30px;
  background-color: #fff;
  min-width: 0; /* prevents flex child overflow clipping */
  box-sizing: border-box;
}

/* Sidebar */
.sidebar-banner {
  flex: 0 0 250px; /* fixed width in flex layout */
  width: 250px;
  background-color: #fafafa;
  border-right: 1px solid #ddd;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto; /* allow vertical scrolling */
  align-self: stretch; /* force full height */
  z-index: 10;
  -webkit-overflow-scrolling: touch;
}
/* Debug helper */
.sidebar-banner.debug-scrollbar {
  overflow-y: scroll !important;
}

.sidebar-banner h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: #6a1b9a;
}

.menu-section a,
.sidebar-section a {
  display: block;
  margin-bottom: 10px;
  color: #6a1b9a; /* Terapia dark purple */
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s ease;
  white-space: normal;
  word-break: break-word;
}

.menu-section a:hover,
.sidebar-section a:hover {
  color: #4a148c; /* Slightly deeper purple on hover */
}

.sidebar-section {
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ccc;
}

.sidebar-section h4 {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #6a1b9a;
}

/* Forms */
form input,
form select,
form button {
  font-size: 14px;
}

.report-filter-form {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-bottom: 30px;
}

.report-filter-form .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.report-filter-form input,
.report-filter-form select {
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  width: 100%;
}

.report-filter-form button,
.report-filter-form .btn-reset {
  padding: 8px 14px;
  border-radius: 4px;
  background-color: #6a1b9a;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
}
/* Tables */
.report-table,
.course-summary-table,
.trainee-table,
.dashboard-table,
.audit-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.report-table th,
.course-summary-table th,
.trainee-table th,
.dashboard-table th,
.audit-table th {
  background-color: #6a1b9a;
  color: white;
  padding: 10px;
  text-align: left;
}

.report-table td,
.course-summary-table td,
.trainee-table td,
.dashboard-table td,
.audit-table td {
  padding: 10px;
  border-bottom: 1px solid #ccc;
}

/* Buttons */
.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  border: none;
  cursor: pointer;
}
.btn-view { background-color: #4CAF50; color: white; }
.btn-edit { background-color: #6a1b9a; color: white; }
.btn-archive { background-color: #d32f2f; color: white; }

.btn-received {
  background-color: #6a1b9a;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}
.btn-received:hover { background-color: #4a148c; }
.btn-received.disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
}

.approve-btn, .reject-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  margin-right: 6px;
}
.approve-btn { background-color: #2e7d32; color: #fff; }
.approve-btn:hover { background-color: #1b5e20; }
.reject-btn { background-color: #c62828; color: #fff; }
.reject-btn:hover { background-color: #8e0000; }
.approve-btn.disabled, .reject-btn.disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
}

/* Legend and status colors */
.legend {
  margin-bottom: 15px;
  font-family: 'Segoe UI', sans-serif;
}
.legend span {
  display: inline-block;
  margin-right: 20px;
  padding: 4px 8px;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
}
.legend .green { background-color: #2e7d32; }
.legend .amber { background-color: #d17f00; }
.legend .red { background-color: #c62828; }

.status-pending { color: #d17f00; font-weight: bold; }
.status-approved { color: #2e7d32; font-weight: bold; }
.status-rejected { color: #c62828; font-weight: bold; }

.days-green { color: #2e7d32; font-weight: bold; }
.days-amber { color: #d17f00; font-weight: bold; }
.days-red { color: #c62828; font-weight: bold; }

.rejection-text {
  color: #c62828;
  font-style: italic;
}

/* Misc */
.no-results { margin-top: 20px; font-style: italic; color: #777; }
.error-list {
  background-color: #ffe0e0;
  color: #b71c1c;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 20px;
}

/* Accessibility and small tweaks */
a:focus {
  outline: 3px solid rgba(106,27,154,0.25);
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .dashboard-wrapper { flex-direction: column; }
  .sidebar-banner {
    width: 100%;
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }
  .main-content { padding: 20px; }
}

/* Optional: helper class to temporarily reveal hidden elements during debugging */
.reveal-debug {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}