/* ===== Keyframe Animations ===== */
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  0% { opacity: 0; transform: translateX(-50px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes borderGradientMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #77216F, #E95420);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #ff9966, #ff5e62);
}
* {
  scrollbar-width: thin;
  scrollbar-color: #77216F rgba(255,255,255,0.1);
}

/* ===== Page Background ===== */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #2C001E, #77216F, #E95420);
  color: white;
  animation: fadeInUp 0.8s ease-out;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 250px;
  height: 100vh;
  position: fixed;
  overflow-y: auto;
  background: linear-gradient(135deg,
    rgba(0,0,0,0.8),
    rgba(48,10,36,0.8),
    rgba(128,45,34,0.7));
  backdrop-filter: blur(10px);
  box-shadow: 3px 0 20px rgba(0,0,0,0.5);
  color: white;
  transition: width 0.3s, background 0.4s ease-in-out;
  z-index: 1000;
  animation: fadeInLeft 0.6s ease-out;
}
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed ul a i { font-size: 1.6rem; }
.sidebar.collapsed ul a span,
.sidebar.collapsed .text-center h4 { display: none; }
.sidebar a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
}
.sidebar a::before {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 0;
  background: rgba(255,255,255,0.1);
  transition: height 0.3s ease;
  z-index: -1;
}
.sidebar a:hover::before { height: 100%; }
.sidebar a:hover { padding-left: 25px; color: #ffcc00; }
.sidebar ul li.active a {
  background: rgba(255,255,255,0.2);
  border-left: 4px solid #ffcc00;
  font-weight: bold;
  box-shadow: inset 0 0 12px rgba(255,204,0,0.6);
}
.sidebar ul li.active a i {
  color: #ffcc00;
  text-shadow: 0 0 8px #ffcc00, 0 0 15px #ffaa00;
}

/* ===== Toggle Button ===== */
#sidebar-toggle {
  position: absolute;
  top: 10px;
  right: -20px;
  background: #ffcc00;
  border-radius: 50%;
  padding: 8px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, background 0.3s ease;
}
#sidebar-toggle:hover {
  transform: rotate(90deg) scale(1.1);
  background: #ffdd33;
}

/* ===== Content Area ===== */
.content {
  margin-left: 250px;
  transition: margin-left 0.3s;
}
.content.collapsed { margin-left: 60px; }

/* ===== Glassy Cards/Forms ===== */
.card, .form-container {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 16px;
  padding: 1rem;
  
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: fadeInUp 0.8s ease-out;
}
.border-animated {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}
.border-animated::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(270deg, #E95420, #77216F, #2C001E, #E95420);
  background-size: 600% 600%;
  animation: borderGradientMove 5s linear infinite;
  z-index: -1;
}
.border-animated > * {
  position: relative;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 1rem;
  z-index: 1;
}

/* ===== Form Controls ===== */
.form-container input,
.form-container select,
.form-container textarea,
.select2-container--default .select2-selection--single {
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: #333;
  width: 100%;
  margin-bottom: 1rem;
  height: 44px;
  font-size: 1rem;
  box-sizing: border-box;
}
.select2-container--default .select2-selection--single {
  display: flex;
  align-items: center;
}
.select2-dropdown { border-radius: 0.5rem !important; }
.select2-results__option { color: blue; }

/* ===== Stylish Glass Table (global) ===== */
.table {
  width: 100%;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 16px;
  color: #fff;
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out;
}
.table th {
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-weight: bold;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding: 0.75rem;
}
.table td {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding: 0.75rem;
}
.table-responsive {
  overflow-x: auto;
  border-radius: 12px;
}

/* ===== Buttons ===== */
button, .btn {
  background: linear-gradient(to right, #28a745, #218838);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 10px 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
button:hover, .btn:hover {
  background: linear-gradient(to right, #ff4500, #ff8c00);
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}
button:active, .btn:active { transform: scale(0.97); }
.btn-edit, .btn-delete {
  padding: 6px 12px;
  font-size: 0.9rem;
  border-radius: 20px;
  display: inline-block;
  transition: transform 0.2s ease-in-out;
}
.btn-edit:hover, .btn-delete:hover { transform: scale(1.1); }

/* ===== Headings ===== */
h2 { color: #f1f1f1; }

/* ===== Report Page Glossy Tables ===== */
.report-section {
  margin: 18px 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}
.report-title {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,0.62), rgba(0,0,0,0.46));
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12),
              0 6px 18px rgba(0,0,0,0.25);
}
.report-table-wrap { overflow-x: auto; border-radius: 16px; }
.report-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.10), transparent 60%),
              linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.06));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 16px;
}
.report-table th, .report-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
.report-table thead th {
  position: sticky;
  top: 0;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(180deg, rgba(0,0,0,0.70), rgba(0,0,0,0.50)),
              radial-gradient(120% 180% at 0% 0%, rgba(255,255,255,0.10), transparent 70%);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.15),
              0 6px 14px rgba(0,0,0,0.25);
}
.report-table tbody tr:nth-child(even) td {
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
}
.report-table tbody tr:hover td {
  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
}

/* ===== Print tweak ===== */
@media print {
  .report-section, .report-table {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  .report-table thead th {
    position: static !important;
    background: #111 !important;
    color: #fff !important;
  }
}
.accordion {
  --bs-accordion-bg: transparent;
}