/* Entities Index Styles */
.entities-index {
  width: 100%;
  max-width: none;
}

.entities-table-container {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-top: 2rem;
}

.entities-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.entities-table thead {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 2px solid #dee2e6;
}

.entities-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #495057;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #dee2e6;
}

.entities-table tbody tr {
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.15s ease-in-out;
}

.entities-table tbody tr:hover {
  background-color: #f8f9fa;
}

.entities-table tbody tr:last-child {
  border-bottom: none;
}

.entities-table td {
  padding: 1rem;
  vertical-align: middle;
  color: #212529;
}

.entity-name-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.entity-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.entity-initial-small {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
}

.entity-name {
  font-weight: 600;
  color: #212529;
  font-size: 1rem;
}

.classification-badge {
  display: inline-block;
  background: #e3f2fd;
  color: #1976d2;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: capitalize;
}

.accounts-count {
  font-weight: 600;
  color: #212529;
  font-size: 1rem;
}

.created-date {
  color: #6c757d;
  font-size: 0.875rem;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.table-actions .btn {
  padding: 0.5rem;
  font-size: 0.875rem;
  border-radius: 6px;
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid;
  transition: all 0.2s ease;
  font-weight: 500;
}

.table-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-actions .btn-outline-primary {
  color: #007bff;
  border-color: #007bff;
  background: transparent;
}

.table-actions .btn-outline-primary:hover {
  color: white;
  background: #007bff;
}

.table-actions .btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
  background: transparent;
}

.table-actions .btn-outline-secondary:hover {
  color: white;
  background: #6c757d;
}

.table-actions .btn-outline-danger {
  color: #dc3545;
  border-color: #dc3545;
  background: transparent;
}

.table-actions .btn-outline-danger:hover {
  color: white;
  background: #dc3545;
}

.table-actions .btn i {
  font-size: 0.875rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border: 2px dashed #dee2e6;
  border-radius: 12px;
  margin-top: 2rem;
}

.empty-state-icon {
  font-size: 4rem;
  color: #dee2e6;
  margin-bottom: 1.5rem;
}

.empty-state h3 {
  color: #495057;
  margin-bottom: 1rem;
  font-weight: 600;
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .entities-table-container {
    overflow-x: auto;
  }
  .entities-table {
    min-width: 600px;
  }
  .entities-table th,
  .entities-table td {
    padding: 0.75rem 0.5rem;
  }
  .entity-avatar-small {
    width: 35px;
    height: 35px;
  }
  .entity-initial-small {
    font-size: 0.875rem;
  }
  .table-actions {
    flex-direction: column;
    gap: 0.25rem;
  }
  .table-actions .btn {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .header .d-flex {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  .header .btn {
    align-self: flex-start;
  }
}

/* Entities Show Styles (partial, add the rest as needed) */
.entity-show {
  width: 100%;
  max-width: none;
}

.entity-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.breadcrumb {
  margin-bottom: 1.5rem;
}

.breadcrumb-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.breadcrumb-link:hover {
  color: white;
}

.entity-hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.entity-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.entity-initial-large {
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
}

.entity-info-main {
  flex: 1;
  min-width: 300px;
}

.entity-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.entity-actions-header {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.entity-actions-header .btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.875rem;
}

.entity-actions-header .btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.entity-actions-header .btn-outline-primary {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.entity-actions-header .btn-outline-primary:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.entity-actions-header .btn-outline-danger {
  background: rgba(220, 53, 69, 0.15);
  border-color: rgba(220, 53, 69, 0.3);
  color: #ff6b6b;
}

.entity-actions-header .btn-outline-danger:hover {
  background: rgba(220, 53, 69, 0.25);
  border-color: rgba(220, 53, 69, 0.5);
  color: white;
}

/* Stats Overview */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto 2rem auto;
  padding: 0 1rem;
}

.stat-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #dee2e6;
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.stat-icon i {
  color: white;
  font-size: 1.5rem;
}

.stat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #212529;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Notes Section */
.notes-section {
  max-width: 1200px;
  margin: 0 auto 2rem auto;
  padding: 0 1rem;
}

.notes-content {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.notes-content p {
  margin-bottom: 1rem;
  color: #495057;
  line-height: 1.6;
}

.notes-content p:last-child {
  margin-bottom: 0;
}

/* Account Card Styles for Entity Show View */
.accounts-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2.5rem 1rem;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #212529;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title i {
  color: #667eea;
}

.section-subtitle {
  color: #6c757d;
  font-size: 1rem;
  margin: 0;
}

.section-actions {
  flex-shrink: 0;
}

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

/* Entity Show Page Account Cards - More Specific Selectors */
.entity-show .accounts-section .account-card {
  background: white !important;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  position: relative;
}

.entity-show .accounts-section .account-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  border-color: #dee2e6;
}

.entity-show .accounts-section .account-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f3f4;
  background: transparent !important;
}

.entity-show .accounts-section .account-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  margin-left: 0.25rem;
}

.entity-show .accounts-section .account-icon i {
  color: white;
  font-size: 1.25rem;
}

.entity-show .accounts-section .account-info {
  flex: 1;
  min-width: 0;
  padding-top: 0.125rem;
}

.entity-show .accounts-section .account-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #212529 !important;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.entity-show .accounts-section .account-institution {
  color: #6c757d !important;
  font-size: 0.875rem;
  font-weight: 500;
}

.accounts-section .account-details {
  margin-bottom: 1.75rem;
}

.accounts-section .account-balance {
  margin-bottom: 1.25rem;
}

.accounts-section .balance-label {
  display: block;
  font-size: 0.75rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.375rem;
  font-weight: 600;
}

.accounts-section .balance-amount {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: #212529;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.accounts-section .account-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f3f4;
}

.accounts-section .account-type {
  background: #e8f5e8;
  color: #28a745;
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.25px;
}

.accounts-section .account-updated {
  color: #6c757d;
  font-size: 0.75rem;
  font-weight: 500;
}

.accounts-section .account-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f3f4;
}

.accounts-section .account-actions .btn {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.accounts-section .account-actions .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.accounts-section .account-actions .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.accounts-section .account-actions .btn-outline-danger {
  color: #dc3545;
  border: 1px solid #dc3545;
  background: transparent;
}

.accounts-section .account-actions .btn-outline-danger:hover {
  background: #dc3545;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.empty-accounts {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border: 2px dashed #dee2e6;
  border-radius: 12px;
}

.empty-icon {
  font-size: 4rem;
  color: #dee2e6;
  margin-bottom: 1.5rem;
}

.empty-accounts h3 {
  color: #495057;
  margin-bottom: 1rem;
  font-weight: 600;
}

.empty-accounts p {
  color: #6c757d;
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .entity-hero {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  .entity-avatar-large {
    width: 80px;
    height: 80px;
  }
  .entity-initial-large {
    font-size: 2rem;
  }
  .entity-title {
    font-size: 2rem;
  }
  .entity-meta {
    justify-content: center;
  }
  .entity-actions-header {
    justify-content: center;
  }
  .stats-overview {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .section-header-content {
    flex-direction: column;
    align-items: stretch;
  }
  .section-actions {
    align-self: flex-start;
  }
  .accounts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .account-card {
    padding: 1rem;
  }
  .account-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  .account-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .entity-header {
    padding: 1.5rem 0;
  }
  .entity-title {
    font-size: 1.75rem;
  }
  .stat-card {
    padding: 1rem;
  }
  .stat-icon {
    width: 50px;
    height: 50px;
  }
  .stat-icon i {
    font-size: 1.25rem;
  }
  .stat-number {
    font-size: 1.5rem;
  }
}