/* ========================================
   HEADLINE AGENTUR v4 — GLOSS / GLASSMORPHISM DESIGN
   ======================================== */

:root {
  /* Colors */
  --color-bg: #f0f2f5;
  --color-bg-elevated: #ffffff;
  --color-surface: rgba(255, 255, 255, 0.7);
  --color-surface-strong: rgba(255, 255, 255, 0.9);
  --color-border: rgba(255, 255, 255, 0.4);
  --color-border-strong: rgba(200, 208, 220, 0.6);
  --color-text: #1a1f2e;
  --color-text-muted: #5a6578;
  --color-text-light: #8a94a6;

  /* Accent / Brand */
  --color-accent: #2d6eff;
  --color-accent-hover: #1a5bd9;
  --color-accent-light: rgba(45, 110, 255, 0.1);
  --color-accent-glow: rgba(45, 110, 255, 0.4);

  /* Status Colors */
  --color-success: #10b981;
  --color-success-light: rgba(16, 185, 129, 0.1);
  --color-warning: #f59e0b;
  --color-warning-light: rgba(245, 158, 11, 0.1);
  --color-error: #ef4444;
  --color-error-light: rgba(239, 68, 68, 0.1);
  --color-info: #3b82f6;
  --color-info-light: rgba(59, 130, 246, 0.1);

  /* Glassmorphism */
  --glass-blur: 20px;
  --glass-blur-strong: 40px;
  --glass-opacity: 0.7;
  --glass-opacity-strong: 0.9;
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
  --glass-shadow-strong: 0 16px 48px rgba(31, 38, 135, 0.12);
  --glass-shadow-hover: 0 24px 64px rgba(31, 38, 135, 0.16);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  /* Z-index */
  --z-dropdown: 100;
  --z-modal: 200;
  --z-toast: 300;
  --z-header: 50;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f1419;
    --color-bg-elevated: #1a1f2e;
    --color-surface: rgba(26, 31, 46, 0.7);
    --color-surface-strong: rgba(26, 31, 46, 0.9);
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-strong: rgba(255, 255, 255, 0.15);
    --color-text: #f0f2f5;
    --color-text-muted: #9aa4b2;
    --color-text-light: #6a7484;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.4);
    --glass-shadow-hover: 0 24px 64px rgba(0, 0, 0, 0.5);
  }
}

/* ========================================
   RESET & BASE
   ======================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subtle background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, var(--color-accent-light) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, var(--color-info-light) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, var(--color-success-light) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
}

/* ========================================
   LAYOUT
   ======================================== */

.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--color-surface-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--color-text);
}

.logo-text {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--color-accent), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

/* Landing / Auth / Admin / Applicant logo text */
.landing-logo-text,
.auth-logo-text,
.admin-logo-text,
.applicant-logo-text {
  display: block;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--color-accent), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-logo-text {
  font-size: 1.5rem;
  margin: 0 auto var(--space-md);
}

.auth-logo-text {
  font-size: 1.5rem;
  margin: 0 auto var(--space-md);
}

.admin-logo-text {
  font-size: 1.1rem;
  margin-right: var(--space-md);
  flex-shrink: 0;
}

.applicant-logo-text {
  font-size: 1.5rem;
  margin: 0 auto var(--space-md);
}

/* Landing card styles */
.landing-card {
  max-width: 480px;
  margin: 80px auto;
  padding: var(--space-2xl);
  text-align: center;
}

.landing-content h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.landing-text {
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

.landing-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  text-align: left;
}

.landing-option h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.landing-url {
  display: block;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--color-text);
  margin: var(--space-xs) 0;
}

.landing-hint {
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

.landing-divider {
  border-top: 1px solid var(--color-border);
  margin: var(--space-md) 0;
}

/* Applicant Portal card styles */
.applicant-card {
  max-width: 800px;
  margin: 40px auto;
  padding: var(--space-xl);
}

.applicant-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.applicant-subtitle {
  color: var(--color-text-muted);
  margin-top: var(--space-sm);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
  display: flex;
  flex-direction: column;
}

.view {
  width: 100%;
  animation: fadeIn var(--transition-base);
}

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

.footer {
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.875rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  backdrop-filter: blur(var(--glass-blur));
}

/* ========================================
   GLASSMORPHISM COMPONENTS
   ======================================== */

.gloss-card {
  background: var(--color-surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.gloss-card:hover {
  box-shadow: var(--glass-shadow-strong);
  border-color: var(--color-border-strong);
}

.gloss-card-strong {
  background: var(--color-surface-strong);
  backdrop-filter: blur(var(--glass-blur-strong));
  -webkit-backdrop-filter: blur(var(--glass-blur-strong));
}

/* ========================================
   BUTTONS
   ======================================== */

.gloss-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-accent);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px var(--color-accent-glow);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.gloss-btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.gloss-btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 6px 24px var(--color-accent-glow);
  transform: translateY(-1px);
}

.gloss-btn-primary:hover::before {
  opacity: 1;
}

.gloss-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px var(--color-accent-glow);
}

.gloss-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.gloss-btn-primary.gloss-btn-full {
  width: 100%;
}

.gloss-btn-primary.gloss-btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.8125rem;
}

.gloss-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--color-border-strong);
  transition: all var(--transition-fast);
}

.gloss-btn-ghost:hover {
  background: var(--color-surface);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.gloss-btn-ghost.gloss-btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.8125rem;
}

.gloss-btn-ghost.gloss-btn-full {
  width: 100%;
}

/* ========================================
   FORMS
   ======================================== */

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  box-sizing: border-box;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form-group label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

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

.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
  border-color: var(--color-error);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.file-hint {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: var(--space-xs);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  width: 100%;
  box-sizing: border-box;
}

.gloss-btn-full {
  width: 100%;
  box-sizing: border-box;
}

/* Fix for textarea in chat */
.chat-input-wrapper textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* ========================================
   BADGES
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-primary {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

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

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

.badge-error {
  background: var(--color-error-light);
  color: var(--color-error);
}

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

.badge-neutral {
  background: var(--color-surface);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* ========================================
   PUBLIC VIEW — HERO & JOBS
   ======================================== */

.hero {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  margin-bottom: var(--space-xl);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
}

.job-card {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.job-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.job-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.job-card-type {
  flex-shrink: 0;
}

.job-card-description {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
  flex: 1;
}

.job-card-requirements {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  padding-right: var(--space-md);
}

.job-card-requirements li {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.job-card-requirements li::before {
  content: '✓';
  color: var(--color-success);
  font-weight: 600;
  font-size: 0.75rem;
}

.job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.job-card-location {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

.job-card-location::before {
  content: '📍';
  font-size: 0.75rem;
}

/* Application Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-xl);
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-text-light);
  transition: all var(--transition-fast);
}

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

.application-modal {
  position: relative;
}

.application-modal h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

/* ========================================
   CUSTOMER VIEW — AUTH STEP
   ======================================== */

.auth-step {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: var(--space-xl);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-xl);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-logo {
  height: 48px;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.auth-logo-fallback {
  display: none;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-accent);
}

.auth-logo[style*="display: none"] + .auth-logo-fallback {
  display: inline-block !important;
}

.auth-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.auth-subtitle {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.auth-form h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  color: var(--color-text);
}

.auth-toggle {
  text-align: center;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.auth-toggle button {
  font-weight: 500;
}

/* ========================================
   CUSTOMER VIEW — PROFILE STEP
   ======================================== */

.profile-step {
  max-width: 520px;
  margin: 0 auto;
  padding: var(--space-lg);
}

.step-header {
  margin-bottom: var(--space-xl);
}

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all var(--transition-base);
}

.step-dot.active {
  background: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-light);
}

.step-dot.done {
  background: var(--color-success);
}

.step-line {
  flex: 1;
  max-width: 60px;
  height: 2px;
  background: var(--color-border);
}

.step-line:has(+ .step-dot.done) {
  background: var(--color-success);
}

.step-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--space-xs);
}

.step-subtitle {
  text-align: center;
  color: var(--color-text-muted);
}

/* ========================================
   CUSTOMER VIEW — CHAT STEP
   ======================================== */

.chat-step {
  height: calc(100vh - 180px);
  min-height: 600px;
  display: flex;
  align-items: stretch;
}

.chat-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

.chat-sidebar {
  width: 280px;
  flex-shrink: 0;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow-y: auto;
}

.sidebar-section h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
}

.status-badge-container {
  min-height: 32px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.contact-value {
  font-size: 0.875rem;
  color: var(--color-text);
}

.documents-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.document-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.document-item:hover {
  border-color: var(--color-border-strong);
}

.document-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.document-icon.pdf { background: var(--color-error-light); color: var(--color-error); }
.document-icon.image { background: var(--color-success-light); color: var(--color-success); }
.document-icon.doc { background: var(--color-info-light); color: var(--color-info); }
.document-icon.other { background: var(--color-accent-light); color: var(--color-accent); }

.document-info {
  flex: 1;
  min-width: 0;
}

.document-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-size {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.document-link {
  font-size: 0.75rem;
  font-weight: 500;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.chat-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-strong);
  backdrop-filter: blur(var(--glass-blur));
}

.chat-partner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: white;
}

.admin-avatar {
  background: linear-gradient(135deg, var(--color-accent), #6366f1);
}

.customer-avatar {
  background: linear-gradient(135deg, var(--color-success), var(--color-info));
}

.chat-partner strong {
  font-size: 0.9375rem;
  color: var(--color-text);
}

.chat-status {
  font-size: 0.75rem;
  color: var(--color-success);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.chat-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.message {
  display: flex;
  gap: var(--space-md);
  max-width: 85%;
  animation: messageIn var(--transition-base);
}

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

.message.own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.admin {
  align-self: flex-start;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: white;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-bubble {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border);
  box-shadow: var(--glass-shadow);
}

.message.own .message-bubble {
  background: var(--color-accent);
  border-color: transparent;
  color: white;
  border-bottom-right-radius: var(--space-sm);
}

.message.admin .message-bubble {
  border-bottom-left-radius: var(--space-sm);
}

.message-text {
  line-height: 1.5;
  word-wrap: break-word;
}

.message-time {
  font-size: 0.6875rem;
  color: var(--color-text-light);
  margin-top: var(--space-xs);
  text-align: right;
}

.message.own .message-time {
  color: rgba(255, 255, 255, 0.7);
}

.message.admin .message-time {
  text-align: left;
}

/* Message Attachments */
.message-attachment {
  margin-top: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.attachment-item:hover {
  border-color: var(--color-border-strong);
}

.attachment-item.image {
  padding: var(--space-xs);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.attachment-preview {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.attachment-info {
  flex: 1;
  min-width: 0;
}

.attachment-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-size {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.attachment-link {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Chat Input */
.chat-input-area {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-strong);
  backdrop-filter: blur(var(--glass-blur));
}

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: var(--space-md);
}

.chat-input-wrapper {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  position: relative;
}

.chat-attach-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.chat-attach-btn:hover {
  background: var(--color-surface);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.chat-input-wrapper textarea {
  flex: 1;
  min-height: 44px;
  max-height: 160px;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  resize: none;
  line-height: 1.5;
  transition: all var(--transition-fast);
}

.chat-input-wrapper textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.chat-file-preview {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-accent-light);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  color: var(--color-accent);
}

.preview-name {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-size {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.preview-remove {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.preview-remove:hover {
  background: var(--color-accent);
  color: white;
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

/* ========================================
   ADMIN VIEW
   ======================================== */

.admin-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  min-height: 700px;
}

.admin-header {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.admin-title {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.admin-logo {
  height: 36px;
  mix-blend-mode: multiply;
}

.admin-logo-fallback {
  display: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-accent);
}

.admin-logo[style*="display: none"] + .admin-logo-fallback {
  display: inline-block !important;
}

.admin-title h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.kpi-bar {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.kpi-card {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 140px;
}

.kpi-card:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.kpi-card.active {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  margin-bottom: var(--space-xs);
}

.kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.kpi-card.active .kpi-value {
  color: var(--color-accent);
}

.admin-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.admin-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.admin-sidebar {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.admin-tabs {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.admin-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.admin-tab:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

.admin-tab.active {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* Chat list item with unread badge */
.admin-tab .badge {
  font-size: 0.6875rem;
  padding: 2px 6px;
}

.chats-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.chat-list-item {
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.chat-list-item:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--glass-shadow);
}

.chat-list-item.selected {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.chat-list-item.unread {
  border-color: var(--color-warning);
  background: var(--color-warning-light);
}

.chat-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
}

.chat-item-title {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9375rem;
}

.chat-item-unread-badge {
  flex-shrink: 0;
  background: var(--color-error);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.chat-item-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.chat-item-last-message {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.chat-item-time {
  font-size: 0.6875rem;
  color: var(--color-text-light);
}

/* Toast for new messages */
.toast.new-message {
  border-left-color: var(--color-accent);
  background: var(--color-surface-strong);
}

.toast.new-message .toast-message {
  font-weight: 500;
}

.admin-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn var(--transition-fast);
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

/* Lists */
.customer-list,
.application-list,
.job-list,
.staff-list,
.invite-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.list-item {
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.list-item:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--glass-shadow);
}

.list-item.selected {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.list-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
}

.list-item-title {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9375rem;
}

.list-item-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.list-item-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Detail Panel */
.admin-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface);
}

.detail-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
  text-align: center;
  color: var(--color-text-muted);
}

.placeholder-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  opacity: 0.3;
}

.detail-placeholder h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.detail-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
}

.detail-section {
  margin-bottom: var(--space-xl);
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.detail-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.detail-field-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
}

.detail-field-value {
  font-size: 0.875rem;
  color: var(--color-text);
}

/* Admin Chat in Detail */
.admin-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 400px;
}

.admin-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.admin-chat-input {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-strong);
}

.admin-chat-input textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  resize: none;
}

.admin-chat-input textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

/* Status Select */
.status-select {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.status-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

/* ========================================
   MODALS
   ======================================== */

.modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-xl);
}

/* ========================================
   TOASTS
   ======================================== */

.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow-strong);
  backdrop-filter: blur(var(--glass-blur));
  animation: toastIn var(--transition-base);
  min-width: 280px;
  max-width: 420px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 4px solid var(--color-success); }
.toast.error { border-left: 4px solid var(--color-error); }
.toast.warning { border-left: 4px solid var(--color-warning); }
.toast.info { border-left: 4px solid var(--color-info); }

.toast-message {
  flex: 1;
  font-size: 0.875rem;
  color: var(--color-text);
}

.toast-close {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

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

/* ========================================
   UTILITIES
   ======================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
  .chat-sidebar {
    width: 240px;
  }

  .admin-sidebar {
    width: 280px;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-md);
  }

  .chat-step {
    flex-direction: column;
  }

  .chat-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    max-height: 200px;
  }

  .admin-layout {
    height: auto;
    min-height: calc(100vh - 140px);
  }

  .admin-content {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    height: auto;
    max-height: 300px;
  }

  .admin-tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .admin-tab {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .kpi-bar {
    order: -1;
    width: 100%;
  }

  .kpi-card {
    flex: 1;
    min-width: 0;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .main {
    padding: var(--space-lg) var(--space-md);
  }

  .hero {
    padding: var(--space-xl) var(--space-md);
  }

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

  .auth-card,
  .modal,
  .application-modal {
    padding: var(--space-lg);
  }

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

  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    bottom: var(--space-md);
  }

  .toast {
    min-width: 0;
  }
}