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;
  background-color: #f5f7fb;
}

.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;
}

/* Statistics Cards Styling */
.statistics-card {
  transition: all 0.3s ease;
  border-radius: 12px !important;
  cursor: pointer;
}

.statistics-card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  transform: translateY(-5px);
}

.statistics-card-small {
  min-height: 300px;
}

.statistics-card-large {
  min-height: 350px;
}

.statistics-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
}

.statistics-icon-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.statistics-card h2 {
  font-size: 2.5rem;
  color: #212529;
}

.statistics-card h4 {
  font-size: 1.5rem;
  color: #212529;
}

.statistics-card h5 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #212529;
}

.statistics-card .card-title i {
  margin-right: 8px;
}

@media (max-width: 768px) {
  .statistics-card h2 {
    font-size: 2rem;
  }
  
  .statistics-card h4 {
    font-size: 1.25rem;
  }
  
  .statistics-icon {
    width: 60px;
    height: 60px;
  }
  
  .statistics-icon i {
    font-size: 1.5rem !important;
  }
  
  .statistics-card-small,
  .statistics-card-large {
    min-height: auto;
  }
}

/* Statistics V2 (Index2) */
.statistics-v2-wrapper {
  background: #f5f7fb;
  min-height: 100vh;
}

.statistics-v2-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.5rem;
}

.statistics-compact-card {
  position: relative;
  border-radius: 24px;
  padding: 1.75rem;
  color: #fff;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.statistics-compact-card::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  top: -60px;
  right: -40px;
}

.statistics-compact-card .card-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.statistics-compact-card .card-period {
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.statistics-compact-card .card-value {
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: 0;
}

.statistics-compact-card .card-label {
  margin: 0;
  opacity: 0.85;
}

.statistics-compact-card .card-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.statistics-compact-card .card-meta small {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.statistics-compact-card .card-meta strong {
  font-size: 1.25rem;
}

.statistics-compact-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  opacity: 0.9;
}

.statistics-compact-card .card-link:hover {
  opacity: 1;
}

.gradient-blue {
  background: linear-gradient(135deg, #5b7cfa, #7b5bfa);
}

.gradient-green {
  background: linear-gradient(135deg, #34d399, #059669);
}

.gradient-purple {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
}

/* Single Card Layout */
.statistics-single-card {
  border-radius: 32px;
  padding: 1.75rem;
  color: #fff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.statistics-single-card::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  top: -120px;
  right: -80px;
}

.statistics-single-card::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  bottom: -80px;
  left: -40px;
}

.statistics-single-card > * {
  position: relative;
  z-index: 1;
}

.single-card-body {
  padding: 0;
}

.stat-grid {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat-block {
  flex: 1;
  min-width: 280px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.row-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}

.row-values {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
}

.stat-pill {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 0.65rem 1rem;
  text-align: center;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.stat-pill span {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  opacity: 0.85;
}

.stat-pill strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

.single-card-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.25rem 1.75rem;
}

.single-card-toggle {
  background: transparent;
  border: none;
  padding: 0 0 1rem 0;
  font-size: 1.25rem;
  cursor: pointer;
}

.single-card-toggle:focus {
  box-shadow: none;
}

.single-card-toggle .toggle-icon {
  transition: transform 0.2s ease;
}

.single-card-meta small {
  display: block;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  opacity: 0.7;
}

.single-card-meta strong {
  font-size: 1.15rem;
}

.card-link {
  text-decoration: none;
  font-weight: 600;
}

.mode-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.gradient-unified {
  background: linear-gradient(135deg, #5b7cfa, #845ef7, #a855f7);
}

/* Dark Mode */
body.dark-mode {
  background-color: #0f172a;
  color: #e2e8f0;
}

body.dark-mode .statistics-v2-wrapper {
  background: #0f172a;
}

body.dark-mode .statistics-v2-header p,
body.dark-mode .statistics-v2-header h1,
body.dark-mode .statistics-v2-header span,
body.dark-mode .statistics-v2-header small {
  color: #e2e8f0;
}

body.dark-mode .statistics-single-card {
  background: linear-gradient(135deg, #1e1b4b, #312e81, #4338ca);
  box-shadow: 0 25px 45px rgba(15, 23, 42, 0.6);
}

body.dark-mode .single-card-meta {
  background: rgba(15, 23, 42, 0.6);
}

body.dark-mode .stat-block {
  background: rgba(15, 23, 42, 0.65);
}

body.dark-mode .stat-pill {
  background: rgba(15, 23, 42, 0.8);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

body.dark-mode .mode-toggle {
  background: #0f172a;
  color: #f8fafc;
}

body.dark-mode .single-card-toggle {
  color: #f8fafc;
}

body.dark-mode .badge.bg-gradient-info {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
}

@media (max-width: 768px) {
  .stat-grid {
    flex-direction: column;
  }

  .stat-block {
    width: 100%;
  }

  .statistics-single-card {
    padding: 1.5rem;
  }

  .row-values {
    flex-wrap: wrap;
  }

  .stat-pill {
    width: 100%;
  }

  .statistics-v2-header {
    text-align: center;
  }
}