/* ===== RESET AND BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  overflow-x: hidden;
  background: var(--bg-neutral);
}

/* ===== CONTENT AREA ===== */
.content-wrapper {
  padding: 25px;
}

/* ===== DASHBOARD STATS - ENHANCED CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.1;
  transform: translate(30px, -30px);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stat-content {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
  z-index: 1;
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--text-white);
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-icon.users {
  background: linear-gradient(135deg, var(--bg-cards));
}
.stat-icon.revenue {
  background: linear-gradient(135deg, var(--bg-cards));
}
.stat-icon.projects {
  background: linear-gradient(135deg, var(--bg-cards));
}
.stat-icon.tasks {
  background: linear-gradient(135deg, var(--bg-cards));
}

.stat-info {
  flex: 1;
  text-align: center;
}

.stat-info h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text-primary);
  line-height: 1;
}

.stat-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ===== IMPORTANT MEMBERS TABLE - EXACT DESIGN FROM REFERENCE ===== */
.members-section {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-top: 30px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--bg-neutral);
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.section-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  background: var(--bg-primary);
  color: var(--text-white);
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.action-btn:hover {
  background: var(--bg-darker);
  transform: translateY(-2px);
}

.action-btn.secondary {
  background: var(--bg-neutral);
  color: var(--text-primary);
}

.action-btn.secondary:hover {
  background: var(--bg-light);
}

.table-container {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
}

.table thead th {
  background-color: var(--bg-primary);
  color: var(--text-white);
  font-weight: 500;
  padding: 12px 15px;
  text-align: left;
  border: none;
  white-space: nowrap;
}

.table tbody tr {
  border-bottom: 1px solid var(--bg-neutral);
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  background-color: var(--bg-light);
}

.table tbody td {
  padding: 12px 15px;
  vertical-align: middle;
}

.table tbody tr:last-child {
  border-bottom: none;
}

.person-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 10%;
  object-position: center;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-action {
  padding: 8px 10px;
  font-size: 0.9rem;
  border-radius: 4px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-edit {
  background-color: var(--bg-secondary);
  color: var(--text-white);
}

.btn-edit:hover {
  background-color: #a9ab5c;
}

.btn-delete {
  background-color: #dc3545;
  color: var(--text-white);
}

.btn-delete:hover {
  background-color: #c82333;
}

.timestamp {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ===== MOBILE CARD VIEW FOR TABLE ===== */
.mobile-card {
  display: none;
  background: var(--bg-white);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-card-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--bg-neutral);
}

.mobile-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-card-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.mobile-card-value {
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .content-wrapper {
    padding: 20px 15px;
  }

  .section-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .section-actions {
    width: 100%;
    justify-content: flex-start;
  }

  /* Hide table on mobile */
  .table-container {
    display: none;
  }

  /* Show mobile cards */
  .mobile-card {
    display: block;
  }

  .person-img {
    width: 45px;
    height: 45px;
  }

  .stat-card {
    padding: 15px;
    min-height: 100px;
  }

  .stat-icon {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }

  .stat-info h3 {
    font-size: 1.5rem;
  }

  .section-header h2 {
    font-size: 1.3rem;
  }
}

@media (max-width: 576px) {
  .content-wrapper {
    padding: 15px 10px;
  }

  .action-btn {
    padding: 8px 15px;
    font-size: 0.85rem;
  }

  .mobile-card {
    padding: 12px;
  }

  .mobile-card-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  .person-img {
    width: 40px;
    height: 40px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-content {
    gap: 10px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .stat-info h3 {
    font-size: 1.3rem;
  }

  .stat-info p {
    font-size: 0.8rem;
  }
}

/* ===== TABLET SPECIFIC STYLES ===== */
@media (min-width: 769px) and (max-width: 992px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .content-wrapper {
    padding: 20px;
  }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 500px) and (orientation: landscape) {
  .content-wrapper {
    padding: 15px;
  }

  .stat-card {
    min-height: 90px;
    padding: 15px;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-success {
  color: #388e3c;
}
.text-warning {
  color: #ff8f00;
}
.text-danger {
  color: #d32f2f;
}
.text-info {
  color: #0288d1;
}

.mb-0 {
  margin-bottom: 0;
}
.mt-20 {
  margin-top: 20px;
}
.mb-20 {
  margin-bottom: 20px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* ===== TOUCH DEVICE STYLES ===== */
@media (hover: none) {
  .btn-action:active {
    transform: scale(0.95);
  }
}

/* ===== SIMPLE IMAGE MODAL STYLES ===== */
.image-modal-simple {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.image-modal-simple.show {
  display: flex;
}

.modal-img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  animation: zoomIn 0.4s ease;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.close-modal-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.close-modal-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Make person images clickable */
.person-img {
  cursor: pointer !important;
  transition: transform 0.3s ease !important;
}

.person-img:hover {
  transform: scale(1.05) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modal-img {
    max-width: 95%;
    max-height: 95vh;
  }

  .close-modal-btn {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .modal-img {
    max-width: 100%;
    max-height: 100vh;
  }

  .close-modal-btn {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

/* Add this to your existing CSS to make the name more attractive */
.mobile-person-card-header h5 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.mobile-person-card-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.mobile-person-card-header .text-muted {
  font-size: 12px;
}

@media (max-width: 576px) {
  .mobile-person-card-header h5 {
    font-size: 15px;
  }

  .mobile-person-card-header p {
    font-size: 13px;
  }
}
