:root {
  --primary-blue: #4285f4;
  --primary-blue-light: #5b97f6;
  --primary-blue-dark: #1266f1;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --border-light: #e8eaed;
  --border-medium: #dadce0;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-hover: #f1f3f4;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.1);
  --shadow-md: 0 1px 3px 0 rgba(60, 64, 67, 0.15);
  --shadow-lg: 0 4px 6px -2px rgba(60, 64, 67, 0.15);
}

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

body {
  font-family: 'Google Sans', 'Segoe UI', Tahoma, sans-serif;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  min-height: 100vh;
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navigation */
.nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-brand svg {
  width: 24px;
  height: 24px;
  color: var(--primary-blue);
}

.nav-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.user-info strong {
  color: var(--text-primary);
}

/* Card Components */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-sm {
  padding: 16px;
  border-radius: var(--radius-sm);
}

/* Dashboard Header */
.dashboard-header {
  margin: 32px 0;
}

.dashboard-title {
  font-size: 28px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.dashboard-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 400;
  margin: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.metric-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: box-shadow 0.2s ease;
}

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

.metric-value {
  font-size: 32px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 8px 0 4px 0;
}

.metric-label {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
  margin: 0;
}

/* Content Sections */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title svg {
  width: 20px;
  height: 20px;
  color: #6366f1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

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

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

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

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

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.15s ease;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

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

/* Tables */
.table-container {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

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

.table tr:hover {
  background: var(--bg-hover);
}

/* Tags */
.tag {
  display: inline-block;
  padding: 4px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 2px;
}

.tag.primary {
  background: rgba(66, 133, 244, 0.1);
  border-color: rgba(66, 133, 244, 0.2);
  color: var(--primary-blue);
}

.tag.status {
  padding: 4px 12px;
  border-radius: 16px;
  font-weight: 500;
  font-size: 12px;
}

.tag.status-cold {
  background: rgba(66, 133, 244, 0.1);
  color: var(--primary-blue);
  border-color: rgba(66, 133, 244, 0.2);
}

.tag.status-warm {
  background: rgba(255, 193, 7, 0.1);
  color: #f57c00;
  border-color: rgba(255, 193, 7, 0.2);
}

.tag.status-hot {
  background: rgba(244, 67, 54, 0.1);
  color: #d32f2f;
  border-color: rgba(244, 67, 54, 0.2);
}

/* Loading States */
.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Status indicators */
.status-indicator {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
}

.status-cold {
  background: rgba(66, 133, 244, 0.1);
  color: var(--primary-blue);
  border-color: rgba(66, 133, 244, 0.2);
}

.status-warm {
  background: rgba(255, 193, 7, 0.1);
  color: #f57c00;
  border-color: rgba(255, 193, 7, 0.2);
}

.status-hot {
  background: rgba(244, 67, 54, 0.1);
  color: #d32f2f;
  border-color: rgba(244, 67, 54, 0.2);
}

/* Filter Panel */
.filter-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.filter-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Multi-select */
.multi-select {
  position: relative;
}

.multi-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: var(--shadow-lg);
}

.multi-select-option {
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background-color 0.15s;
  font-size: 14px;
}

.multi-select-option:hover {
  background: var(--bg-hover);
}

.multi-select-option.selected {
  background: rgba(66, 133, 244, 0.1);
  color: var(--primary-blue);
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
  color: var(--text-muted);
}

.empty-state h3 {
  margin: 0 0 8px 0;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 16px;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Sidebar Navigation */
.sidebar {
  width: 240px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: 88px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  font-weight: 400;
  font-size: 14px;
}

.sidebar .nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar .nav-link.active {
  background: rgba(66, 133, 244, 0.1);
  color: var(--primary-blue);
  font-weight: 500;
}

.sidebar .nav-link svg {
  width: 16px;
  height: 16px;
}

/* Main Content Area */
.main-content {
  flex: 1;
  min-height: calc(100vh - 88px);
  padding: 24px 0;
}

.app-layout {
  display: flex;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.section-header {
  margin-bottom: 24px;
}

.section-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .nav-content {
    padding: 0 16px;
  }
  
  .dashboard-title {
    font-size: 24px;
  }
  
  .dashboard-subtitle {
    font-size: 14px;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .app-layout {
    flex-direction: column;
    padding: 0 16px;
    gap: 16px;
  }
  
  .sidebar {
    width: 100%;
    position: static;
    border-radius: var(--radius-sm);
  }
  
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
  }
  
  .sidebar .nav-link {
    white-space: nowrap;
    min-width: fit-content;
  }
  
  .card {
    padding: 16px;
  }
  
  .table th,
  .table td {
    padding: 8px 12px;
  }
  
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .table {
    min-width: 1200px;
  }
}

/* PC Status column styling */
.pc-status {
  max-width: 150px;
  font-size: 12px;
}

.pc-status > div {
  border-left: 2px solid var(--border-light);
  padding-left: 8px;
  margin-bottom: 4px;
}

.pc-status > div:last-child {
  margin-bottom: 0;
}

/* Responsive table adjustments */
@media (max-width: 768px) {
  .table-container {
    overflow-x: auto;
  }
  
  .table {
    min-width: 1400px;
  }
  
  .table th,
  .table td {
    padding: 8px 6px;
    font-size: 12px;
  }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus styles */
.btn:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 24px 24px 24px;
  border-top: 1px solid var(--border-light);
  margin-top: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Hide scrollbar for Firefox */
.sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) var(--bg-secondary);
}

/* Auth Container */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 48px 0;
}

/* Campaign Stats */
.campaign-stats {
  max-width: 120px;
  font-size: 12px;
}

.campaign-stats > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.campaign-stats > div:last-child {
  margin-bottom: 0;
}

.campaign-stats .tag {
  font-size: 10px;
  padding: 2px 6px;
  min-width: 20px;
  text-align: center;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.rounded { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.border { border: 1px solid var(--border-light); }
.border-medium { border: 1px solid var(--border-medium); }
.bg-white { background: var(--bg-primary); }
.bg-gray { background: var(--bg-secondary); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }

/* Email Review Styles */
.emails-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
}

.email-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.email-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

.email-card.sent {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.2);
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.email-recipient {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.email-address {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.email-actions {
    display: flex;
    gap: 8px;
}

.email-subject {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 14px;
}

.email-preview {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    margin-bottom: 12px;
}

.email-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.email-status.draft {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
}

.email-status.sent {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.email-status.sending {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Progress bar styles */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), #8b5cf6);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 4px;
}

.progress-step.completed {
    color: #22c55e;
}

.progress-step.active {
    color: var(--primary-blue);
}

/* Alert styles for Gmail status */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert.success {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.alert.error {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.alert.info {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--primary-blue);
}

/* Modal size variations */
.modal-lg .modal-dialog {
    max-width: 800px;
}

/* Button variations */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}