/* Admin Tab Styles - Matching Home Tab Design */

/* Admin Sidebar - Matches #home-sidebar exactly */
#admin-sidebar {
  width: 20vw;
  /* Soft radial glow near top/left + diagonal depth */
  background:
    radial-gradient(900px 700px at 15% 4%,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.03) 35%,
      rgba(255, 255, 255, 0.00) 60%),
    linear-gradient(140deg,
      var(--sb-1) 0%,
      var(--sb-2) 28%,
      var(--sb-3) 58%,
      var(--sb-4) 100%);
  /* optional polish */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -40px 60px rgba(0, 0, 0, 0.18),
    6px 0 14px rgba(0, 0, 0, 0.35);
  color: #ffffff;
  overflow-y: hidden;
  height: 100vh;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;
  position: relative;
}

#admin-sidebar header {
  padding: 15px;
  padding-top: 7px;
  padding-bottom: 0px;
  background-color: transparent;
  color: white;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

#admin-sidebar header h2 {
  font-size: 1.3rem;
  font-weight: 600;
  text-transform: none;
  margin-top: 22px;
  margin-bottom: 24px;
  color: #ffffff;
}

/* Apply unified class styling */
#admin-sidebar header h2.sidebar-header-title {
  margin-top: 22px !important;
  margin-bottom: 24px !important;
}

/* Admin Sidebar Navigation - Matches #home-sidebar-nav */
#admin-sidebar-nav {
  list-style-type: none;
  padding: 0;
  overflow: visible;
}

/* Admin Sidebar Items - Matches .home-sidebar-item exactly */
.admin-sidebar-item {
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: left;
  transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 6px;
  margin: 0 8px;
  will-change: background-color;
  margin-top: 10px;
  color: #CBD0E4;
  background-color: transparent;
  border-bottom: none;
  height: auto;
  box-shadow: none;
  position: relative;
}

.admin-sidebar-item:hover {
  background-color: #37468C;
}

.admin-sidebar-item.active {
  background-color: #f2f3f4;
}

.admin-sidebar-item span {
  font-weight: 600;
  color: #ffffff;
  font-size: 1.0rem;
}

/* Active state text color */
.admin-sidebar-item.active span {
  color: var(--sidebar-color);
}

.admin-sidebar-item .lucide-icon {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  color: #ffffff;
  stroke: #ffffff;
  stroke-width: 1.5;
}

/* Icon hover state */
.admin-sidebar-item:hover .lucide-icon {
  color: #ffffff;
  stroke: #ffffff;
}

/* Icon active state */
.admin-sidebar-item.active .lucide-icon {
  color: var(--sidebar-color);
  stroke: var(--sidebar-color);
}

/* SVG inside active item */
.admin-sidebar-item.active svg {
  stroke: var(--sidebar-color) !important;
}

/* Additional SVG targeting for consistency */
.admin-sidebar-item.active svg.lucide {
  stroke: var(--sidebar-color) !important;
}

/* Focus styles for accessibility */
.admin-sidebar-item:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: -2px;
}

.admin-sidebar-item:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: -2px;
}

/* Admin Content Area - Matches #home-details exactly */
#admin-details {
  width: 76vw;
  background-color: #FAFAFC;
  padding-right: 0;
  overflow-y: hidden;
  overflow-x: hidden;
  /* Prevent horizontal scrollbar from header extending beyond */
  height: 95.2vh;
  border-top-right-radius: 15px;
  border-bottom-right-radius: 15px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Admin Content Sections */
.admin-content-section {
  display: none;
  flex: 1;
  overflow-y: hidden;
  /* Prevent vertical scrollbar */
  overflow-x: hidden;
  /* Prevent horizontal scrollbar from header extending beyond container */
  box-sizing: border-box;
  scroll-behavior: smooth;
  height: 100%;
  /* Fit within parent container */
}

.admin-content-section.active {
  display: block;
}

/* Placeholder Styles */
.admin-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: #676879;
  padding: 60px 40px;
}

.admin-placeholder h2 {
  color: #2c3e50;
  margin-bottom: 12px;
  font-size: 1.75rem;
  font-weight: 600;
}

.admin-placeholder p {
  font-size: 1.1rem;
  color: #676879;
  max-width: 500px;
  line-height: 1.6;
}

/* Admin Dashboard Styles - Reuse home dashboard styles */
.dashboard-container {
  padding: 15px 20px 0 20px;
  /* Match activity-container padding */
  max-width: none;
  /* Remove max-width to prevent centering */
  margin: 0;
  /* Remove auto margin to prevent centering */
  width: 100%;
  /* Full width like Activity view */
  overflow-x: hidden;
  /* Prevent horizontal scrollbar from header extending beyond */
  overflow-y: hidden;
  /* Prevent vertical scrollbar */
  background: #f7f8fa;
  height: 100%;
  /* Fit within parent container */
  box-sizing: border-box;
}

/* Loading States */
.dashboard-loading,
.dashboard-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
}

/* Ensure admin groups content section matches home dashboard structure */
#admin-groups-content {
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #68bbe3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.dashboard-loading p {
  color: #676879;
  font-size: 1rem;
  font-weight: 500;
}

.dashboard-error {
  padding: 40px;
}

.dashboard-error .error-icon {
  width: 64px;
  height: 64px;
  color: #ff6b6b;
  margin-bottom: 20px;
}

.dashboard-error h3 {
  color: #2c3e50;
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.dashboard-error p {
  color: #676879;
  margin-bottom: 24px;
}

.dashboard-error button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #68bbe3;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dashboard-error button:hover {
  background: #5aa8d0;
}

/* Dashboard Header - Match activity-header styling */
.dashboard-header {
  border-bottom: 1.8px solid #ddd;
  margin-bottom: 20px;
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
  /* Push controls to the right */
  align-items: flex-start;
  /* Vertically centers items */
  margin-left: -20px;
  /* Offset container's left padding */
  margin-right: -20px;
  /* Offset container's right padding */
  width: calc(100% + 40px);
  /* Extend beyond container padding */
}

.dashboard-header-info {
  flex: 0 0 auto;
  /* Don't grow or shrink */
}

.dashboard-header-info h2 {
  font-size: 24px;
  /* Match .kanban-board-title */
  color: #333;
  padding-left: 15px;
  margin: 0 0 4px 0;
  /* Add bottom margin for spacing with subtitle */
}

.dashboard-subtitle {
  padding-left: 15px;
  font-size: 0.85rem;
  color: #666;
  margin-top: 0;
  display: block;
}

.dashboard-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 20px;
  /* Match kanban-header right padding */
}

.refresh-dashboard-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  color: #737373;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 32px;
  letter-spacing: -0.01em;
  font-family: 'Figtree', sans-serif;
  white-space: nowrap;
}

.refresh-dashboard-btn:hover {
  background: #f5f5f5;
  color: #323338;
}

.refresh-dashboard-btn i,
.refresh-dashboard-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-width: 1.5;
}

.refresh-dashboard-btn.spinning i,
.refresh-dashboard-btn.spinning svg {
  animation: spin 0.6s linear;
}

/* Hero KPI Cards - Reuse from home dashboard */
.hero-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
  flex-shrink: 0;
  /* Don't shrink KPI cards */
}

.kpi-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.kpi-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.kpi-card.kpi-primary .kpi-icon {
  background: linear-gradient(135deg, #68bbe3 0%, #4a9bc7 100%);
}

.kpi-card.kpi-success .kpi-icon {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.kpi-card.kpi-accent .kpi-icon {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.kpi-content {
  flex: 1;
  min-width: 0;
}

.kpi-label {
  font-size: 16px;
  color: #323338;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1.2;
  margin-bottom: 8px;
}

.kpi-trend {
  font-size: 0.75rem;
  color: #676879;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kpi-trend-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.trend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  white-space: nowrap;
  /* Prevent line breaks */
}

.trend-label {
  color: #737373;
  font-weight: 400;
  white-space: nowrap;
}

.trend-value {
  color: #323338;
  font-weight: 500;
  white-space: nowrap;
}

/* Dashboard Section */
.dashboard-section {
  margin-bottom: 24px;
  flex-shrink: 0;
  /* Don't shrink sections */
}

/* Quick Overview Card */
.quick-overview-container {
  width: 100%;
}

.quick-overview-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 24px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.quick-overview-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
}

.quick-overview-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.quick-overview-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.overview-stat-row {
  display: flex;
  width: 100%;
}

.overview-stat {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #f7f8fa;
  border-radius: 8px;
  flex: 1;
  transition: all 0.2s ease;
}

.overview-stat:hover {
  background: #f0f1f3;
  transform: translateX(4px);
}

.overview-icon {
  width: 40px;
  height: 40px;
  color: #68bbe3;
  flex-shrink: 0;
}

.overview-stat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.overview-label {
  font-size: 0.875rem;
  color: #676879;
  font-weight: 500;
}

.overview-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ensure admin dashboard content section doesn't show scrollbars */
#admin-dashboard-content {
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#admin-dashboard-content .dashboard-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  /* No vertical scrollbar */
  overflow-x: hidden;
  min-height: 0;
  /* Allow flex shrinking */
}

/* Responsive Design - Match existing media queries */
@media screen and (max-width: 1280px) {
  #admin-details {
    width: 71vw;
  }
}

@media screen and (max-width: 1024px) {
  #admin-sidebar {
    width: 30vw;
  }

  #admin-details {
    width: 66vw;
  }
}

@media (max-width: 768px) {
  #admin-sidebar {
    width: 35vw;
  }

  .admin-sidebar-item {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .admin-placeholder h2 {
    font-size: 1.5rem;
  }

  .admin-placeholder p {
    font-size: 1rem;
  }
}

/* User Groups Management Styles */
.user-groups-container {
  padding: 15px 20px 0 20px;
  max-width: none;
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: #f7f8fa;
  height: 100%;
  box-sizing: border-box;
}

/* Admin Users Management Styles */
.admin-users-container {
  padding: 15px 20px 0 20px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f7f8fa;
  box-sizing: border-box;
}

.admin-users-header {
  border-bottom: 1.8px solid #ddd;
  margin-bottom: 16px;
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-left: -20px;
  margin-right: -20px;
  width: calc(100% + 40px);
}

.admin-users-header-info h2 {
  font-size: 24px;
  color: #333;
  padding-left: 15px;
  margin: 0 0 4px 0;
}

.admin-users-subtitle {
  padding-left: 15px;
  font-size: 0.85rem;
  color: #666;
  margin-top: 0;
  display: block;
}

/* Admin Users: header search positioning + sizing (match MyTasks/MyBoard, but wider) */
#admin-users-search-filter-bar.search-filter-bar {
  /* Inset from the far-right edge (move a bit left) */
  padding-right: 20px;
}

#admin-users-search-container.search-container {
  /* Bigger search in header */
  max-width: 360px;
}

#admin-users-search-container.search-container.collapsed {
  max-width: 105px;
}

#admin-users-search-container.search-container.expanded {
  max-width: 360px;
}

#admin-users-search-container.search-container.expanded .task-search-input {
  min-width: 220px;
}

.admin-users-search-input {
  /* Inherit the same look/feel as MyTasks/MyBoard search (search-filter.css) */
}

.admin-users-results {
  height: calc(100% - 140px);
  overflow: auto;
  padding-bottom: 16px;
}

.admin-users-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-user-row {
  background: #ffffff;
  border-radius: 8px;
  padding: 14px 16px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-user-row-main {
  min-width: 0;
  flex: 1;
}

.admin-user-name-line {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* User status badges */
.admin-user-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-user-status.status-active {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.admin-user-status.status-pending {
  background-color: #fff3e0;
  color: #e65100;
}

.admin-user-status.status-inactive {
  background-color: #fce4ec;
  color: #c2185b;
}

.admin-user-meta {
  margin-top: 4px;
  font-size: 0.85rem;
  color: #676879;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-user-sep {
  color: #ccc;
}

.admin-user-row-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.admin-user-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  background: #f7f8fa;
  border: 1px solid #e6e8ef;
  padding: 6px 10px;
  border-radius: 8px;
  color: #323338;
  min-width: 110px;
  text-align: center;
}

.admin-users-load-more {
  display: flex;
  justify-content: center;
  padding: 16px 0 24px;
}

/* Admin User modal */
.admin-user-modal {
  background: white;
  border-radius: 12px;
  width: min(92vw, 760px);
  max-width: 760px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#admin-user-edit-modal .modal-content.admin-user-modal {
  width: min(92vw, 820px) !important;
  max-width: 820px !important;
  height: auto !important;
  top: 0 !important;
  margin: 0 auto !important;
  max-height: 92vh !important;
}

.admin-user-group-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.875rem;
  box-sizing: border-box;
}

.user-groups-header {
  border-bottom: 1.8px solid #ddd;
  margin-bottom: 20px;
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-left: -20px;
  margin-right: -20px;
  width: calc(100% + 40px);
}

.user-groups-header-info h2 {
  font-size: 24px;
  color: #333;
  padding-left: 15px;
  margin: 0 0 4px 0;
}

.user-groups-subtitle {
  padding-left: 15px;
  font-size: 0.85rem;
  color: #666;
  margin-top: 0;
  display: block;
}

.user-groups-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 20px;
}

.create-group-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #68bbe3;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.create-group-btn:hover {
  background: #5aa8d0;
}

.create-group-btn .lucide-icon {
  width: 18px;
  height: 18px;
}

.user-groups-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.user-group-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.user-group-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.user-group-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
}

.user-group-card-title h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 8px 0;
}

.user-group-description {
  font-size: 0.875rem;
  color: #676879;
  margin: 0;
}

.user-group-card-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #676879;
}

.icon-btn:hover {
  background: #f5f5f5;
  color: #323338;
}

.icon-btn .lucide-icon {
  width: 18px;
  height: 18px;
}

.user-group-card-content {
  margin-top: 16px;
}

.user-group-limits {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.limit-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f7f8fa;
  border-radius: 6px;
}

.limit-label {
  font-size: 0.875rem;
  color: #676879;
  font-weight: 500;
}

.limit-value {
  font-size: 0.875rem;
  color: #323338;
  font-weight: 600;
}

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
}

.empty-icon {
  width: 64px;
  height: 64px;
  color: #cbd0e4;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.25rem;
  color: #2c3e50;
  margin: 0 0 8px 0;
}

.empty-state p {
  font-size: 0.875rem;
  color: #676879;
  margin: 0;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.user-group-modal {
  background: white;
  border-radius: 12px;
  /* Make dialog bigger (reduce need for scrollbars) */
  width: min(92vw, 760px);
  max-width: 760px;
  /* Don’t force extra empty space */
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Ensure User Group modal sizing wins over generic `.modal-content` rules */
#admin-user-group-modal .modal-content.user-group-modal {
  width: min(92vw, 820px) !important;
  max-width: 820px !important;
  height: auto !important;
  /* override authmodal.css height: 50% */
  top: 0 !important;
  /* override authmodal.css top: 2% */
  margin: 0 auto !important;
  /* keep centered */
  max-height: 92vh !important;
}

/* User Groups modal: reduce vertical chrome (avoid scrollbars) */
.user-group-modal .modal-header {
  padding: 12px 20px 8px;
  border-bottom: none;
  /* remove the first horizontal line */
}

.user-group-modal .modal-body {
  padding: 12px 20px 16px;
}

.user-group-modal .modal-footer {
  padding: 12px 20px;
}

/* User Groups modal: reduce vertical spacing inside the form */
.user-group-modal .modal-input {
  margin-bottom: 12px !important;
}

.user-group-modal .modal-textarea {
  margin-bottom: 12px !important;
  min-height: 60px;
  /* smaller than global 80px to avoid scroll */
}

.user-group-modal .form-group {
  margin-bottom: 12px;
}

.user-group-modal .form-row {
  gap: 12px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #676879;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #323338;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid #e0e0e0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #323338;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #68bbe3;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #68bbe3;
  color: white;
}

.btn-primary:hover {
  background: #5aa8d0;
}

.btn-secondary {
  background: #f5f5f5;
  color: #323338;
}

.btn-secondary:hover {
  background: #e8e8e8;
}

@media (max-width: 768px) {
  .user-groups-list {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .user-group-limits {
    grid-template-columns: 1fr;
  }
}