/* ============================================ */

/* MANAGE CHILDREN PAGE STYLES */

/* ============================================ */

/* PAGE HEADER */

.page-header-admin {
  overflow: visible !important;
}

.page-header-admin .header-content-admin {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

/* FILTERS SECTION */

.filters-section {
  padding: 2rem 0;
  background: var(--background);
}

.filters-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 10px var(--shadow);
  border: 1px solid var(--border-color);
}

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.search-box .form-control {
  padding-left: 3rem;
}

.filter-stats {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.stat-badge {
  padding: 0.5rem 1rem;
  background: var(--accent);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.stat-badge strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* CHILDREN TABLE SECTION */

.children-table-section {
  padding: 0 0 4rem;
  background: var(--background);
}

.table-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 10px var(--shadow);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.table-card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
}

.btn-view {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-view:hover {
  background: var(--primary-solid);
  color: white;
  border-color: var(--primary-solid);
}

.btn-view.active {
  background: var(--primary-solid);
  color: white;
  border-color: var(--primary-solid);
}

/* TABLE VIEW */

.table-view,
.grid-view {
  display: none;
}

.table-view.active,
.grid-view.active {
  display: block;
}

.children-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.children-table thead {
  background: var(--accent);
  position: sticky;
  top: 0;
  z-index: 10;
}

.children-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.children-table td {
  padding: 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.children-table tbody tr {
  transition: all var(--transition-fast);
}

.children-table tbody tr:hover {
  background: var(--accent);
}

.children-table tbody tr.selected {
  background: rgba(46, 125, 50, 0.1);
}

.table-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 180px;
}

.table-user img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.table-user strong {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.table-user small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.funding-mini {
  min-width: 120px;
}

.funding-mini .progress {
  height: 6px;
  margin-bottom: 0.3rem;
}

.funding-mini small {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ACTION BUTTONS */

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-action {
  width: 35px;
  height: 35px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-action:hover {
  background: var(--primary-solid);
  color: white;
  border-color: var(--primary-solid);
  transform: translateY(-2px);
}

.btn-action.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
}

/* GRID VIEW */

.children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.child-grid-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.child-grid-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow-hover);
}

.child-grid-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.child-grid-body {
  padding: 1.25rem;
}

.child-grid-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.child-grid-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.child-grid-info div {
  margin-bottom: 0.25rem;
}

.child-grid-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.child-grid-actions .btn {
  flex: 1;
  font-size: 0.85rem;
  padding: 0.5rem;
}

/* PAGINATION */

.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--accent);
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pagination {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0.5rem 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.page-link:hover {
  background: var(--primary-solid);
  color: white;
  border-color: var(--primary-solid);
}

.page-item.active .page-link {
  background: var(--primary-solid);
  color: white;
  border-color: var(--primary-solid);
}

.page-item.disabled .page-link {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* BULK ACTIONS BAR */

.bulk-actions-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top: 2px solid var(--primary-solid);
  box-shadow: 0 -4px 20px var(--shadow);
  padding: 1rem 0;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform var(--transition-normal);
}

.bulk-actions-bar.active {
  transform: translateY(0);
}

.bulk-actions-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bulk-actions-content>span {
  font-weight: 600;
  color: var(--text-primary);
}

.bulk-buttons {
  display: flex;
  gap: 0.75rem;
}

/* CHECKBOXES */

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-solid);
}

/* MOBILE RESPONSIVE */

@media (max-width: 1200px) {
  .children-table {
    font-size: 0.85rem;
  }
}

@media (max-width: 1200px) {

  .children-table th,
  .children-table td {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 992px) {
  .header-actions {
    width: 100%;
  }
}

@media (max-width: 992px) {
  .header-actions .btn {
    flex: 1;
  }
}

@media (max-width: 992px) {
  .children-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .filters-card {
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .filter-stats {
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .stat-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

@media (max-width: 768px) {
  .table-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* Stack table on mobile */

@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
  }
}

@media (max-width: 768px) {
  .children-table {
    min-width: 800px;
  }
}

@media (max-width: 768px) {
  .table-pagination {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .bulk-actions-content {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .bulk-buttons {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .children-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .page-header-admin {
    padding: 1.5rem 0;
  }
}

@media (max-width: 576px) {
  .filters-section {
    padding: 1.5rem 0;
  }
}

@media (max-width: 576px) {
  .filters-card {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .search-box .form-control {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .table-card-header {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .table-title {
    font-size: 1.1rem;
  }
}

@media (max-width: 576px) {
  .btn-view {
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 576px) {
  .action-buttons {
    flex-direction: column;
  }
}

@media (max-width: 576px) {
  .bulk-buttons {
    flex-wrap: wrap;
  }
}

@media (max-width: 576px) {
  .bulk-buttons .btn {
    font-size: 0.8rem;
  }
}

/* DARK MODE */

[data-bs-theme="dark"] .filters-card,
.dark-mode .filters-card,
[data-bs-theme="dark"] .table-card,
.dark-mode .table-card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .children-table thead,
.dark-mode .children-table thead,
[data-bs-theme="dark"] .table-pagination,
.dark-mode .table-pagination {
  background: var(--accent);
}

[data-bs-theme="dark"] .children-table tbody tr:hover,
.dark-mode .children-table tbody tr:hover {
  background: var(--accent);
}

[data-bs-theme="dark"] .btn-view,
.dark-mode .btn-view,
[data-bs-theme="dark"] .btn-action,
.dark-mode .btn-action {
  background: var(--accent);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .page-link,
.dark-mode .page-link {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .bulk-actions-bar,
.dark-mode .bulk-actions-bar {
  background: var(--card-bg);
  border-top-color: var(--primary-solid);
}