html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

@media (min-width: 768px) {
  body {
    margin-bottom: 0;
  }
}

/* Branch Management Styles */
.working-hour-row {
  background-color: #f8f9fa;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
}

.working-hour-row:nth-child(odd) {
  background-color: #e9ecef;
}

.modal-lg {
  max-width: 900px;
}

.table th {
  border-top: none;
  font-weight: 600;
  color: #495057;
  background-color: #f8f9fa;
}

.table td {
  vertical-align: middle;
}

.btn-group .btn {
  margin-right: 0.25rem;
}

.btn-group .btn:last-child {
  margin-right: 0;
}

.card-title {
  color: #495057;
  font-weight: 600;
}

.page-link {
  color: #495057;
}

.page-item.active .page-link {
  background-color: #007bff;
  border-color: #007bff;
}

/* Branch status badges */
.badge {
  font-size: 0.75rem;
}

.badge.bg-success {
  background-color: #28a745 !important;
}

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

.badge.bg-info {
  background-color: #17a2b8 !important;
}

/* Form check styling */
.form-check-label strong {
  color: #495057;
}

.form-text {
  font-size: 0.875em;
  color: #6c757d;
}

/* Sidebar Navigation Styles */
.wrapper {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: linear-gradient(180deg, #201a19 0%, #362f2e 100%);
  color: #ede0dd;
  transition: all 0.25s ease;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #473836;
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (min-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    flex-shrink: 0;
  }
}

.sidebar.active {
  left: 0;
}

.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid #473836;
  background-color: #a93729;
  background: linear-gradient(135deg, #a93729 0%, #881f15 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff8f6;
}

.sidebar-header h4 {
  color: #fff8f6;
  margin: 0;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.15px;
}

.sidebar-content {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
  background-color: #201a19;
  /* Ensure smooth scrolling */
  scrollbar-width: thin;
  scrollbar-color: #59504f #362f2e;
}

/* Custom scrollbar for webkit browsers */
.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: #362f2e;
  border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background-color: #59504f;
  border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background-color: #655c5b;
}

.sidebar .nav-pills .nav-link {
  color: #b4a9a7;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  margin: 0.125rem 0.75rem;
  transition: all 0.25s ease;
  font-weight: 400;
  font-size: 0.875rem;
  letter-spacing: 0.15px;
  border: 1px solid transparent;
}

.sidebar .nav-pills .nav-link:hover {
  color: #ede0dd;
  background-color: #362f2e;
  border-color: #473836;
  transform: translateX(4px);
}

.sidebar .nav-pills .nav-link.active {
  color: #fff8f6;
  background-color: #a93729;
  background: linear-gradient(135deg, #ca4f3f 0%, #a93729 100%);
  border-color: #ca4f3f;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(169, 55, 41, 0.3);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #473836;
  background-color: #362f2e;
}

.sidebar-footer .btn-link {
  color: #b4a9a7;
  text-decoration: none;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  transition: color 0.25s ease;
}

.sidebar-footer .btn-link:hover {
  color: #ede0dd;
}

.sidebar-footer .btn-outline-primary {
  border-color: #59504f;
  color: #b4a9a7;
  font-size: 0.875rem;
  border-radius: 8px;
  transition: all 0.25s ease;
}

.sidebar-footer .btn-outline-primary:hover {
  background-color: #a93729;
  border-color: #ca4f3f;
  color: #fff8f6;
  box-shadow: 0 2px 4px rgba(169, 55, 41, 0.2);
}

.sidebar-toggle {
  color: #fff8f6;
  background: none;
  border: none;
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.25s ease;
}

.sidebar-toggle:hover {
  color: #fff8f6;
  background-color: rgba(255, 248, 246, 0.1);
}

.topbar {
  background: linear-gradient(135deg, #a93729 0%, #881f15 100%);
  color: #fff8f6;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #ca4f3f;
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .content {
    margin-left: 280px; /* Account for fixed sidebar width */
  }
  
  .topbar {
    display: none;
  }
}

.content main {
  flex: 1;
  padding: 1.5rem;
}

/* Main page footer adjustments for fixed sidebar */
@media (min-width: 768px) {
  .footer {
    margin-left: 280px; /* Account for fixed sidebar width */
  }
}

/* Overlay for mobile when sidebar is open */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(32, 26, 25, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1040;
  display: none;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.show {
  display: block;
}

/* Mobile responsive adjustments */
@media (max-width: 767.98px) {
  .content main {
    padding: 1rem;
  }
  
  .sidebar-header h4 {
    font-size: 1.1rem;
  }
  
  body.sidebar-open {
    overflow: hidden;
  }
}

/* Ensure proper box-sizing for all elements */
.sidebar,
.sidebar * {
  box-sizing: border-box;
}

/* Ensure content area has proper height calculation */
@media (min-width: 768px) {
  .content {
    min-height: calc(100vh - 60px); /* Account for potential footer */
  }
  
  /* Prevent horizontal scroll when sidebar is fixed */
  .wrapper {
    overflow-x: hidden;
  }
}

/* Additional UniSight brand enhancements */
.sidebar .nav-pills .nav-link i {
  margin-right: 0.5rem;
  width: 1rem;
  text-align: center;
}

/* Subtle animation for navigation items */
.sidebar .nav-pills .nav-item {
  position: relative;
  overflow: hidden;
}

.sidebar .nav-pills .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(135deg, #ca4f3f 0%, #eb6756 100%);
  transition: width 0.25s ease;
  z-index: -1;
}

.sidebar .nav-pills .nav-link.active::before {
  width: 100%;
}

/* Improve text contrast and readability */
.sidebar-header {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Mobile improvements */
@media (max-width: 767.98px) {
  .sidebar-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
  }
  
  .sidebar .nav-pills .nav-link {
    margin: 0.125rem 0.5rem;
    padding: 0.625rem 1rem;
  }
}

/* Focus states for accessibility */
.sidebar .nav-pills .nav-link:focus {
  outline: 2px solid #ffb4a8;
  outline-offset: 2px;
}

.sidebar-toggle:focus {
  outline: 2px solid #ffb4a8;
  outline-offset: 2px;
}