/* Center align DataTables table header cells globally */
body {
  font-family: 'Segoe UI', Roboto, sans-serif;
  background-color: #f0f2f5;
}

.sidebar-logo {
  background-image: url(../images/logo.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  width: 50%;
  /* Set desired width */
  height: 110px;
  /* Set desired height */
  display: block;
  margin-top: -2rem;
  margin-left: 5rem;
}

.sidebar {
  width: 250px;
  background-color: white;
  font-family: 'Segoe UI', Roboto, sans-serif;
  font-size: 20px;
  font-weight: 400;
  color: #333;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar.collapsed {
  width: 60px;
}

.sidebar.collapsed ul li a span {
  display: none;
}

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

.sidebar ul li a {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  color: #333;
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
  position: relative;
}

.sidebar ul li a i {
  margin-right: 15px;
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: black;
  /* keep your icon blue */
}

/* Hover Effects */
.sidebar ul li a:hover {
  background-color: #f6f9ff;
  color: #003287;
  border-left: 4px solid #003287;
  margin-left: 25px;
}

.sidebar ul li a {
  transition: all 0.5s ease;
  /* Adjust duration as needed */
}


/* Submenu */
.submenu {
  display: none;
  background-color: #f6f9ff;
  padding-left: 15px;

  transition: all 0.5s ease;
}

.submenu.open {
  display: block;
}

/* Arrow for submenu toggle */
.has-submenu .arrow {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.arrow.rotated {
  transform: rotate(180deg);
}


.toggle-btn {
  width: 35px;
  height: 30px;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1001;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px;
}

.bars {
  height: 4px;
  background-color: #003287;
  border-radius: 2px;
  transition: all 0.4s ease;
}

@media (max-width: 768px) {

  /* Sidebar logo */
  .sidebar-logo {
    background-image: url(../images/logo.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 60%;
    height: 100px;
    display: block;
    margin: -1rem auto;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar.active {
    width: 100%;
  }

  /* Main vertical menu */
  .sidebar ul {
    display: block;
    margin: 0;
    padding: 0;
  }

  .sidebar ul li {
    list-style: none;
    margin-bottom: 5px;
  }

  .sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 8px;
    background: #f6f9ff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    font-size: 15px;
    font-weight: 500;
    color: #003287;
    text-decoration: none;
    transition: all 0.3s ease;
  }

  .sidebar ul li a i {
    font-size: 18px;
    color: #003287;
    min-width: 22px;
    text-align: center;
  }

  .sidebar ul li a:hover {
    background: #003287;
    color: #fff;
    transform: translateX(4px);
  }

  .sidebar ul li a:hover i {
    color: #fff;
  }

  /* 🔹 Flatten submenus into normal menu items */
  .sidebar ul ul {
    display: block !important;
    /* Always visible */
    margin: 0;
    /* Remove indent */
    padding: 0;
    border: none;
    /* Remove left border */
  }

  .sidebar ul ul li a {
    background: #f6f9ff;
    /* Same style as main menu */
    font-size: 15px;
    padding: 14px 18px;
    margin-bottom: 5px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }

  .sidebar ul ul li a:hover {
    background: #003287;
    color: #fff;
  }

  /* Hide submenu arrow in mobile */
  .sidebar .arrow {
    display: none;
  }

  /* Toggle button visible */
  .toggle-btn {
    display: block;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 2001;
  }

  .toggle-btn {
    width: 35px;
    height: 30px;
    position: fixed;
    top: 11px;
    left: 15px;
    z-index: 1001;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
  }

  .bars {
    height: 4px;
    background-color: #003287;
    border-radius: 2px;
    transition: all 0.4s ease;
  }

  .fw-bold {
    font-weight: 700 !important;
    /* keep bold */
    text-align: center;
    /* center text */
    display: block;
    /* ensure full width */
    width: 100%;
  }
}

.custom-table th {
  background-color: #003287 !important;
  text-transform: lowercase;
}

.custom-table th::first-letter {
  text-transform: uppercase;
}

.custom-table tbody td {
  font-size: 18px !important;
}


/* Bar animations */
#checkbox:checked+.toggle-btn #bar1 {
  transform: rotate(45deg) translate(6px, 6px);
}

#checkbox:checked+.toggle-btn #bar2 {
  opacity: 0;
}

#checkbox:checked+.toggle-btn #bar3 {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Sidebar toggle using JS class, you still use .collapsed or .active in JS */
.sidebar {
  transition: all 0.3s ease;
}

.sidebar.collapsed {
  width: 60px;
}

.sidebar.active {
  left: 0;
}

@media (max-width: 768px) {
  .sidebar {
    left: -250px;
  }

  .sidebar.active {
    left: 0;
  }

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

  .fw-bold {
    margin-left: 2rem;
  }
}

.main-content {
  margin-left: 250px;
  padding: 10px;
  transition: margin-left 0.3s ease;
  min-height: 100vh;
  /* Ensures full screen height */
}

.main-content.expanded {
  margin-left: 60px;
}

.custom-box {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

label {
  font-weight: 600;
  font-size: 12px;
  color: #34495e;
  text-transform: uppercase;
  letter-spacing: 0.08px;
  font-family: "Segoe UI", Roboto, sans-serif;
}

.form-control,
.form-select {
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  background-color: #f9f9f9;
  transition: border-color 0.3s ease, box-shadow 0.2s ease;
}

.form-label {
  text-align: left !important;
  display: block;
  font-family: "Segoe UI", Roboto, sans-serif;
  margin-top: 1rem;

}

.form-label-custom {
  text-align: center !important;
  display: block;
  font-family: "Segoe UI", Roboto, sans-serif;
  margin-top: 1rem;

}


/* DataTables search input placeholder */
.dataTables_filter input[type="search"]::placeholder {
  color: #bfc7d1 !important;
  opacity: 1;
  font-style: normal;
}

.dataTable th,
.table.dataTable th,
.custom-table th {
  text-align: center !important;
  vertical-align: middle !important;
}

.add-btn-custom {
  /* From Uiverse.io by adamgiebl */
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: inline-block;
  text-align: center;
  font-weight: bold;
  padding: 8px 10px;
  border: 3px solid #003287;
  border-radius: 2px;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.1);
  color: #003287;
  text-decoration: none;
  transition: 0.3s ease all;
  z-index: 1;
}

.add-btn-custom:before {
  transition: 0.5s all ease;
  position: absolute;
  top: 0;
  left: 50%;
  right: 50%;
  bottom: 0;
  opacity: 0;
  content: '';
  background-color: rgb(52, 198, 52);
  z-index: -1;
}

.add-btn-custom:hover,
.add-btn-custom:focus {
  color: white;
}

.add-btn-custom:hover:before,
.add-btn-custom:focus:before {
  transition: 0.5s all ease;
  left: 0;
  right: 0;
  opacity: 1;
}

.add-btn-custom:active {
  transform: scale(0.9);
}


.form-label {
  font-weight: 600;
  font-size: 15px;
  color: #3a3a3a;
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.5px;
  position: relative;
  padding-left: 4px;
  transition: all 0.3s ease-in-out;
}


/* DASHBOARD PAGE */
/* Stat Cards */
.stat-card {
  border: none;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  background: white;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.6s forwards;
}

.stat-card .icon {
  font-size: 2rem;
  color: #003287;
  margin-bottom: 10px;
}

.stat-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Animation Keyframes */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Delay for each card */
.col-md-3:nth-child(1) .stat-card {
  animation-delay: 0.1s;
}

.col-md-3:nth-child(2) .stat-card {
  animation-delay: 0.2s;
}

.col-md-3:nth-child(3) .stat-card {
  animation-delay: 0.3s;
}

.col-md-3:nth-child(4) .stat-card {
  animation-delay: 0.4s;
}

/* Recently Added */
.card {
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.card-header {
  background: #003287;
  color: white;
  font-weight: 600;
}

table thead {
  background-color: #f1f3f5;
}

table tbody tr:hover {
  background: #f8f9fa;
  transition: 0.2s;
}

/* Animated counters */
.stat-card h3 {
  font-weight: bold;
  color: #333;
}

#expenseChart {
  max-height: 200px;
  /* smaller chart */
  width: 100% !important;
}


.custom-underline-heading {
  text-align: center;
  display: inline-block;
  border-bottom: 2px solid green;
  padding-bottom: 5px;
  margin: 0 auto;
}


@media print {
  .no-print {
    display: none;
  }
}

.custom-dropdown {
  position: relative;
  width: 250px;
  font-family: Arial, sans-serif;
}

/* Selected Field */
.dropdown-selected {
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 7px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.dropdown-selected img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-right: 8px;
  object-fit: cover;
}

/* Options list */
.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  display: none;
  /* hidden by default */
  z-index: 1000;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dropdown-option {
  display: flex;
  flex-direction: column;
  /* image top, text bottom */
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.dropdown-option img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
}

.dropdown-option span {
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

.dropdown-option:hover {
  background: #eaf6ff;
  transform: translateY(-2px);
  border-color: #4a90e2;
}


.custom-dropdown.open .dropdown-options {
  display: flex;
}


/* Preview Box */
.preview-box {
  height: 220px;
  border: 1px solid #ccc;
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Image fills top area */
.preview-img {
  width: 100%;
  height: 160px;
  /* fixed height for consistency */
  object-fit: contain;
  /* full image shown without cutting */
  border-radius: 8px;
  background: #f9f9f9;
  /* add bg for transparent imgs */
}

/* Text always at bottom */
.preview-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #003287;
  margin-top: 8px;
}



/* RECIPE VIEW PAGE */
.view-container {
  max-width: 1200px;
}

.view-card {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.view-header {
  background: #003287;
  color: white;
  font-weight: 600;
  text-align: center;
  border-radius: 12px 12px 0 0;
}

.view-label {
  font-weight: 500;
  color: #333;
}

.view-item-img {
  width: 120px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.view-item-name {
  font-weight: 600;
  margin: 0;
}

.view-input {
  border-radius: 8px;
}

.view-btn {
  border-radius: 8px;
  padding: 6px 16px;
}

.view-table thead {
  background: #002b80;
  color: white;
}

.view-table td,
.view-table th {
  text-align: center;
  vertical-align: middle;
}

.view-mini-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.swal2-popup {
  border-radius: 20px !important;
  padding: 1.5rem !important;
}

.swal2-icon {
  border: none !important;
  box-shadow: none !important;
}

.swal2-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: #444 !important;
}

.select2-container .select2-selection--multiple {
  box-sizing: border-box;
  cursor: pointer;
  display: block;
  min-height: 48px !important;
  user-select: none;
  -webkit-user-select: none;
  padding: 7px 14px !important;
  border: 1px solid #ccc !important;
  border-radius: 6px;
  font-size: 15px;
  background-color: #f9f9f9 !important;
  transition: border-color 0.3s ease, box-shadow 0.2s ease;
}