/* Custom Overrides for Tabler Theme */

/* Custom Brand Colors */
:root {
  --tblr-primary: #206bc4;
  --tblr-primary-rgb: 32, 107, 196;
  --tblr-primary-text-emphasis: #0a2a4e;
  --tblr-primary-bg-subtle: #d6e4f5;
  --tblr-primary-border-subtle: #adc9eb;
}

/* Navbar Customizations */
.navbar-vertical {
  background-color: #1e293b !important;
}

.navbar-vertical .navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
}

.navbar-vertical .nav-link {
  font-weight: 500;
}

.navbar-vertical .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.navbar-vertical .nav-link.active {
  background-color: var(--tblr-primary);
  color: white;
}

/* Submenu (Collapsible) Styling for Vertical Sidebar */
.navbar-vertical .nav-item.dropdown .collapse {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 0.375rem;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.navbar-vertical .nav-item.dropdown .collapse .nav {
  padding: 0.25rem 0;
}

.navbar-vertical .nav-item.dropdown .collapse .nav-item {
  padding-left: 1rem;
}

.navbar-vertical .nav-item.dropdown .collapse .nav-link {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
}

.navbar-vertical .nav-item.dropdown .collapse .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.navbar-vertical .nav-item.dropdown .collapse .nav-link.active {
  background-color: var(--tblr-primary);
  color: #ffffff;
}

/* Dropdown toggle icon rotation */
.navbar-vertical .nav-item.dropdown .dropdown-toggle::after {
  transition: transform 0.3s ease;
}

.navbar-vertical .nav-item.dropdown .dropdown-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

/* =====================================================
   STANDARDIZED CARD & LAYOUT STYLES
   ===================================================== */

/* Base card styling */
.card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

/* Card header */
.card-header {
  padding: 1.25rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background-color: #ffffff;
  border-top-left-radius: calc(0.5rem - 1px);
  border-top-right-radius: calc(0.5rem - 1px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
}

.card-header .card-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.5;
}

.card-header .card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Card body */
.card-body {
  padding: 1.5rem;
  flex: 1 1 auto;
}

.card-body.p-0 {
  padding: 0;
}

/* Card footer */
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
  border-bottom-left-radius: calc(0.5rem - 1px);
  border-bottom-right-radius: calc(0.5rem - 1px);
}

/* Special card variants */
.card-primary {
  border-color: var(--tblr-primary);
}

.card-primary .card-header {
  background-color: var(--tblr-primary);
  border-bottom-color: var(--tblr-primary);
  color: #ffffff;
}

.card-primary .card-title {
  color: #ffffff;
}

/* Empty state cards */
.empty {
  padding: 3rem 1.5rem;
  text-align: center;
}

.empty-img {
  margin-bottom: 1.5rem;
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.empty-subtitle {
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.empty-action {
  margin-top: 1.5rem;
}

/* Layout improvements */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f8fafc;
}

.page-body {
  padding: 1.5rem 0;
  flex: 1;
}

.container-fluid {
  max-width: none;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Row and column spacing */
.row-deck {
  margin-bottom: -1.5rem;
}

.row-deck > [class*="col"] {
  margin-bottom: 1.5rem;
}

.row-cards {
  margin-bottom: -1.5rem;
}

.row-cards > [class*="col"] {
  margin-bottom: 1.5rem;
}

/* Status Indicators */
.status-green {
  --tblr-status-color: #2fb344;
}

.status-yellow {
  --tblr-status-color: #f76707;
}

.status-red {
  --tblr-status-color: #d63939;
}

/* DataGrid Improvements */
.datagrid {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--tblr-border-color);
}

.datagrid:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Progress Bar Animations */
.progress-bar-indeterminate {
  animation: progress-indeterminate 3s linear infinite;
}

@keyframes progress-indeterminate {
  0% {
    left: -35%;
    right: 100%;
  }
  60% {
    left: 100%;
    right: -90%;
  }
  100% {
    left: 100%;
    right: -90%;
  }
}

/* =====================================================
   STANDARDIZED BUTTON STYLES
   ===================================================== */

/* Base button styling */
.btn {
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 0.375rem;
  transition: all 0.2s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Primary button */
.btn-primary {
  background-color: var(--tblr-primary);
  border-color: var(--tblr-primary);
  color: #ffffff;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: #1a5490;
  border-color: #1a5490;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

/* Secondary button */
.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #5a6268;
  border-color: #545b62;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Outline buttons */
.btn-outline-primary {
  color: var(--tblr-primary);
  border-color: var(--tblr-primary);
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: var(--tblr-primary);
  border-color: var(--tblr-primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
  background-color: transparent;
}

.btn-outline-secondary:hover {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-outline-success {
  color: #198754;
  border-color: #198754;
  background-color: transparent;
}

.btn-outline-success:hover {
  background-color: #198754;
  border-color: #198754;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-outline-danger {
  color: #dc3545;
  border-color: #dc3545;
  background-color: transparent;
}

.btn-outline-danger:hover {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Success button */
.btn-success {
  background-color: #198754;
  border-color: #198754;
  color: #ffffff;
}

.btn-success:hover {
  background-color: #157347;
  border-color: #146c43;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Danger button */
.btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Warning button */
.btn-warning {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background-color: #e0a800;
  border-color: #d39e00;
  color: #212529;
  transform: translateY(-1px);
}

/* Info button */
.btn-info {
  background-color: #0dcaf0;
  border-color: #0dcaf0;
  color: #000000;
}

.btn-info:hover {
  background-color: #31d2f2;
  border-color: #25cff2;
  color: #000000;
  transform: translateY(-1px);
}

/* Button sizes */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 0.25rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 0.5rem;
}

/* Button states */
.btn:disabled,
.btn.disabled {
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

/* Icon standardization */
.btn .icon {
  width: 1rem;
  height: 1rem;
  margin-right: 0.25rem;
}

.btn-sm .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.btn-lg .icon {
  width: 1.125rem;
  height: 1.125rem;
}

/* =====================================================
   STANDARDIZED FORM STYLES
   ===================================================== */

/* Form labels */
.form-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
  margin-bottom: 0.5rem;
  display: block;
}

.form-label.required::after {
  content: " *";
  color: #dc3545;
  font-weight: 700;
}

/* Form controls */
.form-control,
.form-select {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: #374151;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.625rem 0.75rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--tblr-primary);
  box-shadow: 0 0 0 0.25rem rgba(32, 107, 196, 0.25);
  outline: 0;
}

.form-control::placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* Form hints */
.form-hint {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-top: 0.25rem;
  display: block;
}

/* Form validation */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid,
.form-select.is-valid {
  border-color: #198754;
  box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

.invalid-feedback {
  color: #dc3545;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  display: block;
}

.valid-feedback {
  color: #198754;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  display: block;
}

/* Input groups */
.input-group {
  border-radius: 0.375rem;
  overflow: hidden;
}

.input-group .form-control,
.input-group .form-select {
  border-radius: 0;
}

.input-group .form-control:first-child,
.input-group .form-select:first-child {
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
}

.input-group .form-control:last-child,
.input-group .form-select:last-child {
  border-top-right-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
}

/* Checkboxes and radios */
.form-check-input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background-color: #ffffff;
}

.form-check-input:checked {
  background-color: var(--tblr-primary);
  border-color: var(--tblr-primary);
}

.form-check-input:focus {
  border-color: var(--tblr-primary);
  box-shadow: 0 0 0 0.25rem rgba(32, 107, 196, 0.25);
}

.form-check-label {
  font-size: 0.875rem;
  font-weight: 400;
  color: #374151;
  margin-left: 0.5rem;
}

/* File inputs */
.form-control[type="file"] {
  padding: 0.5rem 0.75rem;
}

.form-control[type="file"]::-webkit-file-upload-button {
  padding: 0.375rem 0.75rem;
  margin: -0.375rem -0.75rem -0.375rem 0;
  margin-inline-end: 0.75rem;
  color: #374151;
  background-color: #f9fafb;
  border: 0;
  border-inline-end: 1px solid #d1d5db;
  border-radius: 0;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Textarea */
.form-control[type="textarea"],
textarea.form-control {
  resize: vertical;
  min-height: 2.5rem;
}

/* =====================================================
   STANDARDIZED TYPOGRAPHY
   ===================================================== */

/* Base typography */
body {
  font-family: 'Inter Var', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.6;
  color: #374151;
  background-color: #f8fafc;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.4;
  color: #111827;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Page titles */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}

.page-pretitle {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

/* Text utilities */
.text-muted {
  color: #6b7280 !important;
}

.text-primary {
  color: var(--tblr-primary) !important;
}

.text-success {
  color: #059669 !important;
}

.text-danger {
  color: #dc2626 !important;
}

.text-warning {
  color: #d97706 !important;
}

.text-info {
  color: #0891b2 !important;
}

/* Links */
a {
  color: var(--tblr-primary);
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

a:hover {
  color: #1a5490;
  text-decoration: underline;
}

/* =====================================================
   STANDARDIZED TABLE STYLES
   ===================================================== */

/* Base table styling */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: #374151;
  vertical-align: top;
  border-color: #e5e7eb;
  font-size: 0.875rem;
}

.table > :not(caption) > * > * {
  padding: 0.875rem 1rem;
  background-color: var(--bs-table-bg);
  border-bottom-width: 1px;
  box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);
}

.table > tbody {
  vertical-align: inherit;
}

.table > thead {
  vertical-align: bottom;
}

/* Table headers */
.table thead th {
  font-weight: 600;
  color: #111827;
  background-color: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Table hover effect */
.table-hover > tbody > tr:hover > * {
  background-color: #f3f4f6;
}

/* Table responsive */
.table-responsive {
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
}

/* Table cards */
.card-table {
  border: none;
  margin: 0;
}

.card-table thead th {
  background-color: transparent;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: #111827;
}

.card-table tbody tr:last-child td {
  border-bottom: none;
}

/* Table utilities */
.table-vcenter td {
  vertical-align: middle;
}

.table-sm > :not(caption) > * > * {
  padding: 0.5rem 0.75rem;
}

/* Table striped */
.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
  background-color: #f9fafb;
}

/* Table bordered */
.table-bordered > :not(caption) > * {
  border-width: 1px 0;
}

.table-bordered > :not(caption) > * > * {
  border-width: 0 1px;
}

/* Avatar Customizations */
.avatar {
  font-weight: 600;
}

/* Badge Customizations */
.badge {
  font-weight: 600;
  padding: 0.35em 0.65em;
}

/* Alert Improvements */
.alert {
  border: none;
  font-weight: 500;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
}

.alert-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.alert-info {
  background-color: #dbeafe;
  color: #1e40af;
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
}

/* Notification Toast Animations */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.notification-toast {
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.notification-toast .btn-close {
  padding: 0.5rem;
}

/* Loading States */
.placeholder {
  animation: placeholder-glow 2s ease-in-out infinite;
}

@keyframes placeholder-glow {
  50% {
    opacity: 0.2;
  }
}

/* Mobile Responsive Improvements */
@media (max-width: 991.98px) {
  .navbar-vertical {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 1050;
    transition: left 0.3s ease;
  }
  
  .navbar-vertical.show {
    left: 0;
  }
  
  .page-wrapper {
    margin-left: 0;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .page-header,
  .footer,
  .btn,
  .dropdown {
    display: none !important;
  }
  
  .page-wrapper {
    margin-left: 0 !important;
  }
  
  .card {
    border: 1px solid #dee2e6 !important;
    box-shadow: none !important;
  }
}

/* =====================================================
   STANDARDIZED BADGES & STATUS INDICATORS
   ===================================================== */

/* Badge styling */
.badge {
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background-color: var(--tblr-primary);
  color: #ffffff;
}

.badge-success {
  background-color: #059669;
  color: #ffffff;
}

.badge-danger {
  background-color: #dc2626;
  color: #ffffff;
}

.badge-warning {
  background-color: #d97706;
  color: #ffffff;
}

.badge-info {
  background-color: #0891b2;
  color: #ffffff;
}

.badge-secondary {
  background-color: #6b7280;
  color: #ffffff;
}

/* Status dots */
.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.5rem;
}

.status-dot.status-success {
  background-color: #059669;
}

.status-dot.status-danger {
  background-color: #dc2626;
}

.status-dot.status-warning {
  background-color: #d97706;
}

.status-dot.status-info {
  background-color: #0891b2;
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

/* Shadow utilities */
.hover-shadow {
  transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Text utilities */
.text-truncate-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.text-truncate-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.font-weight-medium {
  font-weight: 500;
}

.font-weight-semibold {
  font-weight: 600;
}

.font-weight-bold {
  font-weight: 700;
}

/* Spacing utilities */
.space-y-2 > * + * {
  margin-top: 0.5rem;
}

.space-y-3 > * + * {
  margin-top: 0.75rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-x-2 > * + * {
  margin-left: 0.5rem;
}

.space-x-3 > * + * {
  margin-left: 0.75rem;
}

.space-x-4 > * + * {
  margin-left: 1rem;
}

/* Display utilities */
.d-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.d-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.d-flex-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Border utilities */
.border-t {
  border-top: 1px solid #e5e7eb;
}

.border-b {
  border-bottom: 1px solid #e5e7eb;
}

.border-l {
  border-left: 1px solid #e5e7eb;
}

.border-r {
  border-right: 1px solid #e5e7eb;
}

/* Rounded utilities */
.rounded-lg {
  border-radius: 0.5rem;
}

.rounded-xl {
  border-radius: 0.75rem;
}

.rounded-2xl {
  border-radius: 1rem;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* =====================================================
   ICON BUTTON STANDARDIZATION
   ===================================================== */

/* Icon buttons - same size for all */
.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  transition: all 0.2s ease-in-out;
  position: relative;
}

.btn-icon .icon {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
}

.btn-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

.btn-icon:disabled,
.btn-icon.disabled {
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

/* Icon button sizes */
.btn-icon.btn-sm {
  width: 2rem;
  height: 2rem;
}

.btn-icon.btn-sm .icon {
  width: 1rem;
  height: 1rem;
}

.btn-icon.btn-lg {
  width: 3rem;
  height: 3rem;
}

.btn-icon.btn-lg .icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* =====================================================
   PAGE HEADER SPACING OPTIMIZATION
   ===================================================== */

/* Reduce gap between page header and page body */
.page-header {
  padding-bottom: 0.5rem !important;
  margin-bottom: 0 !important;
}

.page-body {
  padding-top: 0.25rem !important;
}

/* Reduce card margin for tighter spacing */
.page-body .card:first-child {
  margin-top: 0 !important;
}

/* Reduce row spacing for tighter layout */
.page-body .row-deck {
  margin-bottom: -0.5rem !important;
}

.page-body .row-deck > [class*="col"] {
  margin-bottom: 0.5rem !important;
}

/* =====================================================
   USER DROPDOWN BUTTON OPTIMIZATION
   ===================================================== */

/* Make user dropdown button consistent with other buttons */
.page-header .dropdown .btn.dropdown-toggle {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  height: 2.5rem !important;
  min-height: 2.5rem !important;
  max-height: 2.5rem !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: auto;
  max-width: 200px;
  line-height: 1;
  box-sizing: border-box;
}

/* Truncate long email addresses */
.page-header .dropdown .btn.dropdown-toggle span:not(.avatar) {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Responsive behavior - hide email text on smaller screens */
@media (max-width: 991.98px) {
  .page-header .dropdown .btn.dropdown-toggle span:not(.avatar) {
    display: none !important;
  }
}

/* Avatar sizing in dropdown */
.page-header .dropdown .btn.dropdown-toggle .avatar {
  width: 1.75rem !important;
  height: 1.75rem !important;
  flex-shrink: 0;
  margin: 0;
}

/* Ensure dropdown button matches icon button styling exactly with dark border */
.page-header .dropdown .btn.dropdown-toggle {
  vertical-align: top;
  border-width: 1px !important;
  border-style: solid !important;
  border-color: #374151 !important;
  background-color: #ffffff !important;
  color: #374151 !important;
}

/* Make dropdown button border consistent with other buttons */
.page-header .dropdown .btn.dropdown-toggle:hover {
  border-color: #374151 !important;
  background-color: #f9fafb !important;
  color: #374151 !important;
}

.page-header .dropdown .btn.dropdown-toggle:focus {
  border-color: #374151 !important;
  background-color: #ffffff !important;
  color: #374151 !important;
  box-shadow: 0 0 0 0.25rem rgba(55, 65, 81, 0.1) !important;
}

/* Ensure all buttons in page header have same alignment */
.page-header .btn-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-header .btn-list .btn,
.page-header .btn-list .dropdown {
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
}

/* =====================================================
   STICKY FOOTER STYLING
   ===================================================== */

/* Make footer stick to bottom of page */
.footer {
  margin-top: auto;
  padding: 1.5rem 0;
  background-color: #ffffff;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

/* Ensure page wrapper uses full viewport height */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
}

/* Footer text styling */
.footer .list-inline-item a,
.footer .list-inline-item {
  font-size: 0.875rem;
  color: #6b7280;
}

.footer .list-inline-item a:hover {
  color: var(--tblr-primary);
  text-decoration: none;
}