:root {
  --nimbus-blue: #003366;
  --nimbus-blue-dark: #002244;
  --nimbus-blue-pale: #e6f0ff;
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --bg-gray-50: #f9fafb;
  --bg-gray-100: #f3f4f6;
  --border-gray: #e5e7eb;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-gray-50);
  color: var(--text-primary);
  line-height: 1.6;
}

.dashboard-container {
  /* Removed max-width for full-width layout */
  margin: 0;
  padding: 1rem 2rem;
}

/* ========================================
   UNIFIED HEADER BAR
   ======================================== */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #fff;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  box-shadow: var(--shadow);
  gap: 16px;
  min-height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Brand Section (Left) */
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--nimbus-blue);
  white-space: nowrap;
}

/* Navigation Tabs (Center) */
.header-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.header-tab {
  padding: 8px 20px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.header-tab:hover {
  background: var(--bg-gray-100);
  color: var(--text-primary);
}

.header-tab.active {
  background: var(--nimbus-blue);
  color: #fff;
}

/* Actions Section (Right) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Connection Status */
.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-gray-100);
  border-radius: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.sse-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  transition: background 0.3s;
}

.sse-status-indicator.connected {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.sse-status-indicator.connecting {
  background: #f59e0b;
  animation: pulse-status 1.5s ease-in-out infinite;
}

.sse-status-indicator.disconnected {
  background: #9ca3af;
}

@keyframes pulse-status {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-label {
  font-size: 11px;
  font-weight: 500;
  color: inherit;
}

/* Icon Buttons */
.header-icon-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border-gray);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.header-icon-btn:hover {
  background: var(--bg-gray-100);
  border-color: #bbb;
  color: var(--text-primary);
}

.header-icon-btn .icon {
  font-size: 1rem;
}

.header-icon-btn .btn-label {
  font-weight: 500;
}

/* Beta feedback button styling */
.beta-feedback-btn {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
  color: #92400e !important;
}

.beta-feedback-btn:hover {
  background: #fde68a !important;
  border-color: #d97706 !important;
}

/* User Menu */
.header-user-menu {
  position: relative;
}

.header-user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  background: transparent;
  border: 1px solid var(--border-gray);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 39px;
}

.header-user-btn:hover {
  background: #e5e7eb;
  border-color: #bbb;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nimbus-blue) 0%, #4a90d9 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-email {
  font-size: 0.85rem;
  color: var(--text-primary);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-arrow {
  font-size: 8px;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.header-user-btn[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: none;
  z-index: 10000;
}

.user-dropdown.open {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-gray);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s;
}

.dropdown-item:hover {
  background: var(--bg-gray-100);
}

.dropdown-logout {
  color: var(--error);
  border-top: 1px solid var(--border-gray);
}

.dropdown-icon {
  font-size: 1rem;
}

/* Legacy support - hide old elements */
.header-left, .header-right, .subtitle {
  display: none !important;
}

/* Desktop only utility */
.desktop-only {
  display: flex;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-logout, .btn-danger, .btn-success {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--nimbus-blue);
  color: white;
}

.btn-primary:hover {
  background: var(--nimbus-blue-dark);
}

.btn-secondary {
  background: var(--bg-gray-100);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border-gray);
}

.btn-logout {
  background: var(--error);
  color: white;
}

.btn-logout:hover {
  background: #dc2626;
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 1rem;
  align-items: center;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--nimbus-blue);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Tabs */
.tab-navigation {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-gray);
}

.tab-btn {
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--nimbus-blue);
}

.tab-btn.active {
  color: var(--nimbus-blue);
  border-bottom-color: var(--nimbus-blue);
}

.tab-content {
  background: white;
  border-radius: 0 0 12px 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  min-height: 500px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-gray);
}

.section-header h2 {
  color: var(--nimbus-blue);
  font-size: 1.5rem;
}

.badge {
  background: var(--error);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Search Input */
.search-input {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  font-size: 0.95rem;
  width: 300px;
}

.search-input:focus {
  outline: none;
  border-color: var(--nimbus-blue);
}

/* Users List */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.user-card {
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  padding: 1.5rem;
  background: var(--bg-gray-50);
  transition: all 0.2s;
}

.user-card:hover {
  box-shadow: var(--shadow);
}

.user-header {
  display: flex;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.user-avatar-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--nimbus-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 600;
}

.user-details {
  flex: 1;
}

.user-name-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.user-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.role-badge {
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.role-badge.admin {
  background: #8b5cf6;
}

.role-badge.user {
  background: #6b7280;
}

.user-email {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.user-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.user-actions {
  display: flex;
  gap: 0.5rem;
}

/* Services Section */
.services-section {
  border-top: 1px solid var(--border-gray);
  padding-top: 1rem;
  margin-top: 1rem;
}

.services-header {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.service-item {
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.service-info {
  flex: 1;
}

.service-email {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.service-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.status-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  margin-left: 0.5rem;
}

.status-badge.active {
  background: var(--success);
}

.status-badge.pending {
  background: var(--warning);
}

.status-badge.disabled {
  background: var(--error);
}

.service-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

/* System Grid */
.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

.system-card {
  background: var(--bg-gray-50);
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  padding: 1.5rem;
}

.system-card h3 {
  color: var(--nimbus-blue);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.status-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: white;
  border-radius: 6px;
}

.status-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.status-value {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--nimbus-blue);
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background: var(--bg-gray-50);
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  padding: 1.5rem;
}

.tool-card h3 {
  color: var(--nimbus-blue);
  margin-bottom: 0.5rem;
}

.tool-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.tool-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tool-input {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--border-gray);
  border-radius: 6px;
  font-size: 0.9rem;
}

.tool-input:focus {
  outline: none;
  border-color: var(--nimbus-blue);
}

.tool-status {
  padding: 0.75rem;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  color: #92400e;
  font-size: 0.9rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-content.large {
  max-width: 900px;
}

.modal-content.xlarge {
  max-width: 1100px;
}

/* User Details Modal Styles */
.user-details-header {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-gray);
}

.user-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-placeholder-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--nimbus-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
}

.user-details-info h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.user-details-info .user-email {
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.user-details-info .user-role {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.user-details-info .user-dates {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  gap: 1.5rem;
}

.details-section {
  margin-bottom: 1.5rem;
}

.details-section h4 {
  color: var(--nimbus-blue);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.storage-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.storage-stat {
  background: var(--bg-gray-50);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.storage-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nimbus-blue);
}

.storage-stat .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.account-detail-row {
  background: var(--bg-gray-50);
  padding: 0.75rem 1rem;
  border-radius: 8px;
}

.account-detail-row .account-email {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.account-detail-row .account-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.account-detail-row .account-sync {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.category-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
}

.category-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  background: var(--bg-gray-50);
  border-radius: 4px;
  font-size: 0.85rem;
}

.category-row .category-name {
  color: var(--text-primary);
}

.category-row .category-count {
  font-weight: 600;
  color: var(--nimbus-blue);
}

.training-stats {
  padding: 0.75rem 1rem;
  background: var(--bg-gray-50);
  border-radius: 8px;
  font-size: 0.9rem;
}

.recent-activity {
  max-height: 200px;
  overflow-y: auto;
}

.activity-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-gray);
  font-size: 0.85rem;
}

.activity-row:last-child {
  border-bottom: none;
}

.activity-row .activity-action {
  color: var(--text-primary);
}

.activity-row .activity-date {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-gray);
}

.modal-header h2 {
  color: var(--nimbus-blue);
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

/* Add Account Modal Styles */
.account-type-btn:hover,
.imap-provider-btn:hover {
  border-color: var(--primary) !important;
  background: #f0f7ff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.account-type-btn:active,
.imap-provider-btn:active {
  transform: translateY(0);
}

/* Form Styles */
fieldset {
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

legend {
  font-weight: 600;
  color: var(--nimbus-blue);
  padding: 0 0.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border-gray);
  border-radius: 6px;
  font-size: 0.95rem;
}

.form-group input[type="checkbox"] {
  margin-right: 0.5rem;
}

.form-help {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.form-warning {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  color: #92400e;
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--border-gray);
}

/* Approvals List */
.approvals-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.approval-card {
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  padding: 1.25rem;
  background: var(--bg-gray-50);
  display: flex;
  gap: 1rem;
  align-items: start;
}

.approval-actions {
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* System Overview Collapsible Sections */
.system-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.collapse-card {
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  overflow: hidden;
}

.collapse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-gray-50);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.collapse-header:hover {
  background: var(--bg-gray-100);
}

.collapse-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.collapse-badge {
  background: var(--nimbus-blue);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.collapse-toggle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  transition: transform 0.3s;
}

.collapse-toggle.open {
  transform: rotate(180deg);
}

.collapse-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.collapse-content.open {
  max-height: 400px;
  overflow-y: auto;
}

.collapse-body {
  padding: 1rem;
  font-size: 0.85rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--bg-gray-100);
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-label {
  color: var(--text-secondary);
}

.metric-value {
  font-weight: 600;
  color: var(--nimbus-blue);
}

.metric-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.metric-list li {
  padding: 0.4rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Filter Buttons */
.request-filters,
.invite-filters {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-gray-100);
  border: 1px solid var(--border-gray);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: var(--border-gray);
}

.filter-btn.active {
  background: var(--nimbus-blue);
  color: white;
  border-color: var(--nimbus-blue);
}

/* Access Requests List */
.access-requests-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.access-request-card {
  background: var(--bg-gray-50);
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: start;
  transition: all 0.2s;
}

.access-request-card:hover {
  box-shadow: var(--shadow);
}

.access-request-info {
  flex: 1;
}

.access-request-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.access-request-email {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.access-request-reason {
  background: white;
  padding: 1rem;
  border-radius: 6px;
  border-left: 3px solid var(--nimbus-blue);
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.access-request-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.access-request-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Invite Codes List */
.invite-codes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.invite-code-card {
  background: var(--bg-gray-50);
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 150px 150px 200px 120px 120px;
  gap: 1.5rem;
  align-items: center;
  transition: all 0.2s;
}

.invite-code-card:hover {
  box-shadow: var(--shadow);
}

.invite-code-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.invite-code-value code {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--nimbus-blue);
  background: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}

.copy-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-secondary);
  padding: 0.25rem;
  transition: color 0.2s;
}

.copy-icon-btn:hover {
  color: var(--nimbus-blue);
}

.invite-code-uses,
.invite-code-expires,
.invite-code-note {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.invite-code-note {
  color: var(--text-secondary);
  font-style: italic;
}

.invite-code-status .status-badge {
  display: inline-block;
}

.invite-code-actions {
  display: flex;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .tab-navigation {
    overflow-x: auto;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .search-input {
    width: 100%;
  }

  .user-header {
    flex-direction: column;
  }

  .system-grid,
  .tools-grid,
  .system-overview {
    grid-template-columns: 1fr;
  }

  .invite-code-card {
    grid-template-columns: 1fr;
  }

  .access-request-card {
    flex-direction: column;
  }
}

/* ========== Disagreement Review Styles ========== */

.disagreement-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 150px;
}

.filter-select:focus {
  outline: 2px solid var(--nimbus-blue);
  outline-offset: 2px;
}

.jump-to-email {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.jump-input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  font-size: 0.9rem;
  min-width: 250px;
  font-family: monospace;
}

.jump-input:focus {
  outline: 2px solid var(--nimbus-blue);
  outline-offset: 2px;
}

.review-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card.mini {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-card.mini .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--nimbus-blue);
  margin-bottom: 0.5rem;
}

.stat-card.mini .stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.email-review-container {
  margin-bottom: 2rem;
  min-height: 400px;
}

.email-review-card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 2rem;
}

.email-header h3 {
  color: var(--nimbus-blue);
  margin-bottom: 1rem;
}

.email-review-card .email-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-gray-50);
  border-radius: 8px;
}

.email-review-card .email-meta strong {
  color: var(--text-secondary);
  font-weight: 600;
  margin-right: 0.5rem;
}

.email-review-card .email-meta code {
  background: var(--bg-gray-100);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: monospace;
}

.email-body {
  margin-bottom: 2rem;
}

.email-body h4 {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.body-preview {
  background: var(--bg-gray-50);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--nimbus-blue);
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
}

.model-comparison {
  margin-bottom: 2rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.comparison-table thead {
  background: var(--nimbus-blue-pale);
}

.comparison-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--nimbus-blue);
  border-bottom: 2px solid var(--border-gray);
}

.comparison-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-gray);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table .field-name {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-gray-50);
}

.comparison-table .disagreement {
  background: #fff3cd;
  font-weight: 600;
  color: #856404;
  position: relative;
}

.comparison-table .disagreement::before {
  content: '⚠️ ';
  margin-right: 0.25rem;
}

.comparison-table .consensus {
  background: #d4edda;
  font-weight: 600;
  color: #155724;
  position: relative;
}

.comparison-table .consensus::before {
  content: '✓ ';
  margin-right: 0.25rem;
}

.review-form {
  background: var(--bg-gray-50);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.review-form h3 {
  color: var(--nimbus-blue);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
}

.form-control:focus {
  outline: 2px solid var(--nimbus-blue);
  outline-offset: 2px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.model-reasoning {
  margin-top: 2rem;
}

.model-reasoning h3 {
  color: var(--nimbus-blue);
  margin-bottom: 1.5rem;
}

.reasoning-card {
  background: var(--bg-gray-50);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid var(--nimbus-blue);
}

.reasoning-card h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.reasoning-card p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.reasoning-card p:last-child {
  margin-bottom: 0;
}

.reasoning-card strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.review-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.review-navigation button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.review-navigation span {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 100px;
  text-align: center;
}

.review-navigation-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-gray-50);
  border-bottom: 2px solid var(--border-gray);
  margin-bottom: 1.5rem;
}

.review-navigation-inline button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.review-navigation-inline .nav-position {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 100px;
  text-align: center;
}

.no-data {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.error-message {
  background: #fee;
  border: 1px solid var(--error);
  color: var(--error);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

/* Relationship Suggestions */
.suggestions-list {
  display: grid;
  gap: 1rem;
}

.suggestion-card {
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  transition: box-shadow 0.2s;
}

.suggestion-card:hover {
  box-shadow: var(--shadow-lg);
}

.suggestion-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.suggestion-domain {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--nimbus-blue);
}

.suggestion-type {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--nimbus-blue-pale);
  color: var(--nimbus-blue);
  width: fit-content;
}

.suggestion-trigger {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.suggestion-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.suggestion-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-confirm {
  background: var(--success);
  color: white;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-confirm:hover {
  background: #059669;
}

.btn-reject {
  background: var(--error);
  color: white;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-reject:hover {
  background: #dc2626;
}
