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;
}

/* Responsive table styles */
.table-responsive {
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar for better mobile experience */
.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

/* Responsive card styles */
.card {
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  padding: 1rem;
}

/* Form controls */
.form-control, .form-select {
  margin-bottom: 0.5rem;
}

/* Responsive spacing */
@media (max-width: 768px) {
  .container-fluid {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .card {
    border-radius: 0;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }

  .table td, .table th {
    padding: 0.5rem;
  }

  .btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .btn-group .btn {
    width: 100%;
    margin: 0;
  }
}

/* DataTables responsive styles */
.dataTables_wrapper .row {
  margin: 0;
  padding: 0.5rem 0;
}

.dataTables_filter, .dataTables_length {
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .dataTables_filter, .dataTables_length {
    text-align: left !important;
    width: 100%;
  }

  .dataTables_filter input {
    width: 100% !important;
    margin-left: 0 !important;
  }
}

/* Badge styles */
.badge {
  font-size: 0.875rem;
  padding: 0.35rem 0.65rem;
}

/* Form layout improvements */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  margin-bottom: 0.25rem;
  font-weight: 500;
}

/* Details view responsive improvements */
dl.row {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  dl.row {
    display: block;
  }

  dl.row dt {
    padding-bottom: 0;
  }

  dl.row dd {
    padding-top: 0;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
  }
}

/* Action buttons responsive layout */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 576px) {
  .action-buttons {
    flex-direction: column;
  }

  .action-buttons .btn {
    width: 100%;
  }
}

/* Navbar improvements */
.navbar-brand {
  font-size: 1.5rem;
  font-weight: 500;
}

.nav-link {
  padding: 0.5rem 1rem;
}

/* Footer responsive */
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
  padding: 0 1rem;
}

@media (max-width: 768px) {
  .footer {
    line-height: normal;
    padding: 1rem;
    text-align: center;
  }
}

/* Layout styles */
.layout-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar styles */
.sidebar {
    width: 250px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar.collapsed {
    margin-left: -250px;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

.sidebar-header .navbar-brand {
    color: #333;
    font-size: 1.25rem;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.sidebar-menu {
    padding: 1rem 0;
    flex-grow: 1;
}

.sidebar-item {
    margin: 0.25rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: #e9ecef;
    color: #0d6efd;
}

.sidebar-link.active {
    background: #e9ecef;
    color: #0d6efd;
    border-right: 3px solid #0d6efd;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    font-size: 0.875rem;
}

/* Main content styles */
.main-content {
    flex-grow: 1;
    width: calc(100% - 250px);
    min-height: 100vh;
    transition: all 0.3s;
    background: #f8f9fa;
}

.main-content.expanded {
    width: 100%;
}

/* Top navbar styles */
.navbar {
    padding: 0.5rem 1rem;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
}

.navbar .btn-link {
    color: #333;
    text-decoration: none;
}

/* Content area styles */
.content {
    padding: 1.5rem;
    background: #f8f9fa;
}

/* Card styles */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}

/* Form styles */
.form-control, .form-select {
    border-radius: 0.375rem;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.required:after {
    content: "*";
    color: #dc3545;
    margin-left: 0.25rem;
}

/* Button styles */
.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Table styles */
.table {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        height: 100%;
        left: 0;
        top: 0;
    }

    .main-content {
        width: 100%;
    }

    .card {
        margin: 0 -0.75rem 1rem;
        border-radius: 0;
    }

    .content {
        padding: 1rem;
    }

    .table-responsive {
        margin: 0 -0.75rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
        margin: 0.25rem 0;
    }
}

/* DataTables customization */
.dataTables_wrapper {
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
}

.dataTables_filter input {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

.dataTables_length select {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
}

/* Animation */
.sidebar, .main-content {
    transition: all 0.3s ease-in-out;
}

/* Utilities */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.border-bottom {
    border-bottom: 1px solid #dee2e6;
}

/* Badge styles */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 0.375rem;
}

/* Dropdown styles */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}