/* ===========================
   GLOBAL STYLES
=========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f4f6f9;
  color: #333;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

main {
  flex: 1;
  display: flex;
  flex-wrap: nowrap;
  min-height: calc(100vh - 56px);
}

/* ===========================
   NAVBAR
=========================== */
.navbar {
  background: linear-gradient(135deg, #0d6efd, #094ec0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
  font-weight: 600;
}

.navbar .nav-link {
  color: #fff !important;
  font-weight: 500;
  transition: color 0.3s;
}

.navbar .nav-link:hover {
  color: #ffd700 !important;
}

/* ===========================
   DARK MODE TOGGLE SWITCH
=========================== */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 34px;
  transition: background-color 0.3s;
}

.slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

input:checked + .slider {
  background-color: #0d6efd;
}

input:checked + .slider::before {
  transform: translateX(22px);
}

/* ===========================
   SIDEBAR
=========================== */
.sidebar {
  width: 240px;
  background-color: #0d6efd;
  color: #fff;
  flex-shrink: 0;
  padding: 15px;
  transition: transform 0.3s ease-in-out, background 0.3s;
  min-height: calc(100vh - 56px);
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
}

.sidebar h5 {
  color: #fff;
  font-weight: 600;
  margin-bottom: 1rem;
}

.sidebar .nav-link {
  color: #dbe4ff;
  border-radius: 6px;
  padding: 10px 12px;
  transition: all 0.2s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #fff;
  background-color: #0b5ed7;
}

.sidebar.hidden {
  transform: translateX(-100%);
}

/* ===========================
   MAIN CONTENT
=========================== */
.content {
  flex-grow: 1;
  padding: 20px;
  background: #f8f9fa;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ===========================
   CARDS & TABLES
=========================== */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
  transition: transform 0.2s, background 0.3s, color 0.3s;
}

.card:hover {
  transform: translateY(-3px);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background: #0d6efd;
  color: #fff;
}

.table th,
.table td {
  padding: 12px 15px;
  text-align: left;
}

/* ===========================
   FOOTER
=========================== */
footer {
  background: #0d6efd !important;
  color: #fff;
  text-align: center;
  padding: 12px 10px;
  font-size: 0.95rem;
  margin-top: auto;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  transition: background 0.3s, color 0.3s;
}

/* ===========================
   DARK MODE
=========================== */
body.dark {
  background-color: #121212;
  color: #e5e5e5;
}

body.dark .navbar {
  background: linear-gradient(135deg, #1e1e1e, #292929);
}

body.dark .sidebar {
  background-color: #1e1e1e;
}

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

body.dark .sidebar .nav-link:hover,
body.dark .sidebar .nav-link.active {
  background-color: #333;
  color: #fff;
}

body.dark .content {
  background: #181818;
}

body.dark .card {
  background: #242424;
  color: #e5e5e5;
}

body.dark .table thead {
  background: #333;
}

body.dark .table tbody tr:hover {
  background: #2c2c2c;
}

body.dark footer {
  background: #1e1e1e !important;
  color: #ccc;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    height: calc(100% - 56px);
    z-index: 1050;
    transform: translateX(-100%);
  }
  .sidebar.active {
    transform: translateX(0);
  }
}

@media (max-width: 576px) {
  .content {
    padding: 12px;
  }
  .btn,
  .form-control {
    font-size: 0.85rem;
    padding: 0.5rem;
  }
}
tr.clickable-row {
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

tr.clickable-row:hover {
  background-color: #e9f3ff !important;
  /* light blue like all_branches.php */
}

/* --- Highlight search terms softly --- */
mark {
  background-color: #fff3b0;
  /* soft yellow */
  padding: 0 3px;
  border-radius: 3px;
}

/* --- Buttons consistency --- */
.btn {
  border-radius: 8px;
  font-weight: 500;
}

/* --- Card spacing uniform --- */
.card {
  border-radius: 12px;
  overflow: hidden;
}

/* --- Pagination alignment --- */
.pagination .page-item.active .page-link {
  background-color: #0d6efd;
  border-color: #0d6efd;
}