/* Shop Table Styles */
.shop-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-avatar {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
}

.shop-details h6 {
  margin: 0 0 4px 0;
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
}

.shop-details .shop-id {
  font-size: 12px;
  color: #6c757d;
  font-family: "Courier New", monospace;
  margin: 0 0 2px 0;
}

.shop-details .shop-owner {
  font-size: 12px;
  color: #495057;
  margin: 0;
}

/* Certification Badges */
.certification-badges {
  flex-direction: column;
  gap: 16px;
}

.certification-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  min-width: 90px;
}

.certification-badge--verified {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.certification-badge--partner {
  background: #ffeaa7;
  color: #d63031;
  border: 1px solid #fdcb6e;
}

.certification-badge--none {
  background: #f8f9fa;
  color: #6c757d;
  border: 1px solid #dee2e6;
}

/* Region Badges */
.region-badge {
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 500;
}

.region-badge--north {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
}

.region-badge--central {
  background: #fff3e0;
  color: #ef6c00;
  border: 1px solid #ffcc02;
}

.region-badge--south {
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #e1bee7;
}

/* Status Badges */
.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge--active {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-badge--inactive {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-badge--suspended {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* Action Buttons */
.shop-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.shop-actions .btn {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-view {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
}

.btn-view:hover {
  background: #bbdefb;
  color: #0d47a1;
}

.btn-edit {
  background: #fff3e0;
  color: #ef6c00;
  border: 1px solid #ffcc02;
}

.btn-edit:hover {
  background: #ffcc02;
  color: #e65100;
}

.btn-certify {
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #e1bee7;
}

.btn-certify:hover {
  background: #e1bee7;
  color: #4a148c;
}

.action-dropdown {
  position: relative;
  z-index: 1000;
}

/* Dropdown Actions */
.action-dropdown .dropdown-toggle {
  background: white;
  border: 1px solid #dee2e6;
  color: #495057;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  opacity: 1 !important; /* Fix opacity issue */
  transition: all 0.2s ease;
}

.action-dropdown .dropdown-toggle:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  opacity: 1 !important;
}

.action-dropdown .dropdown-toggle:focus {
  background: #f8f9fa;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  opacity: 1 !important;
}

.action-dropdown .dropdown-menu {
  min-width: 180px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  border: 1px solid #e9ecef;
  z-index: 1050;
  opacity: 1 !important;
  background: white;
}

.action-dropdown .dropdown-item {
  padding: 8px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 1 !important;
  color: #495057;
  transition: all 0.2s ease;
}
.action-dropdown .dropdown-item:hover {
  background: #f8f9fa;
  opacity: 1 !important;
  color: #495057;
}

.action-dropdown .dropdown-item i {
  width: 16px;
  text-align: center;
  opacity: 1 !important;
}

/* Filters Section */
.admin-filters {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.admin-filters__group label {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 6px;
  font-size: 13px;
}

.admin-filters__actions {
  display: flex;
  gap: 10px;
  align-items: end;
  height: 100%;
  padding-top: 24px;
}

/* Shop Details Modal */
.shop-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.shop-detail-info .shop-id {
  font-family: "Courier New", monospace;
  color: #6c757d;
  font-size: 14px;
  margin-bottom: 8px;
}

.shop-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.shop-stat {
  text-align: center;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
}

.shop-stat-number {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 4px;
}

.shop-stat-label {
  font-size: 12px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Staff Members */
.staff-members {
  margin-top: 24px;
}

.staff-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 8px;
}

.staff-member-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.staff-member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.staff-member-details h6 {
  margin: 0 0 2px 0;
  font-size: 14px;
  color: #2c3e50;
}

.staff-member-details .email {
  font-size: 12px;
  color: #6c757d;
  margin: 0;
}

.staff-member-role {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  background: #e3f2fd;
  color: #1565c0;
}

/* Certification Management */
.certification-section {
  border-top: 1px solid #e9ecef;
  margin-top: 24px;
  padding-top: 24px;
}

.certification-current {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.certification-actions {
  display: flex;
  gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .shop-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .shop-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .admin-filters__actions {
    flex-direction: column;
    gap: 8px;
  }

  .shop-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .staff-member {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* Loading States */
.admin-loading {
  padding: 40px;
  text-align: center;
  color: #6c757d;
}

.admin-loading i {
  font-size: 24px;
  margin-bottom: 12px;
}

/* Sortable Headers */
.sortable {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.sortable:hover {
  background: #f8f9fa;
}

.sortable.asc i:before {
  content: "\f0de"; /* fa-sort-up */
}

.sortable.desc i:before {
  content: "\f0dd"; /* fa-sort-down */
}

/* Table Enhancements */
.admin-table tbody tr {
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

.admin-table tbody tr:hover {
  background: #f8f9fa;
  transform: none; /* Remove transform to avoid z-index issues */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.admin-table tbody tr:hover .action-dropdown {
  z-index: 1051;
}

/* Custom Scrollbar */
.table-responsive::-webkit-scrollbar {
  height: 8px;
  width: 4px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Fix form controls trong table */
.form-check-input {
  opacity: 1 !important;
}

.form-check-input:checked {
  opacity: 1 !important;
}

/* Fix button styles */
.shop-actions .btn {
  opacity: 1 !important;
  transition: all 0.2s ease;
}

.shop-actions .btn:hover {
  opacity: 1 !important;
  transform: translateY(-1px);
}

/* Fix status badges */
.status-badge,
.certification-badge,
.region-badge {
  opacity: 1 !important;
}

/* Fix select và input trong filters */
.admin-filters select,
.admin-filters input {
  opacity: 1 !important;
  background: white;
  border: 1px solid #ced4da;
}

.admin-filters select:focus,
.admin-filters input:focus {
  opacity: 1 !important;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Fix modal dropdown */
.modal .dropdown-menu {
  z-index: 1055;
  opacity: 1 !important;
}

/* Improve table layout */
.admin-table {
  table-layout: fixed;
  width: 100%;
}

.admin-table th,
.admin-table td {
  vertical-align: middle;
  opacity: 1 !important;
}

.admin-table th:first-child,
.admin-table td:first-child {
  width: 50px;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
  width: 250px;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
  width: 120px;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
  width: 150px;
}

.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
  width: 120px;
}

.admin-table th:nth-child(6),
.admin-table td:nth-child(6) {
  width: 120px;
}

.admin-table th:last-child,
.admin-table td:last-child {
  width: 150px;
}

/* Fix certification section */
.certification-section .card {
  width: 100% !important;
  min-width: 100% !important;
  opacity: 1 !important;
}

.certification-section .btn {
  opacity: 1 !important;
}

.certification-section .card h6 {
  margin-bottom: 4px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.certification-section .card small {
  font-size: 12px !important;
  line-height: 1.3;
  display: block;
  word-wrap: break-word;
}

/* Ensure button stays on right */
.certification-section .card .btn {
  flex-shrink: 0 !important;
  margin-left: 12px !important;
  white-space: nowrap;
}

/* Fix container width */
#currentCertifications {
  width: 100% !important;
}

#currentCertifications .card {
  margin-bottom: 12px;
}

/* Responsive fixes */
@media (max-width: 768px) {
  .admin-table {
    table-layout: auto;
  }

  .action-dropdown .dropdown-menu {
    right: 0;
    left: auto;
  }

  .certification-section .card .card-body {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px;
  }

  .certification-section .card .btn {
    margin-left: 0 !important;
    align-self: flex-end;
  }
}
/* ✅ THÊM: Logo Upload Styling */
.logo-upload-section {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.current-logo {
  flex-shrink: 0;
}

.shop-logo-preview {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #dee2e6;
  background-color: white;
}

.logo-upload-controls {
  flex: 1;
  min-width: 0;
}

.logo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.logo-actions .btn {
  font-size: 12px;
  padding: 4px 8px;
}

/* ✅ THÊM: Responsive cho mobile */
@media (max-width: 576px) {
  .logo-upload-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .shop-logo-preview {
    width: 100px;
    height: 100px;
  }

  .logo-actions {
    justify-content: center;
  }
}

/* ✅ THÊM: Error state styling */
.shop-logo-preview.error {
  border-color: #dc3545;
  opacity: 0.6;
}

.shop-logo-preview.loading {
  opacity: 0.7;
  filter: blur(1px);
}
/* ✅ THÊM: Shop logo styling trong table */
.shop-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-logo-container {
  flex-shrink: 0;
}

.shop-logo {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  background: white;
  transition: transform 0.2s ease;
}

.shop-logo:hover {
  transform: scale(1.05);
  border-color: var(--bs-primary);
}

.shop-details {
  flex: 1;
  min-width: 0;
}

.shop-details h6 {
  margin: 0 0 4px 0;
  font-weight: 600;
  color: #2c3e50;
}

.shop-id {
  font-size: 12px;
  color: #6c757d;
  margin: 0 0 8px 0;
  font-family: monospace;
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.shop-owner-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.owner-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #dee2e6;
}

.shop-owner {
  font-size: 13px;
  color: #495057;
  margin: 0;
}

/* ✅ THÊM: Responsive cho mobile */
@media (max-width: 768px) {
  .shop-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .shop-logo {
    width: 40px;
    height: 40px;
  }

  .shop-owner-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
/* ✅ THÊM: Shop detail modal styling */
.shop-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 20px;
}

.shop-detail-avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  background: white;
  flex-shrink: 0;
}

.shop-detail-info {
  flex: 1;
  min-width: 0;
}

.shop-detail-info h4 {
  color: black;
  font-weight: 700;
}

.shop-detail-info .shop-id {
  font-size: 14px;
  color: #6c757d;
  font-family: monospace;
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
}

/* ✅ THÊM: Responsive cho modal */
@media (max-width: 768px) {
  .shop-detail-header {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .shop-detail-avatar {
    width: 60px;
    height: 60px;
  }
}
/* ✅ SỬA: Admin cards compact design */
.admin-dashboard-cards {
  margin-bottom: 20px; /* Giảm từ 24px xuống 20px */
}

.admin-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  padding: 16px; /* Giảm từ 24px xuống 16px */
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px; /* Giảm gap giữa icon và content */
  height: 80px; /* ✅ FIX HEIGHT để đồng nhất */
  overflow: hidden;
}

.admin-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ✅ SỬA: Icon container compact */
.admin-card__icon {
  width: 48px; /* Giảm từ 60px xuống 48px */
  height: 48px; /* Giảm từ 60px xuống 48px */
  border-radius: 10px; /* Giảm từ 12px xuống 10px */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px; /* Giảm từ 24px xuống 20px */
  color: white;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  margin-bottom: 0;
}

/* ✅ SỬA: Content area compact */
.admin-card__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.admin-card__number {
  font-size: 22px; /* Giảm từ 28px xuống 22px */
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 2px 0; /* Giảm margin bottom */
  line-height: 1.2;
}

.admin-card__label {
  font-size: 13px; /* Giảm từ 14px xuống 13px */
  color: #6c757d;
  margin: 0;
  font-weight: 500;
  line-height: 1.3;
}

/* ✅ THÊM: Specific colors cho từng loại card */
.admin-card--shops .admin-card__icon {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.admin-card--verified .admin-card__icon {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.admin-card--partners .admin-card__icon {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.admin-card--inactive .admin-card__icon {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* ✅ THÊM: Responsive cho mobile */
@media (max-width: 768px) {
  .admin-card {
    height: 70px; /* Nhỏ hơn trên mobile */
    padding: 12px;
    gap: 10px;
  }

  .admin-card__icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .admin-card__number {
    font-size: 20px;
  }

  .admin-card__label {
    font-size: 12px;
  }
}

@media (max-width: 576px) {
  .admin-dashboard-cards {
    margin-bottom: 16px;
  }

  .admin-card {
    height: 65px;
    padding: 10px;
    gap: 8px;
  }

  .admin-card__icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .admin-card__number {
    font-size: 18px;
  }

  .admin-card__label {
    font-size: 11px;
  }
}

/* ✅ THÊM: Loading state cho numbers */
.admin-card__number:contains("---") {
  color: #95a5a6;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
