html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  background: #f8f9fc;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  text-align: right;
  margin: 0;
  padding: 0;
}

/* Form Controls */
.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 #4e73df;
}

input,
textarea,
select {
  text-align: right;
}

.form-control:focus {
  border-color: #4e73df;
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Cards */
.card {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid #e3e6f0;
  font-weight: 600;
  color: #4e73df;
  padding: 1rem 1.25rem;
}

.card-body {
  padding: 1.25rem;
}

/* Metric Cards */
.metric-card {
  border-left: 4px solid #4e73df;
  transition: all 0.3s;
}

.metric-card:hover {
  border-left-width: 6px;
}

.metric-card span {
  color: #858796;
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.metric-card strong {
  color: #5a5c69;
  display: block;
  font-size: 2rem;
  margin-top: .5rem;
}

.approval-timeline {
  margin-right: 1rem;
  position: relative;
}

.approval-timeline::before {
  background: #dbe4ef;
  bottom: 1rem;
  content: "";
  position: absolute;
  right: .45rem;
  top: 1rem;
  width: 2px;
}

.approval-timeline-item {
  padding: 0 2rem 1rem 0;
  position: relative;
}

.approval-timeline-marker {
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .12);
  height: 1rem;
  position: absolute;
  right: 0;
  top: 1rem;
  width: 1rem;
  z-index: 1;
}

.approval-timeline-content {
  border-radius: .75rem;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Buttons */
.btn {
  border-radius: 0.35rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.2s;
}

.btn-primary {
  background: #4e73df;
  border-color: #4e73df;
}

.btn-primary:hover {
  background: #2e59d9;
  border-color: #2653d4;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(78, 115, 223, 0.3);
}

.btn-success {
  background: #1cc88a;
  border-color: #1cc88a;
}

.btn-success:hover {
  background: #17a673;
  border-color: #169b6b;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(28, 200, 138, 0.3);
}

.btn-danger {
  background: #e74a3b;
  border-color: #e74a3b;
}

.btn-danger:hover {
  background: #e02d1b;
  border-color: #d52a1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(231, 74, 59, 0.3);
}

.btn-warning {
  background: #f6c23e;
  border-color: #f6c23e;
  color: #fff;
}

.btn-warning:hover {
  background: #f4b619;
  border-color: #f4b30d;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(246, 194, 62, 0.3);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
}

/* Tables */
.table {
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
}

.table thead th {
  background: #f8f9fc;
  border-bottom: 2px solid #e3e6f0;
  color: #4e73df;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  padding: 1rem;
}

.table tbody tr {
  transition: background 0.2s;
}

.table tbody tr:hover {
  background: #f8f9fc;
}

.table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #e3e6f0;
}

/* Badges */
.badge {
  padding: 0.4rem 0.75rem;
  font-weight: 500;
  border-radius: 0.25rem;
}

/* Alerts */
.alert {
  border: none;
  border-radius: 0.5rem;
  border-right: 4px solid;
}

.alert-success {
  background: #d4edda;
  border-right-color: #1cc88a;
  color: #0f5132;
}

.alert-danger {
  background: #f8d7da;
  border-right-color: #e74a3b;
  color: #842029;
}

.alert-warning {
  background: #fff3cd;
  border-right-color: #f6c23e;
  color: #664d03;
}

.alert-info {
  background: #d1ecf1;
  border-right-color: #36b9cc;
  color: #055160;
}

/* Loading Spinner */
.spinner-border {
  border-right-color: transparent;
}

/* Page Title */
.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #5a5c69;
  margin-bottom: 1.5rem;
}

/* Search and Filter Section */
.search-section {
  background: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-pending {
  background: #fff3cd;
  color: #664d03;
}

.status-approved {
  background: #d4edda;
  color: #0f5132;
}

.status-rejected {
  background: #f8d7da;
  color: #842029;
}

/* Utilities */
.text-muted {
  color: #858796 !important;
}

.shadow-sm {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

.shadow {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12) !important;
}

.rounded-lg {
  border-radius: 0.5rem !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .page-title {
    font-size: 1.5rem;
  }

  .metric-card strong {
    font-size: 1.5rem;
  }

  .table {
    font-size: 0.9rem;
  }
}