/* ===== CSS VARIABLES AND BASE STYLES ===== */
:root {
  /* Colors - Light Mode (Default) */
  --color-primary: #3b82f6;
  --color-primary-dark: #1e40af;
  --color-primary-light: #dbeafe;
  --color-primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);

  --color-secondary: #475569;
  --color-secondary-light: #f1f5f9;
  --color-secondary-dark: #334155;

  --color-accent-blue: #0ea5e9;
  --color-accent-purple: #8b5cf6;
  --color-accent-teal: #14b8a6;
  --color-accent-orange: #f97316;

  --color-success: #059669;
  --color-success-light: #d1fae5;
  --color-warning: #d97706;
  --color-warning-light: #fef3c7;
  --color-error: #dc2626;
  --color-error-light: #fee2e2;
  --color-info: #0284c7;
  --color-info-light: #e0f2fe;

  --color-background: #ffffff;
  --color-background-light: #fafbfc;
  --color-background-secondary: #f8fafc;
  --color-background-tertiary: #f1f5f9;
  --color-surface: #ffffff;
  --color-surface-hover: #f8fafc;

  --color-text-primary: #0f172a;
  --color-text-secondary: #64748b;
  --color-text-tertiary: #94a3b8;
  --color-text-inverse: #ffffff;

  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-border-dark: #cbd5e1;
}

:root {
  /* Layout */
  --sidebar-width: 320px;
  --header-height: 72px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

/* ===== RESET AND BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
  line-height: 1.6;
  font-size: var(--font-size-base);
  overflow-x: hidden;
}

/* ===== AUTHENTICATION STYLES ===== */
#authContainer {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: linear-gradient(
    135deg,
    var(--color-background) 0%,
    var(--color-background-secondary) 100%
  );
}

/* Authentication forms */
#authContainer form {
  background: var(--color-surface);
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  width: 100%;
  max-width: 400px;
  position: relative;
  overflow: hidden;
}

#authContainer form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-primary-gradient);
}

#authContainer form.hidden {
  display: none;
}

#authContainer h2 {
  color: var(--color-text-primary);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-6);
  text-align: center;
}

#authContainer label {
  display: block;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
}

#authContainer input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  background: var(--color-surface);
  transition: all var(--transition-fast);
  font-family: inherit;
  margin-top: var(--space-1);
}

#authContainer input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

#authContainer button[type='submit'] {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  background: var(--color-primary-gradient);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  margin-top: var(--space-2);
}

#authContainer button[type='submit']:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

#authContainer button[type='submit']:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#authContainer .name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

#authContainer .name-row label {
  margin-bottom: 0;
}

#authContainer p {
  text-align: center;
  color: var(--color-text-secondary);
  margin-top: var(--space-3);
}

#authContainer a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
}

#authContainer a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

#authContainer img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ===== FORM STYLES ===== */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  background: var(--color-surface);
  transition: all var(--transition-fast);
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* ===== BUTTON STYLES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary-gradient);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-dark);
}

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  #authContainer {
    padding: var(--space-4);
  }

  #authContainer form {
    padding: var(--space-6);
  }

  #authContainer .name-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  #authContainer .name-row label {
    margin-bottom: var(--space-4);
  }
}

/* ===== ADDITIONAL COMPONENT STYLES ===== */

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

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-fast);
}

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

/* Clickable Stat Cards */
.stat-card-clickable {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.stat-card-clickable:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.stat-card-clickable:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Focus styles for keyboard navigation */
.stat-card-clickable:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.stat-card-clickable:focus:not(:focus-visible) {
  outline: none;
}

/* Action hint that appears on hover */
.stat-action-hint {
  font-size: var(--font-size-xs);
  color: var(--color-primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
  margin-top: var(--space-2);
  font-weight: var(--font-weight-medium);
}

.stat-card-clickable:hover .stat-action-hint {
  opacity: 1;
}

/* Visual indicator arrow */
.stat-card-clickable::after {
  content: '\2192';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: all var(--transition-fast);
  color: var(--color-primary);
  font-size: 1.25rem;
}

.stat-card-clickable:hover::after {
  opacity: 1;
  right: 12px;
}

.stat-icon {
  font-size: 2.5rem;
  min-width: 60px;
  text-align: center;
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin: 0;
  line-height: 1;
}

.stat-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin: 0;
  margin-top: 0.25rem;
}

/* Evaluation Grid for GM Evaluations */
.evaluation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(12px, 4vw, 2rem);
  margin-bottom: 2rem;
}

.evaluation-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-fast);
}

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

.evaluation-card h4 {
  margin: 0 0 1rem 0;
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

.evaluation-score {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.score-value {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-success);
}

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

/* Progress List for GM Evaluations */
.progress-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.progress-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-item > span:first-child {
  min-width: 120px;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.progress-item > span:last-child {
  min-width: 40px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--color-background-secondary);
  border-radius: 4px;
  overflow: hidden;
}

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

/* Criteria Grid for Criteria Management */
.criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: clamp(12px, 4vw, 1.5rem);
  margin-bottom: 2rem;
}

.criteria-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-fast);
}

.criteria-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.criteria-item h4 {
  margin: 0 0 1rem 0;
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

.criteria-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.criteria-details p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.criteria-form {
  background: var(--color-background-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* Form Section for User Management */
.form-section {
  background: var(--color-background-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.form-section h3 {
  margin: 0 0 1rem 0;
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .stats-grid,
  .evaluation-grid,
  .criteria-grid {
    grid-template-columns: 1fr;
  }

  .stat-card,
  .evaluation-card,
  .criteria-item {
    padding: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .score-value {
    font-size: 2rem;
  }
}

/* ===== STAR RATING STYLES ===== */
.star-rating-picker {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  margin: 12px 0;
  justify-content: center;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.star-rating-picker:hover {
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.1);
}

.star-btn {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid transparent;
  padding: 12px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  outline: none;
  min-width: 70px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.star-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.4);
}

.star-icon {
  display: block;
  font-size: 44px;
  line-height: 1;
  color: #cbd5e1;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Hover state - stars glow on hover */
.star-btn:hover .star-icon {
  color: #fcd34d;
  transform: scale(1.2);
  text-shadow: 0 3px 12px rgba(251, 191, 36, 0.6);
}

/* Active/selected state */
.star-btn.active .star-icon {
  color: #fbbf24;
  text-shadow: 0 4px 16px rgba(251, 191, 36, 0.8);
}

/* Filled stars (stars up to and including the selected one) */
.star-btn.filled .star-icon {
  color: #fbbf24;
  text-shadow: 0 3px 14px rgba(251, 191, 36, 0.7);
}

.star-btn.filled,
.star-btn.active {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 14px 32px rgba(251, 191, 36, 0.35);
}

/* Click animation */
.star-btn:active .star-icon {
  transform: scale(0.9);
}

/* Star rating label text */
.star-rating-label {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 8px 0 0 0;
  transition: color 0.2s ease;
}

/* Dark mode adjustments */
html[data-theme='dark'] .star-rating-picker {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(71, 85, 105, 0.5);
}

html[data-theme='dark'] .star-btn {
  background: rgba(148, 163, 184, 0.25);
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.65);
}

html[data-theme='dark'] .star-rating-picker:hover {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.15);
}

html[data-theme='dark'] .star-icon {
  color: #94a3b8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-theme='dark'] .star-btn:hover .star-icon,
html[data-theme='dark'] .star-btn:hover .star-icon {
  color: #fcd34d;
}

html[data-theme='dark'] .star-btn.active .star-icon,
html[data-theme='dark'] .star-btn.filled .star-icon,
html[data-theme='dark'] .star-btn.active .star-icon,
html[data-theme='dark'] .star-btn.filled .star-icon {
  color: #fbbf24;
}

html[data-theme='dark'] .star-btn.filled,
html[data-theme='dark'] .star-btn.active {
  background: rgba(251, 191, 36, 0.25);
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.45);
}

/* Responsive sizing */
@media (max-width: 480px) {
  .star-icon {
    width: 40px;
    height: 40px;
  }

  .star-rating-picker {
    padding: 12px 16px;
    gap: 4px;
  }
}

.rating-submit-btn {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #0f172a;
  border: none;
  box-shadow: 0 15px 35px rgba(249, 115, 22, 0.25);
  letter-spacing: 0.02em;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.rating-submit-btn:hover {
  background: linear-gradient(135deg, #facc15, #fb923c);
  box-shadow: 0 20px 45px rgba(249, 115, 22, 0.45);
  transform: translateY(-2px) scale(1.01);
}

html[data-theme='dark'] .rating-submit-btn {
  color: #030712;
  box-shadow: 0 0 28px rgba(251, 191, 36, 0.45);
}

html[data-theme='dark'] .rating-submit-btn:hover {
  box-shadow: 0 0 36px rgba(251, 191, 36, 0.65);
  transform: translateY(-2px) scale(1.015);
}

/* Team Management Save Button */
.team-save-btn {
  background: linear-gradient(135deg, #7bb7ff, #8ec5ff);
  color: #0b1f33;
  border: none;
  box-shadow: 0 18px 40px rgba(126, 193, 255, 0.35);
  letter-spacing: 0.02em;
  font-weight: 700;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  width: 100%;
  max-width: 440px;
}

.team-save-btn:hover {
  background: linear-gradient(135deg, #9fcfff, #a8d4ff);
  box-shadow: 0 24px 50px rgba(126, 193, 255, 0.5);
  transform: translateY(-2px) scale(1.01);
}

html[data-theme='dark'] .team-save-btn {
  color: #061226;
  box-shadow: 0 0 32px rgba(126, 193, 255, 0.45);
}

html[data-theme='dark'] .team-save-btn:hover {
  box-shadow: 0 0 42px rgba(126, 193, 255, 0.6);
  transform: translateY(-2px) scale(1.015);
}

/* Point Assignment: Employee Grid Styling (Shift Management visual parity) */
#employeeBubblesContainer,
#employeeSelectionContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.employee-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 26px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.employee-card:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
}

.employee-card.selected {
  border-color: var(--success);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.employee-checkbox {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-primary);
  flex-shrink: 0;
  background: var(--color-surface, var(--card-bg));
  color: transparent;
}

.employee-card.selected .employee-checkbox {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #fff;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.employee-card.selected .employee-checkbox span {
  color: #fff;
}

.employee-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.employee-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.employee-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.employee-details .badge {
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* ===== PENDING REVIEWS & STATUS BADGES ===== */

/* Pending Reviews Alert Banner */
.pending-reviews-alert {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--color-warning-light);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.pending-reviews-alert .alert-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.pending-reviews-alert .alert-content {
  flex: 1;
}

.pending-reviews-alert .alert-content strong {
  display: block;
  color: var(--color-text-primary);
  font-size: 1rem;
}

.pending-reviews-alert .alert-content p {
  margin: 0.25rem 0 0 0;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-warning {
  background: var(--color-warning);
  color: #000;
}

.badge-success {
  background: var(--color-success);
  color: #fff;
}

.badge-info {
  background: var(--color-info);
  color: #fff;
}

/* Pending Row Highlight */
tr.rating-pending {
  background: rgba(217, 119, 6, 0.08);
  border-left: 3px solid var(--color-warning);
}

tr.rating-pending:hover {
  background: rgba(217, 119, 6, 0.12);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--color-primary);
  padding: 16px 20px;
  margin-bottom: 12px;
  min-width: 300px;
  max-width: 500px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.error {
  border-left-color: var(--color-error);
}

.toast.error .toast-icon {
  color: var(--color-error);
}

.toast.success {
  border-left-color: var(--color-success);
}

.toast.success .toast-icon {
  color: var(--color-success);
}

.toast.warning {
  border-left-color: var(--color-warning);
}

.toast.warning .toast-icon {
  color: var(--color-warning);
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-text-primary);
}

.toast-message {
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
}

/* Loading spinner for better UX */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top: 2px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.loading-content {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 500;
}

/* Mobile responsiveness for toasts */
@media (max-width: 640px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* ===== INPUT VALIDATION STYLES ===== */
.form-input.valid,
.form-select.valid {
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.form-input.invalid,
.form-select.invalid {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-error {
  color: var(--color-error);
  font-size: 12px;
  margin-top: 4px;
  display: block;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Required field indicator */
.form-label[data-required]::after {
  content: ' *';
  color: var(--color-error);
}

/* Mobile touch improvements */
@media (max-width: 768px) {
  .form-input,
  .form-select,
  .btn {
    min-height: 44px; /* iOS recommended minimum touch target */
    font-size: 16px; /* Prevent iOS zoom on focus */
  }

  .form-input:focus,
  .form-select:focus {
    transform: none; /* Prevent layout shifts on mobile */
  }

  /* Mobile-specific improvements */
  .main-container {
    padding: var(--space-4);
  }

  .card {
    margin-bottom: var(--space-4);
    border-radius: var(--radius-md);
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .nav-item {
    min-height: 48px;
    padding: var(--space-3) var(--space-4);
  }

  /* Improve touch targets for star ratings */
  .star-option {
    min-height: 48px;
    min-width: 48px;
  }

  /* Better spacing for mobile forms */
  .form-row {
    flex-direction: column;
    gap: var(--space-4);
  }

  .form-actions {
    flex-direction: column;
    gap: var(--space-3);
  }

  .form-actions .btn {
    width: 100%;
  }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
  .sidebar {
    width: 100%;
  }

  .main-container {
    margin-left: 0;
    padding: var(--space-2);
  }

  .card-content {
    padding: var(--space-4);
  }

  .stat-card {
    text-align: center;
    padding: var(--space-4);
  }

  .table {
    font-size: 14px;
  }
}

/* iPad and tablet optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .sidebar {
    width: 240px;
  }

  .main-container {
    margin-left: 240px;
  }
}

/* ===== DARK MODE SUPPORT ===== */
[data-theme='dark'] {
  /* Form Elements */
  .form-label {
    color: var(--text-primary, #e8f1ff);
  }

  .form-input,
  .form-select,
  .form-textarea {
    background: var(--bg-secondary, #070f21);
    border-color: var(--border-color, rgba(162, 185, 225, 0.2));
    color: var(--text-primary, #e8f1ff);
  }

  .form-input:focus,
  .form-select:focus,
  .form-textarea:focus {
    border-color: var(--primary-color, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  }

  .form-input::placeholder,
  .form-select::placeholder,
  .form-textarea::placeholder {
    color: var(--text-secondary, rgba(205, 219, 245, 0.86));
  }

  /* Authentication Container */
  #authContainer {
    background: linear-gradient(
      135deg,
      var(--bg-primary, #040a18) 0%,
      var(--bg-secondary, #070f21) 100%
    );
  }

  #authContainer form {
    background: var(--bg-elevated, rgba(8, 16, 32, 0.92));
    border-color: var(--border-color, rgba(162, 185, 225, 0.2));
  }

  #authContainer h2 {
    color: var(--text-primary, #e8f1ff);
  }

  #authContainer label {
    color: var(--text-primary, #e8f1ff);
  }

  #authContainer input {
    background: var(--bg-secondary, #070f21);
    border-color: var(--border-color, rgba(162, 185, 225, 0.2));
    color: var(--text-primary, #e8f1ff);
  }

  #authContainer input::placeholder {
    color: var(--text-secondary, rgba(205, 219, 245, 0.86));
  }

  #authContainer input:focus {
    border-color: var(--primary-color, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  }

  #authContainer p {
    color: var(--text-secondary, rgba(205, 219, 245, 0.86));
  }

  #authContainer a {
    color: var(--primary-color, #6366f1);
  }

  #authContainer a:hover {
    color: var(--primary-light, #818cf8);
  }
}
