  :root {
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 70px;
  --sidebar-bg: linear-gradient(135deg, #3498db, #e74c3c, #95a5a6);
  --sidebar-bg-dark: linear-gradient(to bottom right, #111, #222);
  --link-color: #fff;
  --link-hover: rgba(255, 255, 255, 0.15);
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #f4f7fc;
  transition: background 0.3s;
  color: #000;
}

body.dark-mode {
  background-color: #1e1e2f;
  color: #fff !important;
}

/* Wrapper flex layout */
#wrapper {
  display: flex;
}

/* Sidebar fixed width, fixed position */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: white;
  min-height: 100vh;
  position: fixed;  /* fixed so it stays on scroll */
  top: 0;
  left: 0;
  overflow-y: auto;  /* scroll if content too tall */
  overflow-x: hidden;
  transition: width 0.3s ease;
  z-index: 1000; /* on top */
}



/* Main content needs margin-left equal to sidebar width */
.main-content {
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;

}


/* Adjust main content margin and width when sidebar collapsed */
.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width) !important;
}

.sidebar.dark {
  background: var(--sidebar-bg-dark);
}

.logo-section {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  font-size: 1.2rem;
  font-weight: bold;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  justify-content: space-between;
}

.logo-text {
  white-space: nowrap;
  overflow: hidden;
  transition: font-size 0.3s ease;
  font-size: 1.2rem;
}

.sidebar.collapsed .logo-text {
  font-size: 0.8rem;
}

.sidebar.collapsed .toggle-btn {
  cursor: pointer;
  font-size: 18px;
  color: #fff;
  margin-left: 2px;
   margin-right: 20px;
}

.dark-toggle {
  background: none;
  border: none;
  color: #fff !important;
  font-size: 18px;
  cursor: pointer;
  margin-right: 10px;
}

.dark-toggle.active {
  color: #ffd700;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar .nav-item {
  padding: 0.5rem 1rem;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff !important;
  transition: background 0.3s;
  white-space: nowrap;
}

.sidebar .nav-link:hover {
  background-color: var(--link-hover);
  border-radius: 5px;
}

.sidebar .nav-item.active .nav-link {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: bold;
  border-radius: 5px;
}

.sidebar.collapsed .nav-link span {
  display: none;
}

body.dark-mode .sidebar .nav-link {
  color: #ccc;
}

body.dark-mode .sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.content-wrapper {
  flex-grow: 1;
  padding: 1rem;
  transition: margin-left 0.3s ease;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  box-sizing: border-box;
}

.sidebar.collapsed ~ .content-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    z-index: 1000;
    height: 100vh;
  }

  .content-wrapper {
    margin-left: 0 !important;
  }
}

.page-footer {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, #3498db, #e74c3c, #95a5a6);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.9rem;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 1000;
}

body.dark-mode .page-footer {
  background: linear-gradient(to bottom right, #111, #222);
  color: #ccc;
}

/* DARK MODE EXTENSIONS */

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode p,
body.dark-mode span,
body.dark-mode a,
body.dark-mode div,
body.dark-mode label,
body.dark-mode strong,
body.dark-mode small {
  color: #fff !important;
  background-color: transparent !important;
}

/* Table styling for dark mode */
body.dark-mode table {
  background-color: #2a2a3d !important;
  color: #fff !important;
  border-collapse: collapse;
  width: 100%;
}

body.dark-mode thead {
  background-color: #333 !important;
}

body.dark-mode th,
body.dark-mode td {
  border: 1px solid #444 !important;
  padding: 8px;
  color: #fff !important;
}

/* Zebra striping */
body.dark-mode tr:nth-child(even) {
  background-color: #2f2f42;
}

body.dark-mode tr:hover {
  background-color: #3a3a50;
}

/* Form controls */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background-color: #333 !important;
  color: #fff !important;
  border: 1px solid #555 !important;
}

/* Buttons */


/* Scrollbar for dark mode (optional) */
body.dark-mode ::-webkit-scrollbar {
  width: 8px;
}
body.dark-mode ::-webkit-scrollbar-track {
  background: #222;
}
body.dark-mode ::-webkit-scrollbar-thumb {
  background: #444;
}
body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #555;
}
/**************************** table design ********************/
 

    .styled-table {
      width: 100%;
      border-collapse: collapse;
      margin: 10px;
      font-size: 0.9em;
      min-width: 400px;
    
      border-radius: 5px;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
       padding: auto;
     
    }


  .styled-table thead tr {
    background-color: #009879;
    color: #ffffff;
    text-align: left;
    font-weight: bold;
  }

  .styled-table th, .styled-table td {
    padding: 12px 15px;
  }

  .styled-table tbody tr {
    border-bottom: 1px solid #dddddd;
  }

  .styled-table tbody tr:nth-of-type(even) {
    background-color: #956fff
  }

  .styled-table tbody tr:last-of-type {
    border-bottom: 2px solid #009879;
  }

  .styled-table tbody tr:hover {
    background-color: #009879;
    color: #fff;
    font-weight: bold;
  }

  .page-item.active .page-link {
    background-color: #009879 !important;
    color: #fff;
    border: none !important;
  }

  .flatpickr-input {
    background-color: white !important;
    cursor: pointer;
  }
   .hedding-content{
     background-color: #e9ecef!important;
      color: black;
  }
  .user-button{
     background-color: #009879!important;
  }
  .user-button:hover{
     background-color:#e9ecef!important ;
  }
   /************************ TABLE FILTER ************************/
   .styled-table .filter-icon {
        float: right;
        color: white;
        cursor: pointer;
        font-size: 1.1em;
        user-select: none;
        position: relative;
    }

    .styled-table .filter-dropdown {
        display: none;
        position: absolute;
        background: white;
        border: 1px solid #ddd;
        padding: 6px;
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        max-height: 250px;
        overflow-y: auto;
        width: 220px;
        top: 100%;
        left: 0;
        margin-top: 4px;
        border-radius: 4px;
        color: #000;
    }

    .styled-table .filter-dropdown label {
        display: block;
        margin-bottom: 4px;
        cursor: pointer;
        font-size: 0.9em;
    }

   .styled-table  .filter-dropdown button {
        margin-top: 5px;
        background-color: #009879;
        color: white;
        border: none;
        padding: 6px 10px;
        border-radius: 4px;
        width: 100%;
        cursor: pointer;
        font-weight: bold;
    }

   .styled-table  .filter-dropdown input[type="search"] {
        width: 100%;
        padding: 4px 6px;
        margin-bottom: 8px;
        border: 1px solid #ccc;
        border-radius: 3px;
    }
  /************************** side panel css code***************/
  .slide-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 30%;
    height: 100%;
    background: #f8f9fa;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1050;
    transition: right 0.3s ease-in-out;
    padding: 20px;
    overflow-y: auto;
  }

  .slide-panel.show {
    right: 0;
  }

  .configure-btn {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1000;
  }

  .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
  }

  .custom-type-input {
    display: none;
  }

  .selected-person {
    display: inline-block;
    margin-right: 8px;
    margin-top: 5px;
    background: #007bff;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
  }

  .selected-person .remove {
    margin-left: 5px;
    cursor: pointer;
  }