:root {
  --primary-color: #083D89;
  --primary-hover: #0a4ba6;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --info-color: #17a2b8;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-bg: #f3f6f9;
  --white: #ffffff;
  --dark-text: #2c3e50;
  --muted-text: #6c757d;
  --border-color: #e2e8f0;
  --sidebar-width: 280px;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --card-hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --sidebar-bg: #ffffff;
  --font-main: 'Inter', sans-serif;
  --font-heading: 'Inter', sans-serif;
}

body {
  font-family: var(--font-main);
  background-color: var(--light-bg);
  color: var(--dark-text);
  font-size: 0.75rem; /* Reduced from 0.8rem */
  line-height: 1.4;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

a {
  text-decoration: none;
  transition: color 0.2s ease;
}

/* Sidebar Styling */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 40px 0 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  background-color: var(--sidebar-bg);
  transition: all 0.3s ease;
}

/* Sidebar Navigation */
.sidebar .nav-link {
  font-weight: 600;
  color: var(--muted-text);
  padding: 0.5rem 1rem;
  border-radius: 0 50px 50px 0;
  margin-right: 0.75rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem; /* Reduced from 0.85rem */
  white-space: normal;
}

.sidebar .nav-link:hover {
  background-color: rgba(8, 61, 137, 0.05);
  color: var(--primary-color);
  padding-left: 1.25rem;
}

.sidebar .nav-link.active {
  color: var(--primary-color);
  background-color: rgba(8, 61, 137, 0.1);
  border-left: 3px solid var(--primary-color);
}

.sidebar .nav-link .feather, .sidebar .nav-link i {
  width: 14px; /* Reduced icon size slightly */
  height: 14px;
  text-align: center;
  transition: transform 0.2s;
}

.sidebar .nav-link:hover .feather, .sidebar .nav-link:hover i {
    transform: scale(1.1);
}

.sidebar-heading {
  font-size: 0.65rem; /* Reduced from 0.7rem */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-text) !important;
  background-color: transparent !important;
  padding: 0.75rem 1rem 0.25rem;
  margin-top: 0.5rem;
  font-weight: 700;
  border-radius: 0;
}

.sidebar-heading > span {
    color: #a0aec0 !important;
}


/* Content Area */
main {
  padding-top: 1.5rem;
}

/* Card Styling */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  background-color: var(--white);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-hover-shadow);
}

.card-header {
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1rem; /* Reduced padding */
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary-color);
  font-size: 0.8rem; /* Reduced from 0.9rem */
}

/* Custom Card Headers */
.card-header.bg-warning {
    background: linear-gradient(45deg, #ffc107, #ffdb72) !important;
    color: #493800 !important;
    border: none;
}

.card-body {
  padding: 0.85rem; /* Reduced padding */
}

/* Stats/Metrics Styling */
.card h4 {
    font-size: 1.25rem; /* Reduced from 1.5rem */
    font-weight: 800;
    margin-bottom: 0.15rem;
    color: var(--dark-text);
}

.text-muted {
    font-size: 0.7rem; /* Reduced from 0.75rem */
    color: var(--muted-text) !important;
}

/* Navbar */
.navbar-brand {
  background-color: var(--primary-color);
  box-shadow: none;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 0.8rem; /* Reduced from 0.9rem */
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.navbar {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    min-height: 40px;
}

.bg-dark {
   background-color: var(--primary-color) !important;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.4rem 0.75rem; /* Reduced padding */
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem; /* Reduced from 0.8rem */
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.35rem 0.6rem; /* Reduced padding */
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 0.8rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(8, 61, 137, 0.1);
}

/* Accordion in Sidebar */
/* Accordion in Sidebar */
.accordion-button {
    padding: 0.5rem 1rem;
    background-color: transparent;
    color: var(--muted-text);
    font-weight: 600;
    box-shadow: none !important;
    font-size: 0.75rem; /* Reduced */
    gap: 10px;
    display: flex;
    align-items: center;
}

.accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background-color: rgba(8, 61, 137, 0.05);
}

.accordion-button::after {
    background-size: 0.7rem; /* Smaller arrow */
    opacity: 0.5;
    margin-left: auto;
}

.accordion-body {
    padding: 0;
}

.accordion-collapse .nav-item .nav-link {
    padding-left: 2.25rem;
    font-size: 0.7rem; /* Reduced */
}

/* Sidebar Accordion Reset */
.sidebar .accordion-item {
    background-color: transparent;
    border: none;
}

.sidebar .accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0,0,0,0.1);
}

/* Responsive */
@media (max-width: 767.98px) {
  .sidebar {
    top: 5rem;
    padding-top: 1rem;
  }
}

/* Utilities */
.rounded-3 {
    border-radius: 12px !important;
}

/* Custom Overrides for specific classes in dashboard.php */
.text-dark.px-3.py-3.rounded-3 {
    background-color: #e6f0ff !important;
    border: 1px solid #cce0ff;
}

.text-dark.px-3.py-4.rounded-3 {
    background-color: #fff5f5 !important;
    border: 1px solid #ffebeb;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    font-weight: 600;
}

.breadcrumb-item.active {
    color: var(--muted-text);
}

/* Tables */
.table-responsive {
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    background-color: #fff;
    padding: 1rem;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table thead th {
    border-top: none;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.7rem; /* Reduced */
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted-text);
    padding: 0.5rem; /* Reduced */
}

.table tbody td {
    padding: 0.5rem; /* Reduced */
    font-size: 0.8rem; /* Reduced from 0.9rem */
    color: var(--dark-text);
    border-bottom: 1px solid #f2f4f6;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(0, 0, 0, 0.015);
}

.table-hover > tbody > tr:hover > * {
   background-color: rgba(8, 61, 137, 0.03);
   transition: background-color 0.2s;
}

/* Badge overrides */
.badge {
    padding: 0.4em 0.7em;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.7rem; /* Reduced */
}

.badge.bg-success {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
}

.badge.bg-warning {
    background-color: #fff3cd !important;
    color: #664d03 !important;
}

.badge.bg-danger {
   background-color: #f8d7da !important;
   color: #842029 !important;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.modal-header {
    border-bottom: 1px solid #f2f4f6;
    padding: 1.5rem;
}

.modal-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f2f4f6;
    padding: 1.25rem 1.5rem;
}