html {
  font-size: 16px;
}

body {
  background: #f5f6f8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

a {
  color: inherit;
}

.card,
.modal-content,
.chapter-item,
.resource-item {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.card-body {
  padding: 20px 24px;
}

.border {
  border: 1px solid #dee2e6 !important;
}

.rounded-lg {
  border-radius: 12px;
}

.rounded-square {
  border-radius: 12px;
}

.nav {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.nav-item {
  list-style: none;
}

.ps-4 {
  padding-left: 1.5rem !important;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 1.5rem;
  padding-left: 0;
}

.nav-tabs .nav-link {
  border: 1px solid transparent;
  border-radius: 10px 10px 0 0;
  background: transparent;
  margin-bottom: -1px;
  padding: 12px 16px;
}

.nav-tabs .nav-link.active {
  background: #fff;
  border-color: #dee2e6 #dee2e6 #fff;
  color: #111827;
}

.tab-content > .tab-pane {
  display: none;
}

.tab-content > .active {
  display: block;
}

.fade {
  transition: opacity 0.15s linear;
}

.fade:not(.show) {
  opacity: 0;
}

.fade.show {
  opacity: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  transition: all 0.15s ease;
}

.btn:disabled,
fieldset:disabled .btn {
  cursor: not-allowed;
  opacity: 0.65;
}

.btn-primary {
  background: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.btn-primary:hover {
  background: #c82333;
  border-color: #bd2130;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.875rem;
  border-radius: 8px;
}

.btn-secondary {
  background: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

.btn-outline-primary {
  background: #fff;
  border-color: #0d6efd;
  color: #0d6efd;
}

.btn-outline-primary:hover {
  background: #0d6efd;
  color: #fff;
}

.btn-outline-secondary {
  background: #fff;
  border-color: #6c757d;
  color: #6c757d;
}

.btn-outline-secondary:hover {
  background: #6c757d;
  color: #fff;
}

.btn-outline-success {
  background: #fff;
  border-color: #198754;
  color: #198754;
}

.btn-outline-success:hover {
  background: #198754;
  color: #fff;
}

.btn-outline-warning {
  background: #fff;
  border-color: #ffc107;
  color: #8a6d03;
}

.btn-outline-warning:hover {
  background: #ffc107;
  color: #111827;
}

.btn-outline-danger {
  background: #fff;
  border-color: #dc3545;
  color: #dc3545;
}

.btn-outline-danger:hover {
  background: #dc3545;
  color: #fff;
}

.bg-primary {
  background: #0d6efd !important;
  color: #fff !important;
}

.bg-secondary {
  background: #6c757d !important;
  color: #fff !important;
}

.bg-info {
  background: #cff4fc !important;
}

.text-dark {
  color: #111827 !important;
}

.btn-close {
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0.7;
}

.btn-close::before {
  content: "×";
  display: inline-block;
  font-size: 1.25rem;
  line-height: 1;
}

.btn-close-white {
  color: #fff;
}

.form-label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
}

.form-control {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  line-height: 1.5;
  color: #111827;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 8px;
}

textarea.form-control {
  resize: vertical;
}

.form-control:focus {
  outline: none;
  border-color: #f08a94;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.text-center {
  text-align: center !important;
}

.text-start {
  text-align: left !important;
}

.text-muted,
.small {
  color: #6c757d !important;
}

.small {
  font-size: 0.875rem;
}

.d-flex {
  display: flex !important;
}

.flex-column {
  flex-direction: column !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.align-items-center {
  align-items: center !important;
}

.mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}

.mt-auto {
  margin-top: auto !important;
}

.w-100 {
  width: 100% !important;
}

.gap-2 {
  gap: 0.5rem !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.me-auto { margin-right: auto !important; }
.ms-2 { margin-left: 0.5rem !important; }

.p-4 { padding: 1.5rem !important; }
.px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
.py-10 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }

.alert {
  position: relative;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
}

.alert-warning {
  color: #664d03;
  background: #fff3cd;
  border-color: #ffecb5;
}

.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
}

.table {
  width: 100%;
  margin-bottom: 1rem;
  color: #111827;
  border-collapse: collapse;
  table-layout: auto;
}

.table > :not(caption) > * > * {
  padding: 0.75rem;
  border-bottom: 1px solid #dee2e6;
}

.table-bordered > :not(caption) > * {
  border-width: 1px 0;
}

.table-bordered > :not(caption) > * > * {
  border: 1px solid #dee2e6;
}

.table-sm > :not(caption) > * > * {
  padding: 0.4rem;
}

.table-hover tbody tr:hover {
  background: #f8fafc;
}

.table th,
.table td {
  vertical-align: middle;
}

.table th:last-child,
.table td:last-child {
  white-space: nowrap;
  text-align: center;
}

.job-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.job-actions .me-1 {
  margin-right: 0 !important;
}

.collapse {
  display: none;
}

.collapse.show {
  display: block;
}

.collapse .nav-link {
  display: block;
}

.accordion-item {
  border: 1px solid #dee2e6;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 10px;
}

.accordion-button {
  width: 100%;
  border: 0;
  background: #fff;
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}

.accordion-button.collapsed {
  background: #fff;
}

.accordion-button:not(.collapsed) {
  background: #fff5f5;
  color: #a61d2d;
}

.accordion-body {
  padding: 14px 16px;
  border-top: 1px solid #dee2e6;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.45);
  padding: 24px;
}

.modal.show {
  display: block;
}

.modal-dialog {
  position: relative;
  width: auto;
  max-width: 800px;
  margin: 32px auto;
}

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

.modal-xl {
  max-width: 1140px;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.modal-body {
  position: relative;
  padding: 20px;
}

.modal-dialog-scrollable .modal-content {
  max-height: calc(100vh - 64px);
}

.modal-dialog-scrollable .modal-body {
  overflow-y: auto;
}

body.modal-open {
  overflow: hidden;
}
