/* ===========================
   Google Fonts
=========================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ===========================
   Reset & Base
=========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

/* WYŁĄCZENIE ANIMACJI w trakcie ładowania (JS zdejmie body.preload po inicjalizacji) */
body.preload .sidebar,
body.preload .navbar,
body.preload .main {
  transition: none !important;
}

/* ===========================
   Sidebar (Layout & Base)
=========================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;                 /* desktop odsunięcie dopiero w media-query */
  width: 180px;
  height: 100vh;
  background: #11101d;
  padding: 15px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: transform 0.3s ease; /* ★ ZMIANA: było left -> transform */
  transform: translateX(0);        /* ★ ZMIANA: sterujemy transformem */
  z-index: 1205;                   /* ★ ZMIANA: ponad overlay i navbar */
}

.sidebar .bx {
  font-size: 24px;
  vertical-align: middle;
  margin-right: 10px;
}

/* ===========================
   Logo
=========================== */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 28px;
  padding: 0 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 2px;
  text-decoration: none;
}

.logo-icon {
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: white;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-right: 10px;
  font-weight: bold;
}

.logo-text {
  font-size: 24px;
  color: #fff;
  font-weight: 600;
  letter-spacing: 1px;
}

/* animacja przy najechaniu */
.logo:hover .logo-icon {
  transform: rotate(360deg);
  transition: transform 0.6s ease;
}

/* ===========================
   Toggler (mobile / desktop)
=========================== */
.sidebar-toggler-mobile,
.sidebar-toggler-desktop {
  cursor: pointer;
  font-size: 24px;
  color: #fff;
  transition: transform 0.2s ease;
}

.sidebar-toggler-mobile:hover,
.sidebar-toggler-desktop:hover {
  transform: scale(1.1);
}

/* Mobilny toggler tylko na małych ekranach */
.sidebar-toggler-mobile {
  display: none;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}

/* Desktopowy toggler na >768px */
@media (min-width: 769px) {
  .sidebar-toggler-desktop {
    display: inline-block;
    margin-left: 15px;
  }
}

/* ===========================
   Menu (scrollowalna sekcja)
=========================== */
.menu-content {
  position: relative;
  margin-top: 10px;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px 8px 8px;
}

/* ładniejszy scrollbar (opcjonalnie) */
.menu-content::-webkit-scrollbar { width: 8px; }
.menu-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
}
.menu-content:hover::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
}

.menu-items { list-style: none; padding: 0; margin: 0; }
.menu-items .item { margin-bottom: 4px; }

/* Linki w menu i stopce */
.sidebar a { color: #fff; text-decoration: none; }

.item a,
.footer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  text-decoration: none;
  width: 100%;
}

.sidebar a i { font-size: 22px; margin-right: 12px; }

.item a:hover,
.footer-link:hover { background: rgba(255, 255, 255, 0.1); }

/* ===========================
   Submenu (np. Raporty)
=========================== */
.item.has-submenu .submenu-toggle {
  width: 100%;
  background: transparent;
  color: #fff;
  border: 0;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.item.has-submenu .submenu-toggle:hover { background: rgba(255,255,255,0.1); }

.item.has-submenu .submenu-toggle .caret {
  margin-left: auto;
  transition: transform 0.2s ease;
}
.item.has-submenu .submenu-toggle.open .caret { transform: rotate(180deg); }

.item.has-submenu .submenu {
  list-style: none;
  margin: 2px 0 6px 0;
  padding-left: 36px;
  display: none; /* JS używa slideDown/slideUp */
}

.item.has-submenu .submenu li a {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  display: block;
  color: #fff;
}
.item.has-submenu .submenu li a:hover { background: rgba(255,255,255,0.08); }

/* Aktywny link */
.item a.active,
.item.has-submenu .submenu li a.active { background: rgba(64,112,244,0.35); }

/* ===========================
   Sidebar Footer
=========================== */
.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  background: #11101d;
}

/* ===========================
   Overlay (opcjonalnie)
=========================== */
.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1100;           /* ★ ZMIANA: poniżej sidebara, powyżej main */
  display: none;
}
.overlay.active { display: block; }

/* ===========================
   Navbar & Main – BASE (mobile-first)
=========================== */
.navbar,
.main {
  left: 0;
  width: 100%;
  transition: left 0.3s ease, width 0.3s ease;
}

.navbar {
  position: fixed;
  top: 0;
  background: #4070f4;
  padding: 10px 10px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1200;            /* ★ ZMIANA: ponad overlay */
  height: 70px;
}

.navbar .title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.navbar .title h2 { margin: 0; font-size: 22px; }

.main {
  position: relative;
  padding: 90px 20px 20px 20px;
  min-height: 100vh;
  background-color: #f8f9fa;
}

/* ===========================
   Desktop layout (>=769px)
=========================== */
@media (min-width: 769px) {
  .navbar { left: 180px; width: calc(100% - 180px); }
  .main   { left: 180px; width: calc(100% - 180px); }

  .sidebar.collapsed { 
    /* ★ ZMIANA: oprócz left, zamykamy też transformem dla spójności animacji */
    transform: translateX(-100%);
  }
  .navbar.collapsed,
  .main.collapsed {
    left: 0;
    width: 100%;
  }
}

/* ===========================
   Mobile (<=768px)
=========================== */
@media (max-width: 768px) {
  /* ★ ZMIANA: mobilnie sidebar wjeżdża nad treść, więc nie ruszamy left/width navbara i main */
  .sidebar { 
    left: 0;                         /* nie kombinujemy leftem */
    transform: translateX(-100%);    /* domyślnie schowany */
  }
  .sidebar:not(.collapsed) { 
    transform: translateX(0);        /* po otwarciu */
  }

  /* ★ ZMIANA: na mobile NIE przesuwamy layoutu – te klasy nic nie zmieniają */
  .navbar.collapsed,
  .main.collapsed {
    left: 0;
    width: 100%;
  }

  .sidebar-toggler-mobile { display: flex; }
  .sidebar:not(.collapsed) ~ .navbar .sidebar-toggler-desktop { display: none !important; }

  /* Stopka w sidebarze nadal poza przewijanym obszarem */
  .sidebar-footer { position: relative; }
}

/* ===========================
   Dodatkowe UI drobiazgi
=========================== */
profile-pic img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
}

.item a:hover { background: rgba(255, 255, 255, 0.1); }

.container { padding: 20px; background-color: #f8f9fa; }

/* ===========================
   Formularze / błędy
=========================== */
.fade-out { transition: opacity 0.5s ease-out; opacity: 0; }
input.is-invalid { border-color: #dc3545; }
label.error { color: #dc3545; font-weight: 500; }

/* ===========================
   DataTables
=========================== */
table.dataTable { width: 100% !important; table-layout: auto; }
tr.dtz-odd  { background-color: #fff; }
tr.dtz-even { background-color: #f8f9fa; }

/* ===========================
   Widoki PDF (desktop)
=========================== */
.pdf-desktop {
  width: 1024px !important;
  max-width: none !important;
  font-size: 14px !important;
  zoom: 1 !important;
  transform: none !important;
  margin: 0 auto !important;
}
.pdf-desktop .no-print { display: none !important; }

/* ===========================
   Link do umowy (kolor stały)
=========================== */
a.contract-link { color: #000 !important; text-decoration: none; }
a.contract-link:visited,
a.contract-link:hover,
a.contract-link:active,
a.contract-link:focus { color: #000 !important; text-decoration: none; }
a.contract-link i,
a.contract-link .bx { color: inherit !important; }

.contractValue {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0d6efd;
  letter-spacing: .3px;
}

/* ===========================
   Drobne korekty tabel / kart
=========================== */
.card .card-header .fw-semibold { line-height: 1; }
.table thead th { white-space: nowrap; }
#parentKpis .card { border-radius: 0.75rem; }
#studentsTable tbody tr.selected { background: #e8f0fe !important; }

/* ===========================
   Checkboxy statusów (responsive inline wrap)
=========================== */
.status-filter-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}
.status-filter-wrap .form-check-inline {
  margin-right: 0 !important;
  margin-bottom: 0.25rem;
}

/* ===========================
   Raporty
=========================== */
.filters .form-label { font-weight: 600; }
.group-header {
  background:#eef2f6; border-top:1px solid #d8e0ea; border-bottom:1px solid #d8e0ea;
  padding:.35rem .5rem; cursor:pointer; user-select:none;
}
.group-badge { margin-left:.5rem; }
.table thead th { white-space: nowrap; }

/* Checkboxy stażu w jednej linii */
.internship-wrap {
  display:flex; gap:.5rem; align-items:center; white-space:nowrap; overflow:auto;
  padding:.375rem .5rem; border:1px solid #ced4da; border-radius:.375rem; min-height:2.6rem;
}
.internship-wrap .form-check { margin-bottom:0; }
.internship-wrap .form-check-input { cursor:pointer; }
.internship-wrap .form-check-label { cursor:pointer; margin-left:.25rem; }

/* Statusy umowy w jednej linii (multiselect) */
.status-wrap {
  display:flex; gap:.5rem; align-items:center; white-space:nowrap; overflow:auto;
  padding:.375rem .5rem; border:1px solid #ced4da; border-radius:.375rem; min-height:2.6rem;
}
.status-wrap .form-check { margin-bottom:0; }
.status-wrap .form-check-input { cursor:pointer; }
.status-wrap .form-check-label { cursor:pointer; margin-left:.25rem; }

.badge-total { width:100%; }
@media (min-width:576px){ .badge-total { width:auto; } }

@media (max-width: 576px) {
  .internship-wrap, .status-wrap { white-space:nowrap; overflow-x:auto; }
  .status-filter-wrap .form-check-label { font-size: 0.85rem; }
	.status-filter-wrap .d-flex { flex-wrap: wrap; gap: .5rem 1rem !important; }
  .status-filter-wrap .form-check { flex: 1 1 45%; min-width: 140px; }
}
/* ===========================
   Modale
=========================== */
/* Modal zawsze nad paskiem i overlayem */
.modal-backdrop.show { z-index: 1290; }
.modal.show          { z-index: 1300; }

/* ===========================
   Przyciski
=========================== */
@media (max-width: 767.98px) {
	.btn-group-responsive {
		display: flex;
		flex-direction: column;
		width: 100%;
	}
	.btn-group-responsive .btn {
		width: 100%;
	}
}
