/* Reset dhe layout bazë për sticky footer */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%; /* i nevojshëm për flex container */
}

/* Krijo një container prind që mbulon të gjithë faqen */
#page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* mbush lartësinë e faqes */
}

/* content-wrapper zgjerohet për të shtyrë footer-in poshtë */
.content-wrapper {
  flex: 1 0 auto;
  margin-top: 30px; /* lartësia e navbar-it (default) */
  transition: margin-left 0.3s ease, margin-top 0.3s ease;
}

/* Footer duhet të qëndrojë gjithmonë në fund */
.footer {
  flex-shrink: 0;
  background-color: var(--navbar-bg, #f8f9fa);
  color: #333;
  text-align: center;
  padding: 10px 0;
  border-top: 1px solid #dee2e6;
  width: 100%;
  position: relative;
  margin-bottom: auto; /* Bën që përmbajtja ta shtyjë footer-in në fund */
}

/* ==========================
   SIDEBAR
========================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0; /* Desktop: i hapur (≥992px). */
  width: 250px;
  height: 100vh;
  background-color: var(--sidebar-bg, #343a40);
  color: var(--sidebar-text, #ffffff);
  transition: left 0.3s ease;
  z-index: 1030;
  border-right: 1px solid #dee2e6;
  /* Shtoni këto dy rreshta për scroll vertikal */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* për një lëvizje më të butë në celular */
}

.sidebar-header {
  text-align: center;
  padding: 1rem;
}

/* Fshi logon < 992px */
@media (max-width: 991px) {
  .sidebar-header img {
    display: none;
  }
}

.sidebar-header img {
  max-width: 180px;
  height: auto;
}

.sidebar ul li a {
  display: block;
  color: var(--sidebar-text, #ffffff);
  padding: 10px 15px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar ul li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile/Tablet: sidebar i fshehur default (left:-250px).
   Kthehet me klasa .active => left:0 */
@media (max-width: 991px) {
  .sidebar {
    left: -250px;
  }
  .sidebar.active {
    left: 0;
  }
  /* // Shto këtë:
     Kur ekrani < 992px, shto pak margin-top (p.sh. 80px) për .content-wrapper */
  .content-wrapper {
    margin-top: 60px; /* e rrit pak distancën nga navbar */
    margin-left: 0; /* mobile: normalisht s'ka sidebar të hapur */
  }
}

/* ==========================
   NAVBAR
========================== */
.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 70px;
  background-color: var(--navbar-bg, #f8f9fa) !important;
  z-index: 1040;
  transition: margin-left 0.3s ease;
}

/* ==========================
   LAYOUT - DESKTOP (≥992px)
========================== */
@media (min-width: 992px) {
  .navbar {
    margin-left: 250px; /* sidebar i hapur */
  }
  .content-wrapper {
    margin-left: 100px;
    margin-top: 100px; /* siç e ke vendosur */
  }
}

/* ==========================
   CHART STYLING (opsionale)
========================== */
.chart-container {
  height: 300px;
  width: 100%;
  position: relative;
}
.chart-container canvas {
  height: 100% !important;
  width: 100% !important;
}

.page-title {
  display: none; /* Fshehet parazgjedhje */
  font-size: 1.5rem; /* Rrit madhësinë e fontit */
  font-weight: bold; /* E bën më të trashë tekstin */
  color: #151515; /* Ngjyrë më e errët për kontrast më të mirë */
}

@media (min-width: 992px) {
  .page-title {
    display: block; /* Shfaqet në ekranet e mëdha */
    font-size: 1.5rem; /* Rrit madhësinë në ekrane të mëdha */
  }
}

.card-icon {
  font-size: 1rem; /* Rrit madhësinë e ikonave */
  display: block;
  margin-bottom: 5px;
}

/* Stilizim për faqen e login-it */

/* Qëndrimi vertikal i përmbajtjes */
.login-page {
  background-color: #f8f9fa;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0; /* Hiq margin/padding default */
  padding: 0;
}

/* Kartë e brendshme ku qëndron formulari */
.login-card {
  background-color: #fff;
  border-radius: 8px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

/* Logo (opsionale) */
.brand-logo {
  display: block;
  margin: 0 auto 1rem;
  max-height: 50px; /* Mund ta ndryshosh */
}

/* Titulli kryesor i login-it */
.login-title {
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.5rem;
}

/* ==========================
   STILET PËR FAQEN 404
========================== */
.error-page {
  background-color: #f8f9fa;
  height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.error-container {
  text-align: center;
  max-width: 500px;
  background: #fff;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

.error-number {
  font-size: 8rem;
  font-weight: 700;
  color: #dc3545; /* E kuqe bootstrap */
  line-height: 1;
}

.error-message {
  font-size: 1.2rem;
  color: #666;
}

.go-home {
  margin-top: 20px;
}

/* ==========================
   STILET PËR BRENDËSIN E FAQES
========================== */
.content {
  margin-top: 20px;
  margin-left: 150px;
  padding: 20px;
}

@media (max-width: 991px) {
  .content {
    padding-top: 20px;
    margin: 0;
  }
}

/* Stilizimi i Tabelës */
.custom-table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
}

.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #dee2e6;
  text-align: center;
}

.custom-table th,
.custom-table td {
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
  padding: 12px 15px;
}

.custom-table th {
  background-color: #f8f9fa;
  color: #333;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 2px solid #dee2e6;
  text-align: center;
}

.custom-table tbody tr:nth-child(even) {
  background-color: #f3f3f3; /* Rreshti gri i lehtë për dallim */
}

.custom-table tbody tr:hover {
  background-color: #e9ecef; /* Ngjyra kur kalon miun sipër */
}

/* Për pajisjet mobile, bëje tabelën më kompakte */
@media (max-width: 768px) {
  .custom-table th,
  .custom-table td {
    padding: 8px 10px;
    font-size: 14px;
  }
}

/* Për katrorin e filterit */
.filter-card {
  margin-top: 0px;
  margin-bottom: 20px; /* Distanca midis filtrit dhe tabelës */
}

.filter-label {
  display: block;
  font-weight: 600;
  color: #42484d;
  margin-bottom: 5px;
}

/* Stilizim per footer-div */
.footer-div {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: #f8f9fa;
  text-align: center;
  margin-left: 0px;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.toast-container {
  z-index: 1055;
  pointer-events: none; /* Për të mos bllokuar klikimet poshtë */
}

.toast {
  pointer-events: auto; /* Lejon klikimet vetëm te toast */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Reports */
.desc-details {
  display: block;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* Gjendja e mbyllur: truncation */
.desc-details summary {
  display: inline-block;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* Gjendja e hapur: shfaq tekstin e plotë */
.desc-details[open] summary {
  white-space: normal; /* Lejon rreshta të shumëfishtë */
  overflow: visible; /* Mos e fsheh më tekstin */
  text-overflow: clip; /* Hiq ellipsis */
  max-width: 100%; /* Mund ta bëni edhe none */
  display: block; /* Që teksti të dalë plotësisht */
}

/* Nëse përshkrimi është në kolona me klasë .desc-col */
.desc-col {
  display: block; /* nga inline-block në block */
  max-width: 300px; /* kufizon gjerësinë */
  margin: 0 auto; /* qendërzon brenda qelizës së tabelës */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center; /* teksti brenda summary në qendër */
  cursor: pointer;
}

/* Gjendja e mbyllur: truncation e <summary> */
.desc-col summary {
  display: block; /* nga inline-block në block */
  max-width: 300px; /* kufizon gjerësinë */
  margin: 0 auto; /* qendërzon brenda qelizës së tabelës */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center; /* teksti brenda summary në qendër */
  cursor: pointer;
}

/* Gjendja e hapur: shfaq tekstin e plotë */
.desc-col[open] summary {
  white-space: normal; /* Lejon rreshta të shumëfishtë */
  overflow: visible; /* Mos e fsheh më tekstin */
  text-overflow: clip; /* Hiq ellipsis */
  max-width: 100%; /* Ose none */
  display: block; /* Teksti i plotë */
  text-align: center; /* Vazhdon në qendër */
}

.fixed-date-width {
  min-width: 100px;
}

.subcategory-row td {
  font-style: italic;
  font-size: 0.9em;
  color: #555;
  background-color: #f9f9f9;
}
.category-row:hover {
  background-color: #f1f1f1;
}
