/* =========================
   Base Styles
========================= */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Arial", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
  color: #212529;
}

#bar-chart-places {
  width: 1500px;  /* enough width for all 35+ branches */
  height: 600px;  /* enough height for rotated labels */
}
/* Bootstrap helper overrides */
.text-success { color: #198754 !important; font-weight: 600; }
.text-danger { color: #dc3545 !important; font-weight: 600; }

/* =========================
   Login Container
========================= */
.box-area {
  max-width: 960px;
  margin: 2rem auto;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  overflow: hidden;
}

.right-box { padding: 2rem; font-weight: 500; }

::placeholder { font-size: 0.95rem; color: #6c757d; }

/* =========================
   Sidebar
========================= */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100%;
  width: 250px;
  background-color: #ffffff;
  border-right: 2px solid #ced4da;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  box-shadow: 1px 0 5px rgba(0,0,0,0.25);
  overflow-y: auto;
  z-index: 1030;
  transition: transform 0.3s ease;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  color: #212529;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 20px;
  transition: all 0.2s ease-in-out;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background-color: #007e4d;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0,126,77,0.25);
  transform: none;
  border-left: 4px solid #004f30;
}

hr {
  border: none;
  border-top: 2px solid #dee2e6;
  margin: 1rem auto;
  width: 90%;
  opacity: 0.7;
}

.sidebar .description {
  font-size: 18px;
  font-weight: 500;
  color: #495057;
  margin-left: 10px;
  line-height: 1.5;
  padding: 6px 0;
}

.sidebar .nav-link:hover .description,
.sidebar .nav-link.active .description { color: #ffffff; }

.sidebar .sub-menu {
  background-color: #ffffff;
  border-left: 3px solid #007e4d;
  font-size: 18px;
}

.badge {
  font-size: 0.85rem;
  background-color: #dc3545;
  border-radius: 50px;
  padding: 5px 10px;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(220,53,69,0.3);
}

/* =========================
   Hamburger Toggle (Centered)
========================= */
.hamburger-toggle {
  display: none;
  font-size: 24px;
  background-color: #007bff; 
  border: 2px solid #ffffff;
  border-radius: 6px;
  cursor: pointer;
  color: #ffffff;
  padding: 6px 12px;
  transition: color 0.3s ease, background 0.3s ease;
  z-index: 1050;
}

.hamburger-toggle:hover { background-color: #0062cc; }

.hamburger-toggle i {
  transition: transform 0.3s ease;
}

.hamburger-toggle.active i {
  transform: rotate(180deg);
}

/* =========================
   Floating Sidebar Toggle
========================= */
.floating-toggle {
  display: none; /* hidden on desktop by default */
  position: fixed;
  top: 2%;
  left: 250px; /* aligns to sidebar width */
  transform: translateY(-50%);
  background-color: #007bff;
  color: #fff;
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  z-index: 1050;
  transition: left 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

.floating-toggle:hover { background-color: #0062cc; }

.floating-toggle i { transition: transform 0.3s ease; }

.sidebar.show ~ .floating-toggle i { transform: rotate(180deg); }

/* =========================
   Main Content
========================= */
.main-content {
  margin-left: 250px;
  padding: 2rem;
  transition: margin-left 0.3s ease;
  font-weight: 500;
}

/* Sidebar Header */
.sidebar header .image-text {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

.sidebar .image-text img {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
}

.header-text .name { font-weight: 700; font-size: 20px; }
.header-text .profession { font-size: 16px; color: #6c757d; margin-top: -2px; font-weight: 500; }

/* =========================
   Responsive Design
========================= */
@media (max-width: 768px) { /* mobile + tablet */

  /* Hamburger centered above main content */
  .hamburger-toggle {
    display: block;
    position: relative;
    margin: 0 auto 1rem auto;
  }

  /* Sidebar hidden by default */
  .sidebar { 
    transform: translateX(-100%);
  }

  .sidebar.show { transform: translateX(0); }

  /* Overlay */
  .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1025;
  }

  .overlay.active { display: block; }

  /* Main content full width on mobile */
  .main-content { margin-left: 0; }

  /* Floating toggle visible on mobile/tablet */
  .floating-toggle { display: block; left: 0; top: 5%; }
  .sidebar.show ~ .floating-toggle { left: 250px; }
}
/* =========================================================
📱 Mobile Responsive DataTable (Cards View)
========================================================= */
@media (max-width: 768px) {

  /* 🔍 Search Bar: full width & spacing */
  .dataTables_filter {
    width: 100%;
    margin-bottom: 10px;
  }

  .dataTables_filter input {
    width: 100%;
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    margin-top: 8px;
  }

  /* 📄 Entries info & pagination alignment */
  .dataTables_info,
  .dataTables_paginate {
    text-align: center;
    width: 100%;
  }

  .dataTables_paginate {
    margin-top: 10px;
  }

  /* 🧾 Hide table headers */
  #ticketsTable thead,
  #processTable thead,
  #resolvedTicketsTable thead,
  #usertable thead,
  #monthlyreporttable thead,
  #auditTable thead,
  #DoListTable thead { /* ✅ added DoListTable */
    display: none;
  }

  /* 🔲 Convert table structure into blocks */
  #ticketsTable,
  #processTable,
  #resolvedTicketsTable,
  #usertable,
  #monthlyreporttable,
  #auditTable,
  #DoListTable, /* ✅ added */
  #ticketsTable tbody,
  #processTable tbody,
  #resolvedTicketsTable tbody,
  #usertable tbody,
  #monthlyreporttable tbody,
  #auditTable tbody,
  #DoListTable tbody, /* ✅ added */
  #ticketsTable tr,
  #processTable tr,
  #resolvedTicketsTable tr,
  #usertable tr,
  #monthlyreporttable tr,
  #auditTable tr,
  #DoListTable tr, /* ✅ added */
  #ticketsTable td,
  #processTable td,
  #resolvedTicketsTable td,
  #usertable td,
  #monthlyreporttable td,
  #auditTable td,
  #DoListTable td { /* ✅ added */
    display: block;
    width: 100%;
  }

  /* 💳 Each row as a card */
  #ticketsTable tr,
  #processTable tr,
  #resolvedTicketsTable tr,
  #usertable tr,
  #monthlyreporttable tr,
  #auditTable tr,
  #DoListTable tr { /* ✅ added */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.2rem;
    padding: 15px;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  /* 🪄 Slight hover animation for better UX */
  #ticketsTable tr:hover,
  #processTable tr:hover,
  #resolvedTicketsTable tr:hover,
  #usertable tr:hover,
  #monthlyreporttable tr:hover,
  #auditTable tr:hover,
  #DoListTable tr:hover { /* ✅ added */
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  /* 🧩 Table cells inside cards */
  #ticketsTable td,
  #processTable td,
  #resolvedTicketsTable td,
  #usertable td,
  #monthlyreporttable td,
  #auditTable td,
  #DoListTable td { /* ✅ added */
    text-align: left;
    padding: 10px 10px 10px 45%;
    position: relative;
    border: none;
    border-bottom: 1px solid #eee;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
  }

  /* 🏷️ Column labels (data-label attribute) */
  #ticketsTable td:before,
  #processTable td:before,
  #resolvedTicketsTable td:before,
  #usertable td:before,
  #monthlyreporttable td:before,
  #auditTable td:before,
  #DoListTable td:before { /* ✅ added */
    content: attr(data-label);
    position: absolute;
    left: 15px;
    top: 10px;
    width: 40%;
    white-space: normal;
    font-weight: 600;
    color: #555;
    font-size: 13px;
  }

  /* 🚫 Remove border on last cell */
  #ticketsTable td:last-child,
  #processTable td:last-child,
  #resolvedTicketsTable td:last-child,
  #usertable td:last-child,
  #monthlyreporttable td:last-child,
  #auditTable td:last-child,
  #DoListTable td:last-child { /* ✅ added */
    border-bottom: none;
  }

  /* 🎨 Buttons, badges, and links fit neatly */
  #ticketsTable td button,
  #processTable td button,
  #resolvedTicketsTable td button,
  #usertable td button,
  #monthlyreporttable td button,
  #auditTable td button,
  #DoListTable td button, /* ✅ added */
  #ticketsTable td .badge,
  #resolvedTicketsTable td .badge,
  #usertable td .badge,
  #monthlyreporttable td .badge,
  #auditTable td .badge,
  #DoListTable td .badge { /* ✅ added */
    transform: scale(1);
    margin-top: 6px;
    font-size: 0.9rem;
  }

  /* 🧭 Prevent horizontal scrolling */
  .dataTables_wrapper {
    overflow-x: hidden;
  }

  /* 🧱 Make pagination buttons readable */
  .dataTables_paginate .paginate_button {
    padding: 6px 10px;
    margin: 0 2px;
    border-radius: 6px;
  }

  /* 📱 Better spacing between controls */
  .dataTables_length,
  .dataTables_filter,
  .dataTables_info,
  .dataTables_paginate {
    margin-bottom: 10px;
  }

}


@media (max-width: 768px) {

  /* Hide table headers */
  #activeTable thead,
  #historyTable thead {
    display: none;
  }

  /* Make tbody, tr, td block */
  #activeTable,
  #historyTable,
  #activeTable tbody,
  #historyTable tbody,
  #activeTable tr,
  #historyTable tr,
  #activeTable td,
  #historyTable td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  /* Card styling for each row */
  #activeTable tr,
  #historyTable tr {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
    padding: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  /* Hover effect */
  #activeTable tr:hover,
  #historyTable tr:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }

  /* Card cell styling */
  #activeTable td,
  #historyTable td {
    text-align: left;
    padding: 10px 10px 10px 45%;
    position: relative;
    border-bottom: 1px solid #eee;
    word-wrap: break-word;
  }

  /* Add data-label before each cell */
  #activeTable td:before,
  #historyTable td:before {
    content: attr(data-label);
    position: absolute;
    left: 15px;
    top: 10px;
    width: 40%;
    white-space: normal;
    font-weight: 600;
    color: #555;
    font-size: 13px;
  }

  /* Remove border for last cell */
  #activeTable td:last-child,
  #historyTable td:last-child {
    border-bottom: none;
  }

  /* Make search bar and pagination full width */
  .dataTables_filter input {
    width: 100%;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 8px;
    box-sizing: border-box;
  }
}
