@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&family=Space+Mono:wght@400;700&display=swap');

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f0f1f3;
  --bg-hover: #e8eaed;
  --text-primary: #1a1d21;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --accent: #b8956c;
  --accent-light: #d4b896;
  --accent-dark: #9a7a54;
  --success: #34a853;
  --danger: #ea4335;
  --warning: #fbbc04;
  --border: #e0e0e0;
  --border-light: #d0d0d0;
  --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   AUTH SECTION - SPLIT SCREEN DESIGN
   ========================================== */

.auth-split {
  display: flex;
  min-height: 100vh;
  background: #0f1419;
}

/* Left Panel - Branding */
.auth-left {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 50%, #1a1510 100%);
}

.auth-left-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(184, 149, 108, 0.4) 0%, transparent 70%);
  top: -10%;
  left: -10%;
  animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 184, 150, 0.3) 0%, transparent 70%);
  bottom: -5%;
  right: -5%;
  animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(154, 122, 84, 0.35) 0%, transparent 70%);
  top: 50%;
  left: 30%;
  transform: translate(-50%, -50%);
  animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, 50px) scale(1.1); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, -30px) scale(1.05); }
  66% { transform: translate(20px, -50px) scale(0.98); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-45%, -55%) scale(1.15); }
}

/* Floating Shapes */
.auth-left-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.floating-shape {
  position: absolute;
  border: 1px solid rgba(184, 149, 108, 0.2);
  border-radius: 4px;
}

.shape-1 {
  width: 80px;
  height: 80px;
  top: 15%;
  right: 20%;
  transform: rotate(45deg);
  animation: shapeFloat1 12s ease-in-out infinite;
}

.shape-2 {
  width: 40px;
  height: 40px;
  top: 60%;
  right: 15%;
  border-radius: 50%;
  background: rgba(184, 149, 108, 0.1);
  animation: shapeFloat2 10s ease-in-out infinite;
}

.shape-3 {
  width: 120px;
  height: 120px;
  bottom: 20%;
  left: 10%;
  border-radius: 50%;
  border-width: 2px;
  animation: shapeFloat3 15s ease-in-out infinite;
}

.shape-4 {
  width: 60px;
  height: 60px;
  top: 30%;
  left: 20%;
  transform: rotate(15deg);
  animation: shapeFloat4 14s ease-in-out infinite;
}

.shape-5 {
  width: 30px;
  height: 30px;
  bottom: 35%;
  right: 30%;
  background: rgba(184, 149, 108, 0.15);
  border: none;
  animation: shapeFloat5 8s ease-in-out infinite;
}

.floating-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 149, 108, 0.3), transparent);
}

.line-1 {
  width: 200px;
  top: 25%;
  left: 5%;
  transform: rotate(-15deg);
  animation: lineFloat1 20s ease-in-out infinite;
}

.line-2 {
  width: 150px;
  bottom: 30%;
  right: 10%;
  transform: rotate(30deg);
  animation: lineFloat2 18s ease-in-out infinite;
}

.line-3 {
  width: 100px;
  top: 70%;
  left: 40%;
  transform: rotate(-5deg);
  animation: lineFloat3 22s ease-in-out infinite;
}

@keyframes shapeFloat1 {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.6; }
  50% { transform: rotate(50deg) translate(10px, -15px); opacity: 0.8; }
}

@keyframes shapeFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-10px, 20px) scale(1.1); }
}

@keyframes shapeFloat3 {
  0%, 100% { transform: translate(0, 0); opacity: 0.5; }
  50% { transform: translate(20px, -10px); opacity: 0.7; }
}

@keyframes shapeFloat4 {
  0%, 100% { transform: rotate(15deg) translate(0, 0); }
  50% { transform: rotate(20deg) translate(-15px, 10px); }
}

@keyframes shapeFloat5 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(15px, -15px) rotate(45deg); }
}

@keyframes lineFloat1 {
  0%, 100% { transform: rotate(-15deg) scaleX(1); opacity: 0.5; }
  50% { transform: rotate(-12deg) scaleX(1.2); opacity: 0.8; }
}

@keyframes lineFloat2 {
  0%, 100% { transform: rotate(30deg) scaleX(1); opacity: 0.4; }
  50% { transform: rotate(35deg) scaleX(0.8); opacity: 0.6; }
}

@keyframes lineFloat3 {
  0%, 100% { transform: rotate(-5deg) translateX(0); opacity: 0.3; }
  50% { transform: rotate(-8deg) translateX(20px); opacity: 0.5; }
}

/* Left Content */
.auth-left-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
}

.auth-brand {
  margin-bottom: 48px;
  animation: brandFadeIn 1s ease-out 0.2s both;
}

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

.auth-brand-icon {
  color: var(--accent);
  margin-bottom: 20px;
  animation: iconPulse 4s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

.auth-brand-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 48px;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: -1.5px;
  line-height: 1.1;
  text-shadow: 0 2px 20px rgba(184, 149, 108, 0.3);
}

.auth-tagline {
  margin-bottom: 48px;
  animation: taglineFadeIn 1s ease-out 0.4s both;
}

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

.auth-tagline-main {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 32px;
  font-style: italic;
  color: var(--accent-light);
  margin-bottom: 20px;
  letter-spacing: -0.8px;
  line-height: 1.3;
  text-shadow: 0 1px 10px rgba(184, 149, 108, 0.2);
}

.auth-tagline-sub {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  max-width: 420px;
  font-weight: 400;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: featuresFadeIn 1s ease-out 0.6s both;
}

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

.auth-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.auth-feature:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(184, 149, 108, 0.2);
  transform: translateX(8px);
}

.auth-feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(184, 149, 108, 0.15);
  border-radius: 10px;
  color: var(--accent);
  flex-shrink: 0;
}

.auth-feature span {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.auth-left-footer {
  position: absolute;
  bottom: 40px;
  left: 60px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
  font-family: 'Space Mono', monospace;
}

/* Right Panel - Form */
.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-primary);
  position: relative;
}

.auth-right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
}

.auth-right-inner {
  width: 100%;
  max-width: 420px;
  animation: rightPanelFadeIn 0.8s ease-out 0.3s both;
}

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

.auth-card {
  background: var(--bg-primary);
  border-radius: 24px;
  padding: 40px;
}

.auth-card-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-card-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.auth-card-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Progress Steps */
.auth-progress {
  margin-bottom: 32px;
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.step-number {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-step.active .step-number {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(184, 149, 108, 0.4);
}

.progress-step.completed .step-number {
  background: var(--success);
  color: white;
}

.progress-step.completed .step-number::after {
  content: '✓';
  position: absolute;
  font-size: 16px;
}

.progress-step.completed .step-number span {
  opacity: 0;
}

.step-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.progress-step.active .step-label {
  color: var(--accent);
}

.progress-step.completed .step-label {
  color: var(--success);
}

.progress-connector {
  width: 60px;
  height: 2px;
  background: var(--bg-tertiary);
  margin: 0 8px;
  margin-bottom: 24px;
  border-radius: 1px;
  overflow: hidden;
}

.connector-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.connector-fill.active {
  width: 100%;
}

/* Auth Step Animation */
.auth-step {
  animation: stepSlideIn 0.4s ease-out;
}

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

/* Form Styles */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  pointer-events: none;
}

.input-wrapper input {
  padding-left: 52px;
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--accent);
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Code Input Digits */
.code-inputs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 8px;
}

.code-digit {
  width: 52px;
  height: 64px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  font-family: 'Space Mono', monospace;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: all 0.3s ease;
  padding: 0;
}

.code-digit:focus {
  border-color: var(--accent);
  background: var(--bg-primary);
  box-shadow: 0 0 0 4px rgba(184, 149, 108, 0.1);
  outline: none;
}

.code-digit.filled {
  border-color: var(--accent);
  background: rgba(184, 149, 108, 0.05);
}

/* Password Toggle */
.password-toggle {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  padding: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  width: auto;
}

.password-toggle:hover {
  color: var(--text-secondary);
}

/* Auth Button */
.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  padding: 18px 24px;
  margin-top: 8px;
}

.btn-auth svg {
  transition: transform 0.3s ease;
}

.btn-auth:hover svg {
  transform: translateX(4px);
}

.btn-auth:disabled svg {
  animation: none;
}

/* Back Link */
.btn-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.btn-link svg {
  transition: transform 0.3s ease;
}

.btn-link:hover svg {
  transform: translateX(-4px);
}

/* Auth Footer */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
}

.auth-footer p {
  font-size: 12px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

.auth-footer a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}



/* Responsive - Mobile */
@media (max-width: 1024px) {
  .auth-split {
    flex-direction: column;
  }

  .auth-left {
    padding: 40px 30px;
    min-height: auto;
  }

  .auth-left-content {
    max-width: 100%;
  }

  .auth-brand-name {
    font-size: 32px;
  }

  .auth-tagline-main {
    font-size: 22px;
  }

  .auth-features {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .auth-feature {
    flex: 1;
    min-width: 200px;
  }

  .auth-left-footer {
    display: none;
  }

  .auth-right {
    padding: 30px 20px;
  }

  .auth-card {
    padding: 30px 24px;
  }
}

@media (max-width: 640px) {
  .auth-left {
    padding: 30px 20px;
  }

  .auth-brand-name {
    font-size: 28px;
  }

  .auth-tagline {
    margin-bottom: 32px;
  }

  .auth-tagline-main {
    font-size: 20px;
  }

  .auth-tagline-sub {
    font-size: 14px;
  }

  .auth-features {
    display: none;
  }

  .floating-shape,
  .floating-line {
    display: none;
  }

  .progress-connector {
    width: 40px;
  }

  .code-digit {
    width: 44px;
    height: 56px;
    font-size: 20px;
  }

  .code-inputs {
    gap: 8px;
  }
}

.form-group {
  margin-bottom: 24px;
  position: relative;
  text-align: left;
}

.input-label {
  position: absolute;
  top: -8px;
  left: 12px;
  background: var(--bg-primary);
  padding: 0 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  transition: color 0.2s;
}

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

input, textarea {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  background: transparent;
  color: var(--text-primary);
  transition: all 0.3s ease;
  font-family: inherit;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 168, 124, 0.1);
}

input:focus + .input-label {
  color: var(--accent);
}

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

.code-input {
  text-align: center;
  font-size: 24px;
  letter-spacing: 8px;
  font-weight: 500;
}

textarea {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
}

button {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201, 168, 124, 0.25);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  margin-top: 12px;
}

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

.btn-link {
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  padding: 12px;
  margin-top: 8px;
}

.btn-link:hover {
  color: var(--text-secondary);
}

.alert {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  animation: alertSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 14px;
  font-weight: 500;
  font-size: 13px;
  text-align: left;
  animation: alertFadeIn 0.3s ease-out;
}

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

.alert-success {
  background: rgba(122, 194, 154, 0.1);
  color: var(--success);
  border: 1px solid rgba(122, 194, 154, 0.2);
}

.alert-error {
  background: rgba(229, 115, 115, 0.1);
  color: var(--danger);
  border: 1px solid rgba(229, 115, 115, 0.2);
}

.alert-info {
  background: rgba(201, 168, 124, 0.1);
  color: var(--accent);
  border: 1px solid rgba(201, 168, 124, 0.2);
}

.input-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

.hidden {
  display: none !important;
}

/* Main App Layout */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Panel shared styles */
.panel {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.panel-header .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar */
.panel-content::-webkit-scrollbar {
  width: 6px;
}

.panel-content::-webkit-scrollbar-track {
  background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

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

/* ============================================
   Light Sidebar
   ============================================ */

/* Sidebar variables - Light Theme */
:root {
  --sidebar-bg: #f7f7f8;
  --sidebar-bg-hover: #ececef;
  --sidebar-bg-active: #e3e3e6;
  --sidebar-border: #e0e0e0;
  --sidebar-text: #1a1a1a;
  --sidebar-text-muted: #6b6b6b;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 56px;
}

/* Sidebar Toggle Button (external - hidden, we use inline) */
.sidebar-toggle-btn {
  display: none;
}

/* Main Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.app-container.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

/* Hide text labels when collapsed */
.app-container.sidebar-collapsed .sidebar-logo span,
.app-container.sidebar-collapsed .new-job-btn span,
.app-container.sidebar-collapsed .sidebar-section-label,
.app-container.sidebar-collapsed .job-item-content,
.app-container.sidebar-collapsed .menu-trigger,
.app-container.sidebar-collapsed .sidebar-user-info,
.app-container.sidebar-collapsed .sidebar-menu-btn {
  display: none;
}

/* Adjust elements when collapsed */
.app-container.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 12px 8px;
}

.app-container.sidebar-collapsed .sidebar-logo {
  display: none;
}

.app-container.sidebar-collapsed .sidebar-collapse-btn {
  width: 40px;
  height: 40px;
}

.app-container.sidebar-collapsed .sidebar-section {
  padding: 0 8px;
}

.app-container.sidebar-collapsed .new-job-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  margin: 0 auto;
}

.app-container.sidebar-collapsed .job-item {
  justify-content: center;
  padding: 8px;
}

.app-container.sidebar-collapsed .job-item-icon {
  width: 40px;
  height: 40px;
}

.app-container.sidebar-collapsed .job-initial {
  font-size: 14px;
}

.app-container.sidebar-collapsed .sidebar-footer {
  padding: 8px;
}

.app-container.sidebar-collapsed .sidebar-user {
  justify-content: center;
  padding: 8px;
}

.app-container.sidebar-collapsed .sidebar-user-avatar {
  width: 36px;
  height: 36px;
}

/* Tooltips for collapsed state */
.app-container.sidebar-collapsed .new-job-btn,
.app-container.sidebar-collapsed .job-item,
.app-container.sidebar-collapsed .sidebar-user {
  position: relative;
}

.app-container.sidebar-collapsed .new-job-btn::after,
.app-container.sidebar-collapsed .job-item::after,
.app-container.sidebar-collapsed .sidebar-user::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  background: var(--sidebar-text);
  color: white;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 1000;
  pointer-events: none;
}

.app-container.sidebar-collapsed .new-job-btn:hover::after,
.app-container.sidebar-collapsed .job-item:hover::after,
.app-container.sidebar-collapsed .sidebar-user:hover::after,
.app-container.sidebar-collapsed .ai-assistant-btn:hover::after {
  opacity: 1;
  visibility: visible;
}

/* AI Assistant button collapsed state */
.app-container.sidebar-collapsed .ai-assistant-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  margin: 0 auto;
  position: relative;
}

.app-container.sidebar-collapsed .ai-assistant-btn span {
  display: none;
}

.app-container.sidebar-collapsed .ai-assistant-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  background: var(--sidebar-text);
  color: white;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 1000;
  pointer-events: none;
}

.app-container.sidebar-collapsed .sidebar-divider {
  margin: 8px auto;
  width: 32px;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.sidebar-logo:hover {
  opacity: 0.7;
}

.sidebar-logo svg {
  color: var(--accent);
}

.sidebar-collapse-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--sidebar-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text);
}

/* Sidebar Content */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: var(--sidebar-border);
  border-radius: 3px;
}

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

/* Sidebar Section */
.sidebar-section {
  padding: 0 8px;
  margin-bottom: 8px;
}

.sidebar-section-label {
  padding: 8px 8px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* New Job Button */
.new-job-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.new-job-btn:hover {
  background: var(--sidebar-bg-hover);
  border-color: var(--text-muted);
}

.new-job-btn svg {
  flex-shrink: 0;
  color: var(--accent);
}

/* Jobs List */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--sidebar-text-muted);
  font-size: 12px;
  text-align: center;
}

/* Job Item (Chat-style) */
.job-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  text-align: left;
  width: 100%;
}

.job-item:hover {
  background: var(--sidebar-bg-hover);
}

.job-item.active {
  background: var(--sidebar-bg-active);
}

.job-item-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-family: 'Inter', -apple-system, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Initial text style */
.job-initial {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Color palette - warm bronze/gold variations with rich depth */
.job-item-icon.color-0 {
  background: linear-gradient(145deg, #c9a66b 0%, #a67c42 100%);
}

.job-item-icon.color-1 {
  background: linear-gradient(145deg, #6b9dc9 0%, #4272a6 100%);
}

.job-item-icon.color-2 {
  background: linear-gradient(145deg, #8bc96b 0%, #5ca642 100%);
}

.job-item-icon.color-3 {
  background: linear-gradient(145deg, #c96b8b 0%, #a6425c 100%);
}

.job-item-icon.color-4 {
  background: linear-gradient(145deg, #9b6bc9 0%, #7242a6 100%);
}

/* Activity dot - pulsing indicator for active conversations */
.job-activity-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--sidebar-bg);
  animation: activity-pulse 2s ease-in-out infinite;
}

@keyframes activity-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
  }
}

/* Hover effect */
.job-item:hover .job-item-icon {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Active state - inverted elegant style */
.job-item.active .job-item-icon {
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 149, 108, 0.15);
}

.job-item.active .job-initial {
  color: var(--accent);
  text-shadow: none;
}

.job-item.active .job-activity-dot {
  border-color: var(--bg-primary);
}

.job-item-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.job-item .job-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.job-item .job-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--sidebar-text-muted);
}

.job-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--sidebar-text-muted);
}

/* Menu trigger button (three dots) */
.menu-trigger {
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--sidebar-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  flex-shrink: 0;
}

.job-item:hover .menu-trigger,
.conv-item:hover .menu-trigger {
  opacity: 1;
}

.menu-trigger:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--sidebar-text);
  transform: scale(1.1);
}

.menu-trigger:active {
  transform: scale(0.95);
}

/* Context menu */
.context-menu {
  position: fixed;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 10px 20px -5px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 6px;
  min-width: 180px;
  z-index: 100000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.context-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.context-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.context-menu-item svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.context-menu-item:hover {
  background: var(--bg-secondary);
}

.context-menu-item:hover svg {
  opacity: 1;
}

.context-menu-item:active {
  transform: scale(0.98);
}

.context-menu-item.danger {
  color: #ef4444;
}

.context-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.08);
}

.context-menu-item.danger svg {
  stroke: #ef4444;
}

/* Separator in context menu */
.context-menu-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 8px;
  position: relative;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-user:hover {
  background: var(--sidebar-bg-hover);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg-active);
  border-radius: 6px;
  color: var(--sidebar-text-muted);
}

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

.sidebar-user-phone {
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Sidebar Footer Button (Integrations) */
.sidebar-footer-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: transparent;
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-footer-btn:hover {
  background: var(--sidebar-bg-hover);
  border-color: var(--sidebar-bg-active);
}

.sidebar-footer-btn svg {
  color: var(--sidebar-text-muted);
  transition: color 0.15s ease;
}

.sidebar-footer-btn:hover svg {
  color: var(--accent);
}

/* Hide button text when sidebar collapsed */
.app-container.sidebar-collapsed .sidebar-footer-btn span {
  display: none;
}

.app-container.sidebar-collapsed .sidebar-footer-btn {
  justify-content: center;
  padding: 10px;
}

.sidebar-menu-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--sidebar-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.sidebar-menu-btn:hover {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-text);
}

/* User Dropdown Menu */
.sidebar-user-menu {
  position: absolute;
  bottom: 100%;
  left: 8px;
  right: 8px;
  margin-bottom: 4px;
  background: var(--bg-primary);
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  z-index: 10;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.sidebar-menu-item:hover {
  background: var(--sidebar-bg-hover);
}

.sidebar-menu-item svg {
  color: var(--sidebar-text-muted);
}

.sidebar-menu-item:hover svg {
  color: var(--danger);
}

.sidebar-menu-item:hover {
  color: var(--danger);
}

/* Legacy support - hide old elements */
.jobs-panel,
.user-bar {
  display: none !important;
}

/* Add button in conversations panel */
.add-job-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin: 16px 0;
}

.add-job-btn:hover {
  background: var(--accent-dark);
}

/* Conversations Panel (Middle) */
.conversations-panel {
  width: 300px;
  flex-shrink: 0;
  background: var(--bg-primary);
}

.conversations-panel .panel-header {
  padding: 12px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.conversations-panel .panel-header h2 {
  font-size: 15px;
  margin-bottom: 2px;
}

.conversations-panel .panel-header .subtitle {
  font-size: 12px;
}

.search-box {
  padding: 8px 12px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.search-box input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
}

.search-box input:focus {
  border-color: var(--accent);
  background: var(--bg-primary);
}

/* Conversation item - compact design */
.conv-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

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

.conv-item.active {
  background: var(--bg-tertiary);
}

/* Avatar with status indicator */
.conv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.conv-avatar.interested {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
}

.conv-avatar.scheduled {
  background: linear-gradient(135deg, #ffe082 0%, var(--warning) 100%);
}

.conv-avatar.agreed {
  background: linear-gradient(135deg, #81c995 0%, var(--success) 100%);
}

.conv-avatar.declined {
  background: linear-gradient(135deg, #f28b82 0%, var(--danger) 100%);
}

/* AI indicator dot */
.conv-avatar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  background: var(--text-muted);
}

.conv-item:hover .conv-avatar::after,
.conv-item.active .conv-avatar::after {
  border-color: var(--bg-secondary);
}

.conv-item.active .conv-avatar::after {
  border-color: var(--bg-tertiary);
}

.conv-avatar.ai-on::after {
  background: var(--success);
}

/* Conversation content */
.conv-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.conv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.conv-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-time {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.conv-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.conv-username {
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.conv-status-dot.interested {
  background: var(--accent);
}

.conv-status-dot.scheduled {
  background: var(--warning);
}

.conv-status-dot.pulse {
  animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.conv-action-label {
  font-size: 10px;
  font-weight: 600;
  color: #e6a800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.conv-status-dot.agreed {
  background: var(--success);
}

.conv-status-dot.declined {
  background: var(--danger);
}

/* Hide old footer, we use avatar indicators now */
.conv-footer {
  display: none;
}

/* Badges - smaller */
.ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ai-badge.on {
  background: rgba(129, 201, 149, 0.15);
  color: var(--success);
}

.ai-badge.off {
  background: rgba(95, 99, 104, 0.1);
  color: var(--text-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
}

/* Compact empty state for conversations */
.empty-state.compact {
  padding: 32px 20px;
}

.empty-state.compact .empty-state-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.empty-state.compact .empty-state-title {
  font-size: 14px;
  margin-bottom: 4px;
}

.empty-state.compact .empty-state-text {
  font-size: 12px;
}

/* New conversation button container */
#new-conv-btn-container {
  padding: 8px 12px !important;
  border-top: 1px solid var(--border) !important;
}

#new-conv-btn-container .add-job-btn {
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 6px;
}

.status-badge.agreed {
  background: rgba(129, 201, 149, 0.2);
  color: var(--success);
}

.status-badge.declined {
  background: rgba(242, 139, 130, 0.2);
  color: #f28b82;
}

/* Chat Panel (Right) */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  min-width: 0;
}

/* Compact Chat Header */
.chat-header {
  padding: 10px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.chat-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.chat-avatar.agreed {
  background: linear-gradient(135deg, #81c995 0%, var(--success) 100%);
}

.chat-avatar.declined {
  background: linear-gradient(135deg, #f28b82 0%, var(--danger) 100%);
}

.chat-details {
  min-width: 0;
  flex: 1;
}

.chat-info .chat-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-info .chat-username {
  font-size: 12px;
  color: var(--text-muted);
}

.chat-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Chat Status Badge */
.chat-status-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: help;
  transition: all 0.15s ease;
}

.chat-status-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.chat-status-badge.active {
  background: rgba(95, 99, 104, 0.1);
  color: var(--text-secondary);
}

.chat-status-badge.active .status-dot {
  background: var(--accent);
  animation: pulse 2s infinite;
}

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

.chat-status-badge.interested {
  background: rgba(184, 149, 108, 0.15);
  color: var(--accent);
}

.chat-status-badge.interested .status-dot {
  background: var(--accent);
  animation: pulse 2s infinite;
}

.chat-status-badge.scheduled {
  background: rgba(251, 188, 4, 0.15);
  color: #e6a800;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 188, 4, 0); }
  50% { box-shadow: 0 0 0 4px rgba(251, 188, 4, 0.15); }
}

.chat-status-badge.scheduled .status-dot {
  background: var(--warning);
  animation: dotPulse 1.5s ease-in-out infinite;
}

.chat-status-badge.agreed {
  background: rgba(129, 201, 149, 0.15);
  color: var(--success);
}

.chat-status-badge.agreed .status-dot {
  background: var(--success);
}

.chat-status-badge.declined {
  background: rgba(242, 139, 130, 0.15);
  color: #e57373;
}

.chat-status-badge.declined .status-dot {
  background: #e57373;
}

.chat-status-badge:hover {
  transform: scale(1.02);
}

/* Global tooltip element */
.global-tooltip {
  position: fixed;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 99999;
  pointer-events: none;
}

.global-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

/* Compact AI Toggle */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-secondary);
  border-radius: 20px;
  border: 1px solid var(--border);
}

.toggle-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.toggle {
  width: 36px;
  height: 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle.active {
  background: var(--success);
  border-color: var(--success);
}

.toggle::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle.active::after {
  transform: translateX(16px);
}

/* Action Banner (scheduled status) */
.chat-action-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  animation: bannerSlideIn 0.3s ease-out;
}

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

.scheduled-banner {
  background: linear-gradient(135deg, rgba(251, 188, 4, 0.08) 0%, rgba(251, 188, 4, 0.03) 100%);
  border-bottom-color: rgba(251, 188, 4, 0.2);
}

.banner-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(251, 188, 4, 0.12);
  color: #e6a800;
  flex-shrink: 0;
  margin-top: 1px;
}

.banner-content {
  flex: 1;
}

.banner-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.banner-hint {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Scheduled input notice */
.input-status-notice.scheduled-notice {
  background: rgba(251, 188, 4, 0.08);
  color: #b8860b;
}

.input-status-notice.scheduled-notice svg {
  color: #e6a800;
}

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-secondary);
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Message Bubbles - Compact */
.message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  animation: messageIn 0.2s ease-out;
}

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

.message.user {
  align-self: flex-end;
}

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

.message-bubble {
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}

.message.assistant .message-bubble {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.message.user .message-bubble {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

/* Telegram-style text formatting */
.message-bubble strong {
  font-weight: 600;
  color: inherit;
}

.message-bubble em {
  font-style: italic;
  color: inherit;
}

.message-bubble code {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Courier New', monospace;
  font-size: 12px;
  color: inherit;
  white-space: nowrap;
}

.message.user .message-bubble code {
  background: rgba(0, 0, 0, 0.15);
}

.message-bubble .code-block {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 6px 0;
  overflow-x: auto;
  display: block;
}

.message.user .message-bubble .code-block {
  background: rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.2);
}

.message-bubble .code-block code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre;
  display: block;
}

.message-bubble a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  transition: text-decoration-color 0.15s ease;
}

.message.assistant .message-bubble a {
  color: var(--accent);
  text-decoration-color: var(--accent);
  opacity: 0.9;
}

.message-bubble a:hover {
  text-decoration-color: currentColor;
  opacity: 1;
}

/* Message time - inline */
.message-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.message.user .message-time {
  justify-content: flex-end;
  color: var(--text-muted);
}

.message.assistant .message-time {
  justify-content: flex-start;
}

/* Message status checkmarks - smaller */
.message-status {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
}

.message-status svg {
  width: 12px;
  height: 12px;
}

.message-status.pending {
  color: var(--text-muted);
  opacity: 0.6;
}

.message-status.sent {
  color: var(--text-muted);
}

.message-status.just-sent {
  animation: status-pop 0.3s ease-out;
}

@keyframes status-pop {
  0% { transform: scale(1.4); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.message-status.read {
  color: var(--success);
}

.message-status.read svg:last-child {
  margin-left: -6px;
}

/* Grouped messages - reduce gap between same sender */
.message + .message.user,
.message.user + .message.user {
  margin-top: -4px;
}

.message + .message.assistant,
.message.assistant + .message.assistant {
  margin-top: -4px;
}

/* Compact Input Area */
.chat-input-area {
  padding: 12px 16px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Mode Selector (AI / Manual toggle) */
.input-mode-selector {
  display: flex;
  gap: 6px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.mode-btn.active svg {
  color: white;
}

.mode-btn svg {
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.mode-btn:hover svg {
  color: var(--text-primary);
}

.mode-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-tertiary);
}

.mode-btn:disabled:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Status notice for finished conversations */
.input-status-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(95, 99, 104, 0.08);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.input-status-notice svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

/* Input row */
.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.chat-input-wrapper:focus-within {
  border-color: var(--accent);
  background: var(--bg-primary);
}

.chat-input-wrapper.disabled {
  opacity: 0.6;
  background: var(--bg-tertiary);
}

.chat-input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 18px;
  padding: 6px 0;
  min-height: 18px;
  max-height: 100px;
  resize: none;
  font-family: inherit;
  outline: none;
}

.chat-input-wrapper textarea:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.chat-input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

/* Send Button inside wrapper */
.send-btn {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.send-btn svg {
  width: 16px;
  height: 16px;
}

.send-btn:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: scale(1.05);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

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

/* Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state-text {
  font-size: 14px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 29, 33, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-primary);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: none;
}

/* Enhanced Job Modal */
.job-modal {
  max-width: 680px;
  background: var(--bg-primary);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.modal-header {
  padding: 28px 28px 24px;
  background: var(--bg-primary);
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-header-content {
  flex: 1;
}

.modal-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.modal-subtitle {
  display: none;
}

.close-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  margin-left: 16px;
}

.close-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

.close-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  transform: rotate(90deg);
}

.close-btn:active {
  transform: rotate(90deg) scale(0.9);
}

.modal-content {
  padding: 0 28px 28px;
  max-height: calc(90vh - 180px);
  overflow-y: auto;
  background: var(--bg-primary);
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

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

.modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Form Sections */
.form-section {
  margin-bottom: 28px;
  background: transparent;
}

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

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 0;
  border-bottom: none;
}

.section-icon {
  display: none;
}

.section-number {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  padding: 0;
  border-radius: 0;
  letter-spacing: 0.05em;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Form Elements */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 7px;
  letter-spacing: -0.005em;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(184, 149, 108, 0.08);
}

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

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

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  font-style: italic;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Modal Footer */
.modal-footer {
  padding: 20px 28px 24px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-footer button {
  width: auto;
  padding: 11px 24px;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.005em;
}

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

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

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 149, 108, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary .btn-icon {
  transition: transform 0.2s ease;
}

.btn-primary:hover .btn-icon {
  transform: translateX(2px);
}

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

.btn-spinner {
  animation: spin 0.8s linear infinite;
}

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

.btn-primary.loading {
  background: var(--accent);
  border-color: var(--accent);
}

/* Responsive Styles */
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .job-modal {
    width: 95%;
    max-width: 95%;
  }

  .modal-header {
    padding: 24px 20px 20px;
  }

  .modal-title {
    font-size: 24px;
  }

  .modal-content {
    padding: 20px;
  }

  .modal-footer {
    padding: 16px 20px;
    flex-direction: column-reverse;
  }

  .modal-footer button {
    width: 100%;
  }

  .section-label {
    flex-wrap: wrap;
  }
}

/* Candidate Modal */
.candidate-modal {
  max-width: 500px;
}

.candidate-modal .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.candidate-detail-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.candidate-detail-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.candidate-detail-row strong {
  color: var(--text-muted);
  margin-right: 8px;
}

.candidate-detail-section {
  margin-top: 16px;
}

.candidate-detail-section strong {
  display: block;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(66, 133, 244, 0.1);
  border-radius: 12px;
  font-size: 12px;
  color: var(--accent);
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.experience-item {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
}

.exp-company {
  font-size: 13px;
  font-weight: 500;
}

.exp-position {
  font-size: 12px;
  color: var(--text-muted);
}

.resume-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
}

.resume-link:hover {
  background: rgba(59, 130, 246, 0.15);
}

/* Sidebar button active state */
.sidebar-footer-btn.active {
  background: var(--sidebar-bg-active);
  border-color: var(--accent);
}

.sidebar-footer-btn.active svg {
  color: var(--accent);
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  z-index: 100000;
  opacity: 0;
  transition: all 0.2s ease;
}

.toast-notification.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-notification.toast-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.toast-notification.toast-error {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.toast-notification.toast-info {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* User info bar */
.user-bar {
  padding: 12px 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-phone {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.logout-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  width: auto;
  border-radius: 4px;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(242, 139, 130, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
  .conversations-panel {
    width: 280px;
  }
}

@media (max-width: 900px) {
  .conversations-panel {
    width: 260px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 200;
    box-shadow: 4px 0 16px rgba(0,0,0,0.1);
  }

  .conversations-panel {
    position: fixed;
    left: var(--sidebar-collapsed-width);
    top: 0;
    z-index: 150;
    width: calc(100% - var(--sidebar-collapsed-width));
    max-width: 340px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }

  .app-container.sidebar-collapsed .conversations-panel {
    left: var(--sidebar-collapsed-width);
  }

  .conversations-panel.mobile-open {
    transform: translateX(0);
  }

  .chat-panel {
    width: 100%;
  }
}

/* ==========================================
   AI ASSISTANT PAGE - Premium Design
   ========================================== */

/* AI Assistant Button in Sidebar - Compact Style */
.ai-assistant-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-assistant-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-light);
}

.ai-assistant-btn.active {
  background: rgba(184, 149, 108, 0.1);
  border-color: var(--accent);
}

.ai-assistant-btn svg {
  color: var(--accent);
  flex-shrink: 0;
}

.ai-assistant-btn span {
  letter-spacing: 0.2px;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 12px 0;
}

/* AI Assistant Page - Split Layout */
.assistant-page {
  flex: 1;
  display: flex;
  background: var(--bg-secondary);
  overflow: hidden;
}

/* Left sidebar with dialogs */
.assistant-sidebar {
  width: 280px;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
}

.assistant-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

.assistant-sidebar-header h2 {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.assistant-sidebar-header .back-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.assistant-sidebar-header .back-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.new-dialog-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.new-dialog-btn:hover {
  background: var(--accent-dark);
}

/* Dialogs list */
.assistant-dialogs-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.assistant-dialog-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.assistant-dialog-item:hover {
  background: var(--bg-secondary);
}

.assistant-dialog-item.active {
  background: rgba(184, 149, 108, 0.1);
}

.assistant-dialog-item .dialog-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 8px;
  color: var(--accent);
  flex-shrink: 0;
}

.assistant-dialog-item .dialog-info {
  flex: 1;
  min-width: 0;
}

.assistant-dialog-item .dialog-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.assistant-dialog-item .dialog-time {
  font-size: 10px;
  color: var(--text-muted);
}

/* Chat panel (right side) */
.assistant-chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  min-width: 0;
}

.assistant-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.assistant-chat-header .chat-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Chat messages container */
.assistant-chat-panel .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-secondary);
}

/* Welcome message */
.assistant-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

.assistant-welcome .welcome-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 14px;
  margin-bottom: 16px;
  color: var(--accent);
}

.assistant-welcome .welcome-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.assistant-welcome .welcome-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 280px;
}

/* Quick action buttons */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
  max-width: 400px;
}

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 8px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.quick-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(184, 149, 108, 0.05);
  transform: translateY(-1px);
}

.quick-action-btn:active {
  transform: translateY(0);
}

.quick-action-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.quick-action-btn:hover svg {
  opacity: 1;
}

/* Input area */
.assistant-input-area {
  padding: 12px 16px 16px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.assistant-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
}

.assistant-input-wrapper:focus-within {
  border-color: var(--accent);
}

.assistant-input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 20px;
  padding: 6px 0;
  min-height: 20px;
  max-height: 120px;
  resize: none;
  font-family: inherit;
  outline: none;
}

.assistant-input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

.assistant-input-wrapper .send-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.assistant-input-wrapper .send-btn:hover:not(:disabled) {
  background: var(--accent-dark);
}

.assistant-input-wrapper .send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading indicator for AI response */
.assistant-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border-radius: 16px;
  border: 1px solid var(--border);
  max-width: fit-content;
  animation: messageIn 0.2s ease-out;
}

.assistant-typing .dots {
  display: flex;
  gap: 4px;
}

.assistant-typing .dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: typingDot 1.4s infinite ease-in-out;
}

.assistant-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.assistant-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.assistant-typing span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Assistant message styling */
.assistant-chat-panel .message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  animation: messageIn 0.2s ease-out;
}

.assistant-chat-panel .message.user {
  align-self: flex-end;
}

.assistant-chat-panel .message.assistant {
  align-self: flex-start;
}

.assistant-chat-panel .message .message-bubble {
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.assistant-chat-panel .message.user .message-bubble {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.assistant-chat-panel .message.assistant .message-bubble {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.assistant-chat-panel .message .message-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  padding: 0 2px;
}

.assistant-chat-panel .message.user .message-time {
  text-align: right;
}

/* Markdown in assistant messages */
.assistant-chat-panel .message.assistant .message-bubble strong {
  font-weight: 600;
}

.assistant-chat-panel .message.assistant .message-bubble em {
  font-style: italic;
}

.assistant-chat-panel .message.assistant .message-bubble code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
}

.assistant-chat-panel .message.assistant .message-bubble .code-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  overflow-x: auto;
}

.assistant-chat-panel .message.assistant .message-bubble .code-block code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
}

.assistant-chat-panel .message.assistant .message-bubble h3,
.assistant-chat-panel .message.assistant .message-bubble h4 {
  font-weight: 600;
  margin: 12px 0 6px 0;
  color: var(--text-primary);
}

.assistant-chat-panel .message.assistant .message-bubble h3 {
  font-size: 14px;
}

.assistant-chat-panel .message.assistant .message-bubble h4 {
  font-size: 13px;
}

.assistant-chat-panel .message.assistant .message-bubble h3:first-child,
.assistant-chat-panel .message.assistant .message-bubble h4:first-child {
  margin-top: 0;
}

.assistant-chat-panel .message.assistant .message-bubble ul,
.assistant-chat-panel .message.assistant .message-bubble ol {
  margin: 8px 0;
  padding-left: 20px;
}

.assistant-chat-panel .message.assistant .message-bubble li {
  margin: 4px 0;
  line-height: 1.4;
}

.assistant-chat-panel .message.assistant .message-bubble a {
  color: var(--accent);
  text-decoration: none;
}

.assistant-chat-panel .message.assistant .message-bubble a:hover {
  text-decoration: underline;
}

/* Markdown Tables */
.assistant-chat-panel .message.assistant .message-bubble .table-wrapper {
  overflow-x: auto;
  margin: 12px 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
}

.assistant-chat-panel .message.assistant .message-bubble .md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}

.assistant-chat-panel .message.assistant .message-bubble .md-table th,
.assistant-chat-panel .message.assistant .message-bubble .md-table td {
  padding: 10px 14px;
  vertical-align: top;
  line-height: 1.45;
  border-right: 1px solid var(--border);
}

.assistant-chat-panel .message.assistant .message-bubble .md-table th:last-child,
.assistant-chat-panel .message.assistant .message-bubble .md-table td:last-child {
  border-right: none;
}

.assistant-chat-panel .message.assistant .message-bubble .md-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.assistant-chat-panel .message.assistant .message-bubble .md-table td {
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  word-break: break-word;
  min-width: 80px;
  max-width: 300px;
}

/* Short content cells - compact */
.assistant-chat-panel .message.assistant .message-bubble .md-table td:empty,
.assistant-chat-panel .message.assistant .message-bubble .md-table td.narrow {
  min-width: 60px;
  white-space: nowrap;
}

.assistant-chat-panel .message.assistant .message-bubble .md-table tbody tr:last-child td {
  border-bottom: none;
}

.assistant-chat-panel .message.assistant .message-bubble .md-table tbody tr:hover {
  background: rgba(184, 149, 108, 0.05);
}

/* Zebra striping for readability */
.assistant-chat-panel .message.assistant .message-bubble .md-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

.assistant-chat-panel .message.assistant .message-bubble .md-table tbody tr:nth-child(even):hover {
  background: rgba(184, 149, 108, 0.05);
}

.assistant-chat-panel .message.assistant .message-bubble .md-table th:first-child,
.assistant-chat-panel .message.assistant .message-bubble .md-table td:first-child {
  padding-left: 16px;
}

.assistant-chat-panel .message.assistant .message-bubble .md-table th:last-child,
.assistant-chat-panel .message.assistant .message-bubble .md-table td:last-child {
  padding-right: 16px;
}

/* Empty sidebar state */
.assistant-dialogs-list .sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  gap: 8px;
}

.assistant-dialogs-list .sidebar-empty svg {
  opacity: 0.3;
  margin-bottom: 4px;
}

.assistant-dialogs-list .sidebar-empty span {
  font-size: 12px;
}

.assistant-dialogs-list .sidebar-empty span:last-child {
  font-size: 11px;
  opacity: 0.7;
}

/* Responsive for assistant page */
@media (max-width: 768px) {
  .assistant-sidebar {
    width: 100%;
    max-width: 280px;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 10;
  }

  .assistant-chat-panel {
    width: 100%;
  }

  .assistant-chat-panel .message {
    max-width: 85%;
  }

  .assistant-chat-panel .chat-messages {
    padding: 12px;
  }

  .assistant-input-area {
    padding: 10px 12px 12px;
  }
}

/* ==========================================
   TOOL ARTIFACTS - Claude-inspired Design
   ========================================== */

.tool-artifact {
  margin: 12px 0;
  max-width: 400px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tool-artifact:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tool-artifact.error {
  background: #fef2f2;
  border-color: #fecaca;
  cursor: default;
}

.tool-artifact.error:hover {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tool-artifact.empty {
  cursor: default;
}

.tool-artifact.empty:hover {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tool-artifact.has-errors {
  border-color: #fde68a;
}

/* Artifact Header */
.artifact-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
}

.artifact-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  flex-shrink: 0;
}

.artifact-indicator.success {
  background: #22c55e;
}

.artifact-indicator.warning {
  background: #f59e0b;
}

.tool-artifact.error .artifact-indicator {
  background: #ef4444;
}

.artifact-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex: 1;
}

.artifact-count {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  font-feature-settings: 'tnum';
}

.artifact-action {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent, #b8956c);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tool-artifact:hover .artifact-action {
  opacity: 1;
}

/* Artifact Body */
.artifact-body {
  padding: 10px 12px;
}

.artifact-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 2px 0;
  line-height: 1.3;
}

.artifact-meta {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.artifact-summary {
  margin: 0 0 10px 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
}

.artifact-summary strong {
  font-weight: 600;
  color: #111827;
}

.artifact-stats {
  font-size: 12px;
  color: #9ca3af;
  font-feature-settings: 'tnum';
  margin-left: 6px;
}

.artifact-empty-text {
  font-size: 12px;
  color: #9ca3af;
  margin: 0;
}

.artifact-error-text {
  font-size: 12px;
  color: #dc2626;
  margin: 0;
}

/* Artifact List */
.artifact-list {
  display: flex;
  flex-direction: column;
  border: 1px solid #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
}

.artifact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #fafafa;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.1s ease;
}

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

.artifact-row:hover {
  background: #f3f4f6;
}

.artifact-row.failed {
  background: #fef2f2;
}

.artifact-row.failed:hover {
  background: #fee2e2;
}

.artifact-row.agreed .artifact-row-status {
  color: #22c55e;
}

.artifact-row.declined .artifact-row-status {
  color: #ef4444;
}

.artifact-row.active .artifact-row-status {
  color: #d1d5db;
}

.artifact-row-status {
  width: 14px;
  text-align: center;
  font-size: 11px;
  color: #22c55e;
  flex-shrink: 0;
  font-weight: 600;
}

.artifact-row.failed .artifact-row-status {
  color: #ef4444;
}

.artifact-row-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #374151;
  font-size: 12px;
}

.artifact-row-count {
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
  font-feature-settings: 'tnum';
  min-width: 20px;
  text-align: right;
}

.artifact-row-error {
  font-size: 10px;
  color: #ef4444;
  flex-shrink: 0;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-more {
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  padding: 6px 0;
  margin: 0;
  background: #fafafa;
  border-top: 1px solid #f3f4f6;
}

/* Artifact Footer */
.artifact-footer {
  padding: 6px 12px;
  border-top: 1px solid #f3f4f6;
  background: #f9fafb;
  text-align: right;
}

.artifact-footer .artifact-action {
  opacity: 0.7;
  font-size: 11px;
}

.tool-artifact:hover .artifact-footer .artifact-action {
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .tool-artifact {
    margin: 10px 0;
    max-width: 100%;
  }
}

/* =============================================================================
   STREAMING UI STYLES
   ============================================================================= */

.streaming-content {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Streaming cursor - blinking line at end of text */
.streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent, #b8956c);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursor-blink 0.8s ease-in-out infinite;
}

@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Code block while streaming */
.code-block.streaming {
  border-left: 3px solid var(--accent, #b8956c);
  position: relative;
}

.code-block.streaming::after {
  content: '';
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--accent, #b8956c);
  border-radius: 50%;
  animation: code-typing 1s ease-in-out infinite;
}

@keyframes code-typing {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.streaming-status {
  min-height: 0;
}

.tool-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 8px;
  font-size: 13px;
  color: #666;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
}

.tool-status.executing {
  background: linear-gradient(90deg, #f0f7ff 0%, #e8f4fd 50%, #f0f7ff 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-color: #bdd8f5;
  color: #1a73e8;
}

.tool-status.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.tool-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #bdd8f5;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.tool-results-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-results-container:empty {
  display: none;
}

.error-text {
  color: #dc2626;
  font-style: italic;
}

.streaming-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Thinking indicator - Neural Pulse Design */
.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(184, 149, 108, 0.04) 0%, rgba(184, 149, 108, 0.01) 100%);
  border-radius: 16px;
  border: 1px solid rgba(184, 149, 108, 0.12);
  animation: indicatorFadeIn 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

.thinking-indicator::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(184, 149, 108, 0.03) 50%,
    transparent 100%
  );
  animation: shimmerPass 2.5s ease-in-out infinite;
}

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

@keyframes shimmerPass {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Neural Pulse Wave */
.thinking-dots {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  position: relative;
}

.thinking-dots span {
  width: 3px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  animation: neuralPulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(184, 149, 108, 0.4);
}

.thinking-dots span:nth-child(1) { animation-delay: 0s; }
.thinking-dots span:nth-child(2) { animation-delay: 0.1s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(4) { animation-delay: 0.3s; }
.thinking-dots span:nth-child(5) { animation-delay: 0.4s; }
.thinking-dots span:nth-child(6) { animation-delay: 0.5s; }
.thinking-dots span:nth-child(7) { animation-delay: 0.6s; }

@keyframes neuralPulse {
  0%, 100% {
    height: 4px;
    opacity: 0.4;
    box-shadow: 0 0 4px rgba(184, 149, 108, 0.2);
  }
  50% {
    height: 16px;
    opacity: 1;
    box-shadow: 0 0 12px rgba(184, 149, 108, 0.6);
  }
}

/* Thinking Text with Typing Effect */
.thinking-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 450;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.thinking-text::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5px;
  height: 14px;
  background: var(--accent);
  animation: cursorBlink 1s step-end infinite;
  opacity: 0.8;
}

@keyframes cursorBlink {
  0%, 50% { opacity: 0.8; }
  51%, 100% { opacity: 0; }
}

/* Processing State - More Active Animation */
.thinking-indicator.processing .thinking-dots span {
  animation: neuralPulseActive 0.8s ease-in-out infinite;
}

.thinking-indicator.processing::before {
  animation: shimmerPass 1.5s ease-in-out infinite;
}

@keyframes neuralPulseActive {
  0%, 100% {
    height: 3px;
    opacity: 0.5;
  }
  25% {
    height: 14px;
    opacity: 1;
  }
  50% {
    height: 8px;
    opacity: 0.8;
  }
  75% {
    height: 18px;
    opacity: 1;
  }
}

/* Minimal variant for inline usage */
.thinking-indicator.minimal {
  background: transparent;
  border: none;
  padding: 8px 0;
}

.thinking-indicator.minimal::before {
  display: none;
}

.thinking-indicator.minimal .thinking-text::after {
  display: none;
}

.tool-result-inline {
  margin: 4px 0;
}

.tool-result-inline .tool-artifact {
  margin: 0;
}

/* Ping result styles */
.artifact-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.ping-stat {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.ping-stat.pinged {
  background: #dcfce7;
  color: #166534;
}

.ping-stat.skipped {
  background: #f3f4f6;
  color: #6b7280;
}

.ping-stat.failed {
  background: #fef2f2;
  color: #dc2626;
}

.artifact-row.skipped {
  opacity: 0.6;
}

.artifact-row.skipped .artifact-row-status {
  color: #9ca3af;
}

.artifact-row.failed .artifact-row-status {
  color: #dc2626;
}

/* Ping Preview Styles */
.tool-artifact.ping-preview {
  cursor: default;
}

.ping-preview .artifact-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.ping-preview .artifact-message-preview {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-style: italic;
  border-left: 3px solid var(--accent);
}

.ping-select-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.ping-select-btn {
  padding: 4px 10px;
  font-size: 11px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

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

.ping-candidates-list {
  max-height: 200px;
  overflow-y: auto;
}

.ping-candidate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 2px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ping-candidate-row:hover {
  background: var(--bg-hover);
}

.ping-candidate-row.skipped {
  opacity: 0.5;
  cursor: not-allowed;
}

.ping-candidate-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ping-candidate-checkbox:disabled {
  cursor: not-allowed;
}

.ping-candidate-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.ping-candidate-reason {
  font-size: 11px;
  color: var(--text-muted);
}

.ping-candidate-row.pingable .ping-candidate-reason {
  color: var(--success);
}

.ping-actions {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.ping-confirm-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ping-confirm-btn:hover:not(:disabled) {
  background: var(--accent-dark);
}

.ping-confirm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ping-confirm-btn svg {
  flex-shrink: 0;
}

/* ==========================================
   GOAL SELECTION MODAL
   ========================================== */

.goal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 33, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.goal-modal-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.goal-modal {
  background: var(--bg-primary);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--border);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.goal-modal-overlay:not(.hidden) .goal-modal {
  transform: translateY(0) scale(1);
}

.goal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--bg-secondary), var(--bg-primary));
}

.goal-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.goal-modal-title svg {
  color: var(--accent);
}

.goal-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-modal-close svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

.goal-modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  transform: rotate(90deg);
}

.goal-modal-close:active {
  transform: rotate(90deg) scale(0.9);
}

.goal-modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(85vh - 80px);
}

.goal-modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.goal-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.goal-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.goal-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--icon-color, var(--accent));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.goal-card:hover {
  border-color: var(--accent-light);
  background: var(--bg-secondary);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.goal-card:hover::before {
  opacity: 1;
}

.goal-card:active {
  transform: translateX(4px) scale(0.99);
}

.goal-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: color-mix(in srgb, var(--icon-color, var(--accent)) 12%, transparent);
  border-radius: 10px;
  color: var(--icon-color, var(--accent));
  transition: all 0.2s ease;
}

.goal-card:hover .goal-card-icon {
  background: color-mix(in srgb, var(--icon-color, var(--accent)) 18%, transparent);
  transform: scale(1.05);
}

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

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

.goal-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.goal-card-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.2s ease;
}

.goal-card:hover .goal-card-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}

/* Custom Goal Form */
.goal-custom-section {
  margin-top: 20px;
  padding-top: 20px;
}

.goal-custom-divider {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.goal-custom-divider::before,
.goal-custom-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.goal-custom-divider span {
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.goal-custom-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.goal-custom-input-wrapper {
  width: 100%;
}

.goal-custom-input-wrapper input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.15s ease;
  box-sizing: border-box;
  box-shadow: none;
}

.goal-custom-input-wrapper input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: none;
}

.goal-custom-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.goal-custom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px !important;
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  width: auto !important;
  flex-shrink: 0;
}

.goal-custom-btn:hover {
  background: var(--accent-dark);
}

.goal-custom-btn svg {
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 480px) {
  .goal-modal {
    width: 95%;
    max-height: 90vh;
    border-radius: 12px;
  }

  .goal-modal-header {
    padding: 16px 20px;
  }

  .goal-modal-body {
    padding: 16px;
  }

  .goal-card {
    padding: 14px 16px;
  }

  .goal-card-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

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

  .goal-custom-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================
   GOAL ITEMS
   ========================================== */

.goal-item {
  padding: 12px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.goal-item:last-child {
  margin-bottom: 0;
}

.goal-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.goal-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.goal-item-progress {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.goal-btn-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.goal-item:hover .goal-btn-delete {
  opacity: 1;
}

.goal-btn-delete:hover {
  background: rgba(234, 67, 53, 0.1);
  color: #ea4335;
}

.goal-progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.goal-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.goal-item-target {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================
   ACTION ITEMS
   ========================================== */

.action-item {
  padding: 12px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.action-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.action-icon {
  font-size: 14px;
}

.action-type {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.action-time {
  font-size: 11px;
  color: var(--text-muted);
}

.action-preview {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: 6px;
  line-height: 1.4;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn.approve {
  background: rgba(52, 168, 83, 0.1);
  color: #34a853;
}

.action-btn.approve:hover {
  background: rgba(52, 168, 83, 0.2);
}

.action-btn.reject {
  background: rgba(234, 67, 53, 0.1);
  color: #ea4335;
}

.action-btn.reject:hover {
  background: rgba(234, 67, 53, 0.2);
}

/* ==========================================
   TRIGGER ITEMS
   ========================================== */

.triggers-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trigger-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.15s ease;
}

.trigger-item:hover {
  border-color: color-mix(in srgb, var(--border) 70%, var(--text-muted));
}

.trigger-item.inactive {
  opacity: 0.6;
}

.trigger-item.inactive .trigger-icon {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.trigger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: rgba(52, 168, 83, 0.1);
  border-radius: 6px;
  color: #34a853;
}

.trigger-icon svg {
  width: 14px;
  height: 14px;
}

.trigger-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toggle Switch */
.trigger-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}

.trigger-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.trigger-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  border-radius: 20px;
}

.trigger-switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-muted);
  transition: all 0.2s ease;
  border-radius: 50%;
}

.trigger-switch input:checked + .trigger-switch-slider {
  background-color: rgba(52, 168, 83, 0.2);
  border-color: rgba(52, 168, 83, 0.4);
}

.trigger-switch input:checked + .trigger-switch-slider:before {
  transform: translateX(16px);
  background-color: #34a853;
}

.trigger-switch:hover .trigger-switch-slider {
  border-color: var(--text-muted);
}

/* Delete Button */
.trigger-btn-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.trigger-item:hover .trigger-btn-delete {
  opacity: 1;
}

.trigger-btn-delete:hover {
  background: rgba(234, 67, 53, 0.1);
  color: #ea4335;
}

/* ==========================================
   TRIGGER MODAL
   ========================================== */

.trigger-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.trigger-modal-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.trigger-modal {
  background: var(--bg-primary);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.25s ease;
}

.trigger-modal-overlay:not(.hidden) .trigger-modal {
  transform: translateY(0) scale(1);
}

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

.trigger-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.trigger-modal-title svg {
  color: var(--accent);
}

.trigger-modal-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.trigger-modal-close svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

.trigger-modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  transform: rotate(90deg);
}

.trigger-modal-close:active {
  transform: rotate(90deg) scale(0.9);
}

.trigger-modal-body {
  padding: 20px 24px;
  max-height: calc(85vh - 80px);
  overflow-y: auto;
}

.trigger-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trigger-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.trigger-card:hover {
  background: var(--bg-primary);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(184, 149, 108, 0.15);
}

.trigger-card-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--icon-color, var(--accent)) 12%, transparent);
}

.trigger-card-icon svg {
  color: var(--icon-color, var(--accent));
}

.trigger-card-content {
  flex: 1;
}

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

.trigger-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.trigger-card-arrow {
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s ease;
}

.trigger-card:hover .trigger-card-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}

/* Generic Candidate Card */
.candidate-card-generic {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.candidate-card-generic:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(184, 149, 108, 0.15);
  transform: translateY(-2px);
}

/* ==========================================
   FOUND CANDIDATES PANEL
   ========================================== */

.agent-header-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 12px;
}

.agent-header-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
}

.agent-header-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.agent-header-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.agent-header-btn.active svg {
  stroke: white;
}

.candidates-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(184, 149, 108, 0.4);
}

.candidates-count-badge:empty,
.candidates-count-badge[data-count="0"] {
  display: none;
}

/* Candidates Panel - Slide from Right */
.candidates-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.1);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.candidates-panel:not(.hidden) {
  transform: translateX(0);
}

.candidates-panel.hidden {
  pointer-events: none;
}

/* Panel Header */
.candidates-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8f4ef 0%, var(--bg-secondary) 100%);
  border-bottom: 1px solid var(--border);
}

.candidates-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.candidates-panel-title svg {
  color: var(--accent);
}

.candidates-panel-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--accent);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.candidates-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.candidates-refresh-btn,
.candidates-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary, #333);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.candidates-refresh-btn svg,
.candidates-close-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: block;
}

.candidates-refresh-btn:hover {
  background: rgba(184, 149, 108, 0.1);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
}

.candidates-refresh-btn:active {
  transform: scale(0.95);
}

.candidates-close-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
  transform: rotate(90deg);
}

.candidates-close-btn:active {
  transform: rotate(90deg) scale(0.9);
}

/* Filters */
.candidates-panel-filters {
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.candidates-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.candidates-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 149, 108, 0.1);
}

.candidates-search svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.candidates-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

.candidates-search input::placeholder {
  color: var(--text-muted);
}

.candidates-sort select {
  padding: 8px 12px;
  padding-right: 32px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239aa0a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.candidates-sort select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Candidates List Container */
.candidates-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.candidates-list-container::-webkit-scrollbar {
  width: 6px;
}

.candidates-list-container::-webkit-scrollbar-track {
  background: transparent;
}

.candidates-list-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.candidates-list-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Loading State */
.candidates-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.candidates-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: candidatesSpin 0.8s linear infinite;
}

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

/* Empty State */
.candidates-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  text-align: center;
}

.candidates-empty svg {
  color: var(--text-muted);
  opacity: 0.5;
}

.candidates-empty span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.candidates-empty p {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 220px;
  line-height: 1.5;
}

/* Candidates List */
.candidates-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Candidate Card */
.found-candidate-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.found-candidate-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(184, 149, 108, 0.15);
  transform: translateY(-2px);
}

.found-candidate-card.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, #faf8f5 0%, var(--bg-primary) 100%);
  box-shadow: 0 0 0 2px rgba(184, 149, 108, 0.15);
}

.found-candidate-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.found-candidate-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
  overflow: hidden;
}

.found-candidate-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.found-candidate-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.found-candidate-title {
  font-size: 12px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.found-candidate-score {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.found-candidate-score.high {
  background: rgba(52, 168, 83, 0.1);
  color: var(--success);
}

.found-candidate-score.medium {
  background: rgba(251, 188, 4, 0.1);
  color: var(--warning);
}

.found-candidate-score.low {
  background: rgba(234, 67, 53, 0.1);
  color: var(--danger);
}

.found-candidate-score.none {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 10px;
}

.found-candidate-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.found-candidate-source svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}

.found-candidate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.found-candidate-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.found-candidate-tag svg {
  width: 10px;
  height: 10px;
  color: var(--text-muted);
}

.found-candidate-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.found-candidate-skill {
  padding: 2px 6px;
  background: rgba(184, 149, 108, 0.1);
  border-radius: 4px;
  font-size: 10px;
  color: var(--accent-dark);
  font-weight: 500;
}

.found-candidate-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.found-candidate-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.found-candidate-status-badge.new {
  background: rgba(184, 149, 108, 0.1);
  color: var(--accent);
}

.found-candidate-status-badge.reviewed {
  background: rgba(52, 168, 83, 0.1);
  color: var(--success);
}

.found-candidate-status-badge.contacted {
  background: rgba(0, 136, 204, 0.1);
  color: #0088cc;
}

.found-candidate-status-badge.rejected {
  background: rgba(234, 67, 53, 0.1);
  color: var(--danger);
}

.found-candidate-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* Candidate Detail View */
.candidate-detail {
  position: absolute;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.candidate-detail:not(.hidden) {
  transform: translateX(0);
}

.candidate-detail-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.candidate-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.candidate-back-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.candidate-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Detail Content Styles */
.candidate-detail-profile {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.candidate-detail-avatar {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.candidate-detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.candidate-detail-main {
  flex: 1;
}

.candidate-detail-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.candidate-detail-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.candidate-detail-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.candidate-detail-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.candidate-detail-location svg {
  width: 14px;
  height: 14px;
}

.candidate-detail-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 3px 8px;
  border-radius: 4px;
}

.candidate-detail-source svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}

/* Detail Sections */
.candidate-detail-section {
  margin-bottom: 20px;
}

.candidate-detail-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.candidate-detail-section-title svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.candidate-detail-score-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #f8f4ef 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.candidate-detail-score-value {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}

.candidate-detail-score-value.high {
  background: rgba(52, 168, 83, 0.15);
  color: var(--success);
}

.candidate-detail-score-value.medium {
  background: rgba(251, 188, 4, 0.15);
  color: #e0a800;
}

.candidate-detail-score-value.low {
  background: rgba(234, 67, 53, 0.15);
  color: var(--danger);
}

.candidate-detail-score-info {
  flex: 1;
}

.candidate-detail-score-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.candidate-detail-score-comment {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.candidate-detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.candidate-detail-info-item {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 10px;
}

.candidate-detail-info-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.candidate-detail-info-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.candidate-detail-skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.candidate-detail-skill {
  padding: 6px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.candidate-detail-skill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.candidate-detail-experience-item {
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: 10px;
  margin-bottom: 10px;
}

.candidate-detail-experience-item:last-child {
  margin-bottom: 0;
}

.candidate-detail-exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.candidate-detail-exp-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.candidate-detail-exp-period {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
}

.candidate-detail-exp-company {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.candidate-detail-exp-description {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Detail Actions */
.candidate-detail-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.candidate-detail-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.candidate-detail-action.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
}

.candidate-detail-action.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 149, 108, 0.3);
}

.candidate-detail-action.secondary {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.candidate-detail-action.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==========================================
   SETTINGS MODAL
   ========================================== */

.settings-modal {
  max-width: 520px;
}

/* Toggle row */
.settings-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.settings-toggle-info {
  flex: 1;
}

.settings-toggle-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.settings-toggle-hint {
  display: block;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* iOS-style toggle switch */
.settings-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.settings-switch input:checked + .settings-switch-slider {
  background: var(--accent);
  border-color: var(--accent-dark);
}

.settings-switch input:checked + .settings-switch-slider::before {
  transform: translateX(20px);
}

.settings-switch input:focus-visible + .settings-switch-slider {
  box-shadow: 0 0 0 3px rgba(184, 149, 108, 0.25);
}

/* Delay params (collapsible) */
.settings-delay-params {
  overflow: hidden;
  max-height: 400px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
  margin-top: 4px;
}

.settings-delay-params.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

/* Delay preview */
.settings-delay-preview {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.settings-delay-preview-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.settings-delay-periods {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-delay-period {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.settings-delay-period:hover {
  border-color: var(--border);
}

.settings-delay-period-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.settings-delay-period-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.settings-delay-period-range {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  font-family: 'Space Mono', monospace;
}

.settings-delay-period-mult {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
  font-weight: 400;
  font-family: 'DM Sans', sans-serif;
}

/* Notifier Bot Section */
.notifier-bot-info {
  padding: 0;
}

.notifier-bot-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.notifier-bot-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 18px;
}

.notifier-bot-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.notifier-bot-status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 6px rgba(52, 168, 83, 0.4);
}

.notifier-bot-status-dot.disconnected {
  background: var(--text-muted);
}

.notifier-bot-status-text {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.notifier-bot-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}

.notifier-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
}

.notifier-step-num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
}

.notifier-step-content {
  flex: 1;
}

.notifier-step-title {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.notifier-step-hint {
  display: block;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.notifier-bot-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.notifier-bot-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.notifier-bot-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.notifier-bot-note svg {
  flex-shrink: 0;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ==========================================
   DAILY CONTACT LIMIT BADGE (Sidebar)
   ========================================== */

.contact-limit-badge {
  position: relative;
  margin-bottom: 6px;
}

.contact-limit-badge-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  cursor: default;
  transition: all 0.2s ease;
}

.contact-limit-badge-inner:hover {
  background: var(--sidebar-bg-hover);
  border-color: var(--sidebar-bg-active);
}

.contact-limit-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--sidebar-text-muted);
  transition: color 0.2s ease;
}

.contact-limit-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.contact-limit-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-limit-counter {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--sidebar-text);
  display: flex;
  align-items: baseline;
  gap: 1px;
  flex-shrink: 0;
}

.contact-limit-separator {
  color: var(--sidebar-text-muted);
  font-weight: 400;
}

.contact-limit-progress {
  position: absolute;
  bottom: 1px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: rgba(184, 149, 108, 0.12);
  border-radius: 0 0 4px 4px;
  overflow: hidden;
}

.contact-limit-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.4s ease, background 0.3s ease;
  width: 0%;
}

/* Tooltip — fixed position to escape sidebar overflow:hidden */
.contact-limit-tooltip {
  position: fixed;
  width: 260px;
  padding: 14px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: translateX(-4px);
}

.contact-limit-tooltip::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.contact-limit-tooltip.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.contact-limit-tooltip-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.contact-limit-tooltip-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.contact-limit-tooltip-reset {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.contact-limit-tooltip-reset:empty {
  display: none;
}

/* State: Warning (80%+) */
.contact-limit-badge.warning .contact-limit-badge-inner {
  border-color: rgba(251, 188, 4, 0.3);
}

.contact-limit-badge.warning .contact-limit-progress-bar {
  background: var(--warning);
}

.contact-limit-badge.warning .contact-limit-used {
  color: var(--warning);
}

.contact-limit-badge.warning .contact-limit-icon {
  color: var(--warning);
}

/* State: Limit Reached */
.contact-limit-badge.limit-reached .contact-limit-badge-inner {
  border-color: rgba(234, 67, 53, 0.3);
}

.contact-limit-badge.limit-reached .contact-limit-progress-bar {
  background: var(--danger);
}

.contact-limit-badge.limit-reached .contact-limit-used {
  color: var(--danger);
}

.contact-limit-badge.limit-reached .contact-limit-icon {
  color: var(--danger);
}

/* Collapsed sidebar */
.app-container.sidebar-collapsed .contact-limit-badge .contact-limit-info {
  display: none;
}

.app-container.sidebar-collapsed .contact-limit-badge-inner {
  justify-content: center;
  padding: 9px;
}

.app-container.sidebar-collapsed .contact-limit-badge .contact-limit-progress {
  left: 6px;
  right: 6px;
}

.add-job-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  pointer-events: all;
}

.add-job-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ===== FriendWork Vacancy Picker ===== */
.fw-picker {
  position: relative;
}

.fw-picker-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.fw-picker-btn:hover {
  border-color: var(--border-light);
  background: var(--bg-primary);
}

.fw-picker.open .fw-picker-btn {
  border-color: #2d8fa0;
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(45, 143, 160, 0.12);
}

.fw-picker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #2d8fa0 0%, #1a6b7a 100%);
  border-radius: 6px;
  flex-shrink: 0;
  color: white;
}

.fw-picker-text {
  flex: 1;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fw-picker-text.has-value {
  color: var(--text-primary);
  font-weight: 500;
}

.fw-picker-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.fw-picker.open .fw-picker-chevron {
  transform: rotate(180deg);
}

.fw-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: min(320px, 45vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fw-picker.open .fw-picker-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fw-picker-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.fw-picker-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

.fw-picker-search-input::placeholder {
  color: var(--text-muted);
}

.fw-picker-list {
  overflow-y: auto;
  flex: 1;
  max-height: min(220px, 30vh);
}

.fw-picker-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-tertiary);
  transition: background 0.1s ease;
}

.fw-picker-item:last-child {
  border-bottom: none;
}

.fw-picker-item:hover {
  background: var(--bg-secondary);
}

.fw-picker-item.selected {
  background: rgba(45, 143, 160, 0.06);
}

.fw-picker-item-icon {
  width: 32px;
  height: 32px;
  background: rgba(45, 143, 160, 0.08);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.fw-picker-item-content {
  flex: 1;
  min-width: 0;
}

.fw-picker-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.3;
}

.fw-picker-item-name mark {
  background: rgba(45, 143, 160, 0.15);
  color: #1a6b7a;
  padding: 1px 3px;
  border-radius: 3px;
}

.fw-picker-item-meta {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.fw-picker-item-meta-tag {
  padding: 1px 5px;
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.fw-picker-loading {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.fw-picker-empty {
  padding: 28px 16px;
  text-align: center;
}

.fw-picker-empty-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.fw-picker-empty-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.fw-picker-error {
  padding: 20px 16px;
  text-align: center;
}

.fw-picker-error-text {
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 8px;
}

.fw-picker-error-retry {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.fw-picker-error-retry:hover {
  background: var(--bg-primary);
  border-color: var(--border-light);
}

.fw-picker-clear {
  width: 100%;
  padding: 8px;
  background: var(--bg-secondary);
  border: none;
  border-top: 1px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.fw-picker-clear:hover {
  background: rgba(234, 67, 53, 0.06);
  color: var(--danger);
}

