/* All Users Table Styles */
.all-users-table-container {
  text-align: center;
  padding: 2rem;
}

.table-header-title {
  margin: 0;
  padding: 0;
}

.table-center {
  text-align: center;
}

.users-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.users-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-secondary, #737373);
  pointer-events: none;
}

.users-search-input {
  padding: 0.625rem 1rem 0.625rem 2.75rem;
  min-width: 260px;
  font-size: 0.9rem;
  border: 2px solid var(--border-color, #e5e5e5);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--bg-card, #fff);
  color: var(--text-primary, #262626);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.users-search-input::placeholder {
  color: var(--text-secondary, #a3a3a3);
}

.users-search-input:hover {
  border-color: var(--primary-color, #ff9800);
}

.users-search-input:focus {
  outline: none;
  border-color: var(--primary-color, #ff9800);
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.2);
}

@media (max-width: 768px) {
  .users-search-input {
    min-width: 180px;
  }
}

/* View Toggle */
.users-view-toggle {
  display: flex;
  align-items: center;
  border: 2px solid var(--border-color, #e5e5e5);
  border-radius: var(--radius-md, 0.5rem);
  overflow: hidden;
}

.users-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card, #fff);
  border: none;
  cursor: pointer;
  color: var(--text-secondary, #737373);
  transition: all 0.2s ease;
}

.users-view-btn:hover {
  background: var(--bg-gray, #f5f5f5);
  color: var(--text-primary, #262626);
}

.users-view-btn.active {
  background: var(--primary-color, #ff9800);
  color: white;
}

.users-view-btn:not(:last-child) {
  border-right: 2px solid var(--border-color, #e5e5e5);
}

.users-view-btn.active + .users-view-btn {
  border-left-color: transparent;
}

/* Card Grid View */
.users-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.users-card-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary, #737373);
  font-size: 1rem;
}

.users-card {
  background: var(--bg-card, #fff);
  border: 2px solid var(--border-color, #e5e5e5);
  border-radius: var(--radius-lg, 0.75rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.users-card:hover {
  border-color: var(--primary-color, #ff9800);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.15);
}

.users-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-gray, #fafafa);
  border-bottom: 2px solid var(--border-color, #e5e5e5);
}

.users-card-index {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary, #737373);
}

.users-card-body {
  padding: 1.25rem;
  flex: 1;
}

.users-card-name {
  margin: 0 0 0.25rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary, #262626);
}

.users-card-email {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary, #737373);
}

.users-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.users-card-meta-item {
  font-size: 0.8rem;
  color: var(--text-secondary, #525252);
}

.users-card-meta-item strong {
  color: var(--text-primary, #404040);
  margin-right: 0.25rem;
}

.users-card-footer {
  padding: 1rem 1.25rem;
  border-top: 2px solid var(--border-color, #e5e5e5);
  background: var(--bg-gray, #fafafa);
}

@media (max-width: 480px) {
  .users-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Dark mode – All Users section */
body.night-mode .all-users-table-container,
.night-mode .all-users-table-container {
  color: rgba(255, 255, 255, 0.85);
}

body.night-mode .users-search-icon,
.night-mode .users-search-icon {
  color: rgba(255, 255, 255, 0.6);
}

body.night-mode .users-search-input,
.night-mode .users-search-input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.95);
}

body.night-mode .users-search-input::placeholder,
.night-mode .users-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

body.night-mode .users-search-input:hover,
.night-mode .users-search-input:hover {
  border-color: rgba(248, 113, 113, 0.5);
}

body.night-mode .users-search-input:focus,
.night-mode .users-search-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}

body.night-mode .users-view-toggle,
.night-mode .users-view-toggle {
  border-color: rgba(255, 255, 255, 0.25);
}

body.night-mode .users-view-btn,
.night-mode .users-view-btn {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

body.night-mode .users-view-btn:hover,
.night-mode .users-view-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
}

body.night-mode .users-view-btn.active,
.night-mode .users-view-btn.active {
  background: #dc2626;
  color: white;
}

body.night-mode .users-view-btn:not(:last-child),
.night-mode .users-view-btn:not(:last-child) {
  border-right-color: rgba(255, 255, 255, 0.25);
}

body.night-mode .users-card-grid-empty,
.night-mode .users-card-grid-empty {
  color: rgba(255, 255, 255, 0.7);
}

body.night-mode .users-card,
.night-mode .users-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

body.night-mode .users-card:hover,
.night-mode .users-card:hover {
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.night-mode .users-card-header,
.night-mode .users-card-header {
  background: rgba(255, 255, 255, 0.06);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

body.night-mode .users-card-index,
.night-mode .users-card-index {
  color: rgba(255, 255, 255, 0.7);
}

body.night-mode .users-card-name,
.night-mode .users-card-name {
  color: rgba(255, 255, 255, 0.95);
}

body.night-mode .users-card-email,
.night-mode .users-card-email {
  color: rgba(255, 255, 255, 0.75);
}

body.night-mode .users-card-meta-item,
.night-mode .users-card-meta-item {
  color: rgba(255, 255, 255, 0.7);
}

body.night-mode .users-card-meta-item strong,
.night-mode .users-card-meta-item strong {
  color: rgba(255, 255, 255, 0.9);
}

body.night-mode .users-card-footer,
.night-mode .users-card-footer {
  border-top-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

/* Table header title in dark mode (when inside .table-section) */
body.night-mode .table-section .table-header-title,
.night-mode .table-section .table-header-title {
  color: rgba(255, 255, 255, 0.98);
}

/* Dark mode – table section (All Users table container and table) */
body.night-mode .users-list-container .table-section,
.night-mode .users-list-container .table-section {
  background: #3a3838;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.night-mode .users-list-container .table-header,
.night-mode .users-list-container .table-header {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

body.night-mode .users-list-container .table-container,
.night-mode .users-list-container .table-container {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
}

body.night-mode .users-list-container .user-table thead,
.night-mode .users-list-container .user-table thead {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

body.night-mode .users-list-container .user-table th,
.night-mode .users-list-container .user-table th {
  background: transparent;
  color: rgba(255, 255, 255, 0.98);
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

body.night-mode .users-list-container .user-table th:hover,
.night-mode .users-list-container .user-table th:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.night-mode .users-list-container .user-table td,
.night-mode .users-list-container .user-table td {
  color: rgba(255, 255, 255, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.night-mode .users-list-container .user-table tbody tr:hover,
.night-mode .users-list-container .user-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

body.night-mode .users-list-container .user-table td.all-users-table-container,
.night-mode .users-list-container .user-table td.all-users-table-container {
  color: rgba(255, 255, 255, 0.7);
}

