/* Redesigned Profile CSS - Sleek Two-column Layout */

:root {
  --accent: #4710EB;
  --accent-dark: #256329;
  --muted: #6b7280;
  --bg: #f6f8f9;
  --card: #ffffff;
}

/* Container */
.profile-dashboard {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 20px;
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
}

.profile-card.compact {
  background: var(--card);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  text-align: center;
  height: fit-content;
}

/* Main content area - this will scroll */
.profile-main {
  min-height: 280px;
  overflow-y: auto;
  height: calc(100vh - 40px);
  padding-right: 10px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: #374151;
  font-weight: var(--font-weight-semibold);
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: var(--font-size-base);
}

.tab-btn.active {
  background: linear-gradient(180deg, rgba(46, 125, 50, 0.08), rgba(46, 125, 50, 0.04));
  color: var(--accent-dark);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.04);
}

.tab-panels .tab-panel {
  display: none;
}

.tab-panels .tab-panel.active {
  display: block;
}

/* Avatar */
.avatar-wrap {
  position: relative;
  display: inline-block;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #4710EB);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  margin: 0 auto 12px;
}

.btn-icon {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #e6eef1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Header text */
#profile-name {
  margin: 8px 0 4px;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: #0f172a;
}

.muted {
  color: var(--muted);
  font-size: var(--font-size-sm);
}

/* Contact */
.contact {
  margin-top: 12px;
  color: #374151;
  font-size: var(--font-size-base);
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: fit-content;
  justify-content: center;
}

.contact i {
  color: var(--accent);
  min-width: 18px;
  text-align: center;
}

/* Actions */
.profile-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(207, 232, 214, 0.8);
  color: var(--accent-dark);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

.btn-danger {
  background: #fff;
  border: 1px solid #ffd6d6;
  color: #b91c1c;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

/* Cards and metrics */
.card {
  background: var(--card);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

/* Children list */
.children-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.child-card-elegant {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.child-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #4710EB);
  font-size: 20px;
}

.child-info h4 {
  margin: 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

.child-details {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: var(--font-size-sm);
}

.child-actions {
  margin-left: auto;
}

/* Delete button */
.delete-child-btn {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  color: #e53e3e;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  top: -4px;
  right: 4px;
  font-size: var(--font-size-base);
}

.delete-child-btn:hover {
  background: #fed7d7;
  transform: scale(1.1);
}

.delete-child-btn:active {
  transform: scale(0.95);
}

/* Quick Actions */
.quick-actions {
  margin: 15px 0;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 6px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 6px;
  font-weight: var(--font-weight-semibold);
  transition: all 0.2s;
  min-height: 50px;
  font-size: var(--font-size-sm);
}

.action-btn i {
  font-size: 0.8rem;
  margin-bottom: 3px;
}

.action-btn span {
  font-size: 0.7rem;
}

.action-btn:active {
  transform: scale(0.98);
}

/* Children Payment List */
.payment-children-list {
  margin: 20px 0;
}

.payments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.child-payment-card {
  display: flex;
  flex-direction: row;
  padding: 10px 14px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 80px;
  align-items: center;
}

.child-payment-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.child-payment-header {
  display: flex;
  align-items: center;
  flex: 1;
}

.child-payment-card .child-avatar {
  width: 36px;
  height: 36px;
  font-size: 15px;
  margin-right: 10px;
}

.child-payment-info {
  flex: 1;
}

.child-payment-info h4 {
  margin: 0 0 4px 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

.child-payment-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.child-payment-amount {
  font-weight: var(--font-weight-bold);
  color: #d32f2f;
  font-size: var(--font-size-md);
  text-align: right;
  padding-left: 12px;
  min-width: 90px;
}

/* Payment History */
.payment-history-section {
  margin: 20px 0;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
}

.history-item {
  display: flex;
  padding: 10px;
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  border-left: 3px solid #4710EB;
}

.history-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8f5e9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.history-item-icon i {
  color: #4710EB;
}

.history-item-details {
  flex: 1;
}

.history-item-title {
  font-weight: var(--font-weight-semibold);
  margin-bottom: 4px;
  color: #1a1a1a;
  font-size: var(--font-size-base);
}

.history-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.history-item-amount {
  font-weight: var(--font-weight-bold);
  color: #4710EB;
  font-size: var(--font-size-base);
}

/* Payment Items List */
/* Payment Items List */
/* Payment Items List */
.payment-items-list {
  max-height: none;
  overflow-y: auto;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  /* Further reduced padding for compact height */
  background-color: #ffffff;
  border-radius: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  min-height: 50px;
  /* Force reduced height */
}

.payment-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.06);
}

/* Theme Borders & Accents */
.payment-item.theme-blue {
  border-left: 4px solid #2196f3;
  background: linear-gradient(to right, #e3f2fd50, #fff);
}

.payment-item.theme-yellow {
  border-left: 4px solid #ffc107;
  background: linear-gradient(to right, #fff8e150, #fff);
}

.payment-item.theme-purple {
  border-left: 4px solid #9c27b0;
  background: linear-gradient(to right, #f3e5f550, #fff);
}

.payment-item.theme-red {
  border-left: 4px solid #f44336;
  background: linear-gradient(to right, #ffebee50, #fff);
}

.payment-item.theme-teal {
  border-left: 4px solid #009688;
  background: linear-gradient(to right, #e0f2f150, #fff);
}

.payment-item.theme-green {
  border-left: 4px solid #4710EB;
  background: linear-gradient(to right, #e8f5e950, #fff);
}

.payment-item.theme-orange {
  border-left: 4px solid #ff9800;
  background: linear-gradient(to right, #fff3e050, #fff);
}

.payment-item.theme-pink {
  border-left: 4px solid #e91e63;
  background: linear-gradient(to right, #fce4ec50, #fff);
}

.payment-item.theme-indigo {
  border-left: 4px solid #3f51b5;
  background: linear-gradient(to right, #e8eaf650, #fff);
}

.payment-item.theme-default {
  border-left: 4px solid #607d8b;
}

.payment-item.theme-cyan {
  border-left: 4px solid #00bcd4;
  background: linear-gradient(to right, #e0f7fa50, #fff);
}

.payment-item.theme-brown {
  border-left: 4px solid #795548;
  background: linear-gradient(to right, #efebe950, #fff);
}

.payment-item.theme-slate {
  border-left: 4px solid #607d8b;
  background: linear-gradient(to right, #eceff150, #fff);
}

.payment-item.theme-deep-orange {
  border-left: 4px solid #ff5722;
  background: linear-gradient(to right, #fbe9e750, #fff);
}

.payment-item.theme-violet {
  border-left: 4px solid #673ab7;
  background: linear-gradient(to right, #ede7f650, #fff);
}

.payment-item.theme-gold {
  border-left: 4px solid #ffd700;
  background: linear-gradient(to right, #fffde750, #fff);
}

/* Icon Styles */
.payment-item-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.payment-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.theme-blue .payment-item-icon {
  background: #e3f2fd;
  color: #1976d2;
}

.theme-yellow .payment-item-icon {
  background: #fff8e1;
  color: #ffa000;
}

.theme-purple .payment-item-icon {
  background: #f3e5f5;
  color: #7b1fa2;
}

.theme-red .payment-item-icon {
  background: #ffebee;
  color: #d32f2f;
}

.theme-teal .payment-item-icon {
  background: #e0f2f1;
  color: #00796b;
}

.theme-green .payment-item-icon {
  background: #e8f5e9;
  color: #0055EF;
}

.theme-orange .payment-item-icon {
  background: #fff3e0;
  color: #f57c00;
}

.theme-pink .payment-item-icon {
  background: #fce4ec;
  color: #c2185b;
}

.theme-indigo .payment-item-icon {
  background: #e8eaf6;
  color: #303f9f;
}

.theme-cyan .payment-item-icon {
  background: #e0f7fa;
  color: #0097a7;
}

.theme-brown .payment-item-icon {
  background: #efebe9;
  color: #5d4037;
}

.theme-slate .payment-item-icon {
  background: #eceff1;
  color: #455a64;
}

.theme-deep-orange .payment-item-icon {
  background: #fbe9e7;
  color: #d84315;
}

.theme-violet .payment-item-icon {
  background: #ede7f6;
  color: #512da8;
}

.theme-gold .payment-item-icon {
  background: #fffde7;
  color: #fbc02d;
}

.theme-default .payment-item-icon {
  background: #eceff1;
  color: #455a64;
}

.payment-item-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
}

.payment-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
  color: #374151;
  /* Default dark grey */
}

/* Rendered classes used by payments.js in the modal (scoped so generic names like
   .item-title / .item-meta from other stylesheets can never override them) */
.payment-item .item-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
  color: #374151;
}

.payment-item .item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.7rem;
  color: #9ca3af;
}

/* Colored Titles based on Theme */
/* Colored Titles & Amounts based on Theme */
.theme-blue .payment-item-title,
.theme-blue .payment-item-amount {
  color: #1565c0;
}

.theme-yellow .payment-item-title,
.theme-yellow .payment-item-amount {
  color: #f57f17;
}

.theme-purple .payment-item-title,
.theme-purple .payment-item-amount {
  color: #7b1fa2;
}

.theme-red .payment-item-title,
.theme-red .payment-item-amount {
  color: #d32f2f;
}

.theme-teal .payment-item-title,
.theme-teal .payment-item-amount {
  color: #00796b;
}

.theme-green .payment-item-title,
.theme-green .payment-item-amount {
  color: #4710EB;
}

.theme-orange .payment-item-title,
.theme-orange .payment-item-amount {
  color: #e65100;
}

.theme-pink .payment-item-title,
.theme-pink .payment-item-amount {
  color: #c2185b;
}

.theme-indigo .payment-item-title,
.theme-indigo .payment-item-amount {
  color: #303f9f;
}

.theme-cyan .payment-item-title,
.theme-cyan .payment-item-amount {
  color: #00838f;
}

.theme-brown .payment-item-title,
.theme-brown .payment-item-amount {
  color: #5d4037;
}

.theme-slate .payment-item-title,
.theme-slate .payment-item-amount {
  color: #455a64;
}

.theme-deep-orange .payment-item-title,
.theme-deep-orange .payment-item-amount {
  color: #bf360c;
}

.theme-violet .payment-item-title,
.theme-violet .payment-item-amount {
  color: #512da8;
}

.theme-gold .payment-item-title,
.theme-gold .payment-item-amount {
  color: #f9a825;
}

.payment-item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.7rem;
  /* Much smaller font */
  color: #0b295e;
}

.badge-session {
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 3px;
  color: #6b7280;
  font-weight: 500;
  font-size: 0.65rem;
}

.badge-term {
  background: #fdf2f8;
  /* Soft pinkish background */
  padding: 1px 6px;
  border-radius: 3px;
  color: #db2777;
  /* Pink text */
  font-weight: 500;
  font-size: 0.65rem;
  border: 1px solid #fce7f3;
}

.item-class {
  color: #9ca3af;
  font-size: 0.7rem;
}

/* Right Side Styles */
.payment-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.payment-item-amount {
  font-weight: 800;
  /* Extra Bold */
  font-size: 1.1rem;
  /* Slightly larger */
  color: #1f2937;
  /* Fallback */
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
  letter-spacing: -0.5px;
}

.payment-item-checkbox {
  margin-right: 0;
  transform: scale(1.2);
}

/* Paid Overlay */
.is-paid {
  opacity: 0.7;
  background: #f8f9fa !important;
  border-left-color: #ccc !important;
}

.is-paid .payment-item-icon {
  background: #eee !important;
  color: #999 !important;
}

.paid-badge-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-10deg);
  border: 3px solid #4710EB;
  color: #4710EB;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 1.2rem;
  opacity: 0.3;
  pointer-events: none;
}

/* Payment Breakdown Modal */
.payment-modal {
  width: 80%;
  height: auto;
  max-height: 90%;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

.payment-modal h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.payment-breakdown-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow: auto;
  padding: 0 16px;
}

.payment-items-list {
  max-height: none;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 8px;
  flex: 1;
}

.payment-items-list h4 {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 10px;
}

.child-info-header {
  text-align: center;
  padding: 16px 0;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 16px;
}

.child-info-header h3 {
  margin: 0 0 6px 0;
  color: #1a1a1a;
  font-size: 1.1rem;
  font-weight: var(--font-weight-semibold);
}

.child-info-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.payment-summary {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.summary-row.fee-row {
  color: #000;
}

.summary-row.total {
  font-weight: var(--font-weight-bold);
  font-size: 1rem;
  border-top: 1px solid #e9ecef;
  padding-top: 6px;
  margin-top: 6px;
}



.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px;
  border-top: 1px solid #e9ecef;
  margin-top: 16px;
  flex-shrink: 0;
}

.modal-footer button {
  flex: 1;
  min-width: 80px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Activity list */
.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .profile-dashboard {
    grid-template-columns: 1fr;
    padding: 14px;
    height: auto;
    overflow: visible;
  }

  .profile-main {
    height: auto;
    overflow-y: visible;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .contact {
    align-items: center;
  }

  .modal-footer {
    flex-direction: row;
  }

  .modal-footer button {
    width: auto;
    margin-bottom: 0;
  }

  .action-buttons {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .payments-grid {
    grid-template-columns: 1fr;
  }

  .history-list {
    grid-template-columns: 1fr;
  }
}

/* Small helpers */
.hidden {
  display: none !important;
}

/* Mobile-specific responsive styles */
@media (max-width: 480px) {
  .profile-dashboard {
    padding: 12px 8px;
    grid-template-columns: 1fr;
    height: auto;
  }

  .profile-card.compact {
    padding: 16px 12px;
    margin-bottom: 16px;
  }

  .profile-avatar {
    width: 80px;
    height: 80px;
    font-size: 28px;
    margin: 0 auto 10px;
  }

  .btn-icon {
    width: 30px;
    height: 30px;
    right: -3px;
    bottom: -3px;
  }

  #profile-name {
    font-size: var(--font-size-md);
    margin: 6px 0 2px;
  }

  .contact {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .contact-item {
    width: 100%;
    justify-content: flex-start;
    padding: 6px 0;
    min-width: auto;
    font-size: var(--font-size-sm);
  }

  .tabs {
    flex-direction: row;
    gap: 4px;
    margin-bottom: 12px;
  }

  .tab-btn {
    padding: 12px 16px;
    font-size: var(--font-size-md);
    width: auto;
    justify-content: center;
    flex: 1;
  }

  .profile-main {
    height: auto;
    padding-right: 0;
  }

  .tab-panels .tab-panel {
    display: none;
  }

  .tab-panels .tab-panel.active {
    display: block;
  }

  .child-card-elegant {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .child-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .child-actions {
    margin-left: 0;
    align-self: flex-end;
  }

  #add-child-btn {
    width: 100%;
    margin-bottom: 12px !important;
  }

  .card {
    padding: 14px;
  }

  .children-grid {
    gap: 8px;
  }
}

/* Payment History Styles */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-item-icon {
  font-size: 1.2rem;
  color: #4710EB;
  /* Green */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #e8f5e9;
  border-radius: 50%;
}

.history-item-details {
  display: flex;
  flex-direction: column;
}

.history-item-title {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.history-item-subtitle {
  font-size: 0.85rem;
  color: #666;
}

.history-item-meta {
  font-size: 0.75rem;
  color: #999;
  margin-top: 2px;
}

.history-item-right {
  display: flex;
  align-items: center;
  /* Vertically centralized by flex-direction defaults of parent .history-item which has align-items: center */
}

.history-amount {
  font-weight: 800;
  /* Weighty */
  font-size: 1.1rem;
  color: #1f2937;
}

/* Mobile Compaction for Payment Breakdown */
@media (max-width: 480px) {
  .payment-modal {
    width: 95% !important;
    padding: 1rem !important;
  }

  .payment-items-list {
    padding: 8px !important;
    gap: 6px !important;
  }

  .payment-item {
    padding: 4px 8px !important;
    min-height: 44px !important;
  }

  .payment-item-left {
    gap: 8px !important;
    min-width: 0 !important;
  }

  .payment-item-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 1rem !important;
  }

  .payment-item-details {
    overflow: hidden !important;
  }

  .payment-item-title {
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }

  .payment-item-meta {
    font-size: 0.4rem !important;
    gap: 3px !important;
  }

  .badge-session,
  .badge-term {
    padding: 0 4px !important;
    font-size: 0.55rem !important;
  }

  .payment-item-right {
    gap: 6px !important;
  }

  .payment-item-amount {
    font-size: 0.9rem !important;
  }

  .payment-item-checkbox {
    transform: scale(1) !important;
  }

  .modal-footer {
    padding: 10px 0 !important;
    gap: 5px !important;
  }

  .modal-footer button {
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
    min-width: auto !important;
    flex: 1 !important;
  }
}
/* ---------------------------------------------------------------------------
 * Fee selection (parent portal)
 * ------------------------------------------------------------------------- */

/* Premium fee-select child card */
.child-card-elegant.fee-select-card {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f6ff 100%);
  border: 1px solid rgba(71, 16, 235, 0.10);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.child-card-elegant.fee-select-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #4710EB, #7c5ef8, #0055EF);
  opacity: 0.85;
}

.child-card-elegant.fee-select-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(71, 16, 235, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
  border-color: rgba(71, 16, 235, 0.28);
}

.child-card-elegant.fee-select-card:active {
  transform: translateY(-1px) scale(0.995);
}

.child-card-elegant.fee-select-card:focus-visible {
  outline: 2px solid #4710EB;
  outline-offset: 2px;
}

/* Avatar with live status dot */
.cc-avatar {
  position: relative;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  background: linear-gradient(135deg, #4710EB 0%, #7c5ef8 100%);
  box-shadow: 0 6px 14px rgba(71, 16, 235, 0.35);
}

.cc-status-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 2.5px solid #fff;
}

.cc-status-dot.is-active {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

/* Body */
.cc-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cc-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.cc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cc-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.cc-meta-item i {
  color: #4710EB;
  font-size: 0.7rem;
}

.cc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cc-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.cc-balance.due {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.cc-balance.clear {
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.cc-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4710EB;
  padding: 5px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(71, 16, 235, 0.10), rgba(124, 94, 248, 0.12));
  border: 1px solid rgba(71, 16, 235, 0.18);
  transition: background 0.2s ease, transform 0.2s ease;
}

.cc-cta-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4710EB;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  transition: transform 0.2s ease;
}

.child-card-elegant.fee-select-card:hover .cc-cta {
  background: linear-gradient(135deg, rgba(71, 16, 235, 0.16), rgba(124, 94, 248, 0.18));
}

.child-card-elegant.fee-select-card:hover .cc-cta-icon {
  transform: translateX(2px);
}

/* Delete button (top-right, appears on hover) */
.cc-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 245, 245, 0.9);
  color: #e53e3e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.child-card-elegant.fee-select-card:hover .cc-delete,
.child-card-elegant.fee-select-card:focus-within .cc-delete {
  opacity: 1;
}

.cc-delete:hover {
  background: #fed7d7;
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .cc-delete {
    opacity: 0.55;
  }
}

@media (max-width: 520px) {
  .child-card-elegant.fee-select-card {
    padding: 14px 14px;
    gap: 10px;
  }
  .cc-avatar {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }
  .cc-cta span:first-child {
    display: none;
  }
  .cc-cta {
    padding: 5px 9px;
  }
}

/* Compulsory / Optional / Countable badges */
.item-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.fee-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
}

.badge-compulsory {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-optional {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.badge-countable {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.badge-locked {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

/* Quantity stepper for countable items */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
}

.qty-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.payment-qty-input {
  width: 58px;
  padding: 5px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  text-align: center;
  background: #fff;
  transition: all 0.2s;
}

.payment-qty-input:focus {
  border-color: #4710EB;
  box-shadow: 0 0 0 3px rgba(71, 16, 235, 0.1);
  outline: none;
}

/* Paid items are locked and dimmed */
.payment-item.is-paid {
  opacity: 0.65;
  filter: grayscale(0.4);
}

/* Compulsory unpaid items get a subtle required highlight */
.payment-item.is-compulsory {
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.18) inset, 0 4px 6px rgba(0, 0, 0, 0.02);
}

@media (max-width: 480px) {
  .payment-qty-input {
    width: 48px;
    padding: 4px 6px;
    font-size: 0.9rem;
  }
}

/* Read-only quantity chip (payment breakdown — quantity comes from the selection collection) */
.qty-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 4px 10px;
  margin-right: 4px;
  white-space: nowrap;
}

/* Selection modal hint */
.selection-hint {
  font-size: 0.8rem;
  color: #64748b;
  background: #f8f6ff;
  border: 1px solid rgba(71, 16, 235, 0.10);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0 14px;
  line-height: 1.5;
}

.selection-hint strong {
  color: #4710EB;
}

/* ==========================================================================
   Select Fees modal — decluttered redesign (scoped to the fee-selection modal
   only; the payment breakdown modal keeps its existing layout).
   ========================================================================== */
#payment-selection-modal .modal-content.payment-modal {
  width: 92%;
  max-width: 480px;
  border-radius: 18px;
  padding: 22px 20px 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

#payment-selection-modal h2 {
  font-size: 1.2rem;
  margin: 0 0 10px;
}

/* Compact, left-aligned student header */
#payment-selection-modal .child-info-header {
  text-align: left;
  padding: 0 2px 12px;
  border-bottom: 1px solid #eef0f4;
  margin-bottom: 12px;
}

#payment-selection-modal .child-info-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#payment-selection-modal .child-info-header p {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Shorter, quieter hint */
#payment-selection-modal .selection-hint {
  font-size: 0.78rem;
  color: #6b7280;
  background: #f7f8fa;
  border: 1px solid #eceef2;
  border-radius: 10px;
  padding: 9px 12px;
  margin: 0 0 12px;
  line-height: 1.45;
}

/* Flat item list — no box-in-box */
#payment-selection-modal .payment-breakdown-container {
  padding: 0;
}

#payment-selection-modal .payment-items-list {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  gap: 0;
}

/* Decluttered rows: no accent bar, no tinted gradient, divider-separated */
#payment-selection-modal .payment-item {
  gap: 10px;
  padding: 12px 2px;
  min-height: 0;
  background: #fff;
  border: none;
  border-bottom: 1px solid #f0f2f5;
  border-radius: 0;
  box-shadow: none;
}

#payment-selection-modal .payment-item:last-child {
  border-bottom: none;
}

#payment-selection-modal .payment-item:hover {
  transform: none;
  box-shadow: none;
  background: #fafbfc;
}

/* Smaller icon tile, theme color kept */
#payment-selection-modal .payment-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1.05rem;
}

/* Title + required chip on one line */
#payment-selection-modal .payment-item .item-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#payment-selection-modal .payment-item .item-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0;
  font-size: 0.92rem;
}

#payment-selection-modal .payment-item .item-flags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

#payment-selection-modal .payment-item .fee-badge {
  font-size: 0.58rem;
  padding: 2px 7px;
  letter-spacing: 0.03em;
}

/* Only the states that matter: required + locked. Optional / countable are
   obvious from the unchecked box and the quantity field, so their chips are
   dropped to reduce visual noise. */
#payment-selection-modal .payment-item .badge-optional,
#payment-selection-modal .payment-item .badge-countable {
  display: none;
}

/* Meta as one quiet line with dot separators instead of three colored chips */
#payment-selection-modal .payment-item .item-meta {
  gap: 0;
  font-size: 0.72rem;
  color: #9aa3b2;
}

#payment-selection-modal .payment-item .badge-session,
#payment-selection-modal .payment-item .badge-term {
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  font-weight: 500;
  font-size: inherit;
  color: inherit;
}

#payment-selection-modal .payment-item .item-session::after,
#payment-selection-modal .payment-item .item-term::after {
  content: '·';
  margin: 0 6px;
  color: #d4d7dd;
}

/* Right side: compact qty, bold amount, brand-accented controls */
#payment-selection-modal .payment-item-right {
  gap: 10px;
}

#payment-selection-modal .payment-item .qty-stepper {
  gap: 5px;
  margin-right: 0;
}

#payment-selection-modal .payment-qty-input {
  width: 46px;
  padding: 3px 6px;
  border-radius: 8px;
  border-color: #e5e7eb;
  font-size: 0.9rem;
}

#payment-selection-modal .payment-item .item-amount {
  font-size: 1.02rem;
  font-weight: 800;
  color: #1f2937;
  white-space: nowrap;
}

#payment-selection-modal .payment-item input[type="checkbox"],
#payment-selection-modal .payment-qty-input {
  accent-color: #4710EB;
}

/* Paid rows stay clearly dimmed but keep the new flat look */
#payment-selection-modal .payment-item.is-paid,
#payment-selection-modal .payment-item.is-compulsory {
  box-shadow: none;
}

/* Footer: full-width, comfortable touch targets */
#payment-selection-modal .modal-footer {
  display: flex;
  justify-content: stretch;
  gap: 10px;
  margin-top: 14px;
  padding: 14px 0 0;
  border-top: 1px solid #eef0f4;
}

#payment-selection-modal .modal-footer button {
  flex: 1;
  min-height: 46px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  border-radius: 10px;
}
