/* ===================================
   Rekryterings-Dagge v2.1 Milano
   AI-Powered Talent Sourcing Dashboard
   =================================== */

/* === ROOT VARIABLES === */
:root {
    /* Colors */
    --bg-primary: #050508;
    --bg-secondary: #0f101a;
    --bg-tertiary: #1a1b2e;
    
    /* Gold Accent for Milano Deluxe */
    --gold: #ffd700;
    
    /* Glass Effects */
    --glass-bg: rgba(26, 27, 46, 0.7);
    --glass-border: rgba(163, 137, 244, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Accent */
    --accent-primary: #a389f4;
    --accent-secondary: #7c3aed;
    --accent-glow: rgba(163, 137, 244, 0.4);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Status */
    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-error: #ef4444;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #a389f4 0%, #7c3aed 100%);
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* === BASE RESET === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

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

/* === BAKGRUND (statisk – animationen togs bort för att spara GPU) === */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(103, 126, 234, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(163, 137, 244, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: -2;
}

@keyframes gradientShift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(5%, 5%) rotate(120deg); }
    66% { transform: translate(-5%, 5%) rotate(240deg); }
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(163, 137, 244, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(163, 137, 244, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* === GLASSMORPHISM === */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.glass-inner {
    background: rgba(15, 16, 26, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(163, 137, 244, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

/* === LAYOUT: SIDECAR === */
.app-container {
    display: grid;
    grid-template-columns: 420px 1fr;
    height: 100vh;
    gap: var(--space-lg);
    padding: var(--space-lg);
}

/* === CHAT SIDEBAR (LEFT 35%) === */
.chat-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-xl);
    overflow: hidden;
}

/* Logo */
.logo-section {
    position: relative;
    text-align: center;
    padding: var(--space-lg) 0;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.6;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xs);
}

.logo-primary {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-secondary {
    color: var(--text-primary);
}

.version {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Chat Actions */
.chat-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(163, 137, 244, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(163, 137, 244, 0.2);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

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

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

/* Welcome Message */
.welcome-message {
    padding: var(--space-lg);
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

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

.welcome-message h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--space-lg);
}

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

.quick-btn {
    padding: var(--space-sm) var(--space-md);
    background: rgba(163, 137, 244, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.quick-btn:hover {
    background: rgba(163, 137, 244, 0.2);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

/* Chat Bubbles */
.message {
    display: flex;
    gap: var(--space-sm);
    animation: messageSlide 0.3s ease;
}

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

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: rgba(163, 137, 244, 0.2);
}

.message-content {
    max-width: 80%;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.5;
    font-size: 0.9rem;
}

.message.user .message-content {
    background: rgba(163, 137, 244, 0.15);
    border-color: rgba(163, 137, 244, 0.3);
}

/* Markdown in messages */
.message-content h3 {
    margin-top: var(--space-sm);
    margin-bottom: var(--space-xs);
    color: var(--accent-primary);
    font-size: 1rem;
}

.message-content ul {
    margin-left: var(--space-lg);
}

.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-sm) 0;
    font-size: 0.85rem;
}

.message-content th,
.message-content td {
    padding: 6px;
    text-align: left;
    border: 1px solid var(--glass-border);
}

.message-content th {
    background: rgba(163, 137, 244, 0.1);
    color: var(--accent-primary);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: var(--space-sm);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

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

#userInput {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: rgba(15, 16, 26, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    transition: all var(--transition-fast);
}

#userInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#userInput::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-accent);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--accent-glow);
}

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

.input-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-xs);
}

.char-count {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Sidebar Footer */
.sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

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

.status-pulse {
    width: 8px;
    height: 8px;
    background: var(--status-success);
    border-radius: 50%;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 var(--status-success);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

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

.sources-mini {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sources-mini svg {
    width: 16px;
    height: 16px;
}

/* === DASHBOARD MAIN (RIGHT 65%) === */
.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    overflow: hidden;
}

/* Dashboard Header */
.dashboard-header {
    padding: var(--space-md);
}

.dashboard-tabs {
    display: flex;
    gap: var(--space-sm);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(163, 137, 244, 0.05);
}

.tab-btn.active {
    color: var(--accent-primary);
    background: rgba(163, 137, 244, 0.15);
    border-color: var(--accent-primary);
}

.tab-btn svg {
    width: 18px;
    height: 18px;
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--space-lg) var(--space-lg);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

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

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

/* View Panels */
.view-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-panel.active {
    display: block;
}

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

.panel-header {
    margin-bottom: var(--space-lg);
}

.panel-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

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

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-lg);
}

.chart-placeholder {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.chart-placeholder svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    opacity: 0.3;
}

.chart-placeholder p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Vega Chart Container */
.vega-chart-container {
    padding: var(--space-lg);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    transition: opacity var(--transition-normal);
}

.vega-chart-container h4 {
    margin-bottom: var(--space-md);
    color: var(--accent-primary);
}

/* Simulator Layout */
.simulator-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.sim-card {
    padding: var(--space-xl);
}

.sim-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
}

/* === MILANO SIMULATOR === */
#simulator-validation {
    display: none;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-lg);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--status-error);
    border-radius: var(--radius-md);
    color: var(--status-error);
    font-size: 0.85rem;
    font-weight: 500;
}

#clip-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.clip-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    
    /* Milano Deluxe: Gold Glow */
    background: color-mix(in srgb, var(--gold), transparent 95%);
    border: 1px solid color-mix(in srgb, var(--gold), transparent 85%);
    border-radius: var(--radius-md);
    
    /* Transitions */
    transition: all var(--transition-normal);
    opacity: 1;
    transform: translateY(0);
}

.clip-row:hover {
    background: color-mix(in srgb, var(--gold), transparent 90%);
    border-color: color-mix(in srgb, var(--gold), transparent 70%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.05);
}

.clip-row.inactive {
    opacity: 0.3;
    filter: grayscale(100%);
}

.clip-row-dragger {
    cursor: grab;
    color: var(--text-muted);
    font-size: 1.5rem;
    padding: 0 var(--space-xs);
}

.clip-row-inputs {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    padding: var(--space-sm);
    background: rgba(15, 16, 26, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.clip-row-result {
    text-align: center;
    padding: 0 var(--space-md);
    min-width: 80px;
}

.clip-row-result .result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
}

.clip-row-result .result-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.clip-row-delete {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.clip-row.inactive .clip-name {
    text-decoration: line-through;
}

.clip-row-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-error);
    transform: scale(1.1);
}

/* Button for adding clips */
#addClipBtn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: transparent;
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

#addClipBtn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-glow);
}

#addClipBtn svg {
    width: 18px;
    height: 18px;
}

/* Control Groups */
.control-group {
    margin-bottom: var(--space-lg);
}

.control-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

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

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: rgba(163, 137, 244, 0.2);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--gradient-accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--accent-glow);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--gradient-accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

output {
    min-width: 70px;
    padding: 4px var(--space-sm);
    background: rgba(163, 137, 244, 0.1);
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--accent-primary);
    text-align: center;
    font-size: 0.85rem;
}

/* Chip Group */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.chip {
    padding: 6px var(--space-md);
    background: rgba(163, 137, 244, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip:hover {
    background: rgba(163, 137, 244, 0.15);
}

.chip.active {
    background: var(--gradient-accent);
    color: white;
    border-color: var(--accent-primary);
}

/* Primary Button */
.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--gradient-accent);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px var(--accent-glow);
}

.btn-primary svg {
    width: 20px;
    height: 20px;
}

/* Simulator Results */
.sim-results {
    min-height: 200px;
}

.placeholder-text {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-xl);
    font-style: italic;
    font-size: 0.9rem;
}

.result-item {
    padding: var(--space-md);
    background: rgba(163, 137, 244, 0.05);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Insights Grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.insight-card {
    padding: var(--space-lg);
}

.sources-list {
    padding: var(--space-lg);
}

.sources-list h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
}

.sources-list ul {
    list-style: none;
}

.sources-list li {
    padding: var(--space-xs) 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.source-placeholder {
    font-style: italic;
}

/* === UPLOAD MODAL === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    padding: var(--space-xl);
    z-index: 1001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

/* Upload Zone */
.upload-zone {
    padding: var(--space-xl);
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(163, 137, 244, 0.05);
}

.upload-zone svg {
    width: 48px;
    height: 48px;
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Progress */
.upload-progress {
    text-align: center;
}

.upload-progress.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(163, 137, 244, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-accent);
    transition: width var(--transition-normal);
}

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

.toast {
    min-width: 300px;
    padding: var(--space-md) var(--space-lg);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    animation: toastSlideIn 0.3s ease;
}

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

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

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: 50vh 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .simulator-layout {
        grid-template-columns: 1fr;
    }
}

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

.danger-text {
    color: var(--status-error) !important;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.toggle-checkbox {
    accent-color: var(--accent-primary);
}

/* === STATS LIST (Current Loop) === */
.subtitle-badge {
    font-size: 0.6em;
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-group {
    margin-bottom: var(--space-md);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(0,0,0,0.2);
    transition: all var(--transition-normal);
}

.stats-group.inactive {
    opacity: 0.5;
    border-color: transparent;
}

.stats-group.inactive .stats-header {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
}

.stats-header {
    padding: var(--space-sm) var(--space-md);
    background: rgba(163, 137, 244, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.stats-header .total-time {
    font-family: monospace;
    color: var(--accent-primary);
}

.stats-item {
    padding: var(--space-sm) var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: opacity var(--transition-normal), filter var(--transition-normal);
}

.stats-item.inactive {
    opacity: 0.3;
    text-decoration: line-through;
    filter: grayscale(100%);
}

.remove-stat-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2em;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.remove-stat-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* === NATIVE DIALOG === */
dialog.confirm-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    color: var(--text-primary);
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    z-index: 3000;
}

dialog.confirm-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

dialog.confirm-dialog h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

dialog.confirm-dialog p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.5;
}

.dialog-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
}

.dialog-actions button {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-cancel:hover { background: rgba(255, 255, 255, 0.15); }

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

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

/* ===================================
   RECRUITMENT-SPECIFIC STYLES
   =================================== */

/* === CANDIDATE CARDS === */
.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-md);
}

.candidate-card {
    padding: var(--space-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.candidate-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(163, 137, 244, 0.2);
    border-color: var(--accent-primary);
}

.candidate-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.candidate-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.candidate-info {
    flex: 1;
}

.candidate-info h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.linkedin-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.linkedin-link:hover {
    color: var(--accent-secondary);
    gap: 6px;
}

.candidate-snippet {
    padding: var(--space-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
}

.candidate-snippet p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.candidate-meta {
    display: flex;
    gap: var(--space-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === CODE BLOCK === */
.code-block-container {
    padding: 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--glass-border);
}

.code-header span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(163, 137, 244, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-copy:hover {
    background: rgba(163, 137, 244, 0.2);
    transform: translateY(-2px);
}

.code-block-container pre {
    margin: 0;
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.4);
    overflow-x: auto;
}

.code-block-container code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--accent-primary);
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* === ROLE INFO GRID === */
.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
}

.role-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.role-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.keywords-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    padding: 4px 12px;
    background: rgba(163, 137, 244, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--accent-primary);
}

/* === STATS DASHBOARD === */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    padding: var(--space-lg);
}

.stat-card {
    text-align: center;
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(163, 137, 244, 0.1);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: var(--space-xs);
}

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

/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
    min-width: 250px;
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--transition-normal);
}

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

.toast-icon {
    font-size: 1.2rem;
}

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

/* ===================================
   BADGE COMPONENTS
   =================================== */

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
    transition: all var(--transition-fast);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-success);
    border: 1px solid var(--status-success);
}

.badge-success:hover {
    background: rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.badge-secondary {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.badge-secondary:hover {
    background: rgba(100, 116, 139, 0.25);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-warning);
    border: 1px solid var(--status-warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-error);
    border: 1px solid var(--status-error);
}

/* Badge in candidate header context */
.candidate-info .badge {
    vertical-align: middle;
    margin-left: 12px;
}

.toast-success {
    border-left: 3px solid var(--status-success);
}

.toast-error {
    border-left: 3px solid var(--status-error);
}

.toast-warning {
    border-left: 3px solid var(--status-warning);
}

.toast-info {
    border-left: 3px solid var(--accent-primary);
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 8, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-normal);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(163, 137, 244, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: var(--space-lg);
    color: var(--accent-primary);
    font-size: 0.9rem;
}

/* === CHAT MESSAGE STYLES === */
.chat-message {
    padding: var(--space-md);
    animation: fadeInUp 0.3s ease;
}

.user-message {
    background: rgba(163, 137, 244, 0.1);
    border-left: 3px solid var(--accent-primary);
}

.assistant-message {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid rgba(163, 137, 244, 0.3);
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .candidates-grid {
        grid-template-columns: 1fr;
    }
    
    .role-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .role-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   ENHANCED INPUT COMPONENTS (Milano Style)
   =================================== */

/* Textarea styling */
#jdInput {
    width: 100%;
    min-height: 120px;
    padding: var(--space-md);
    background: rgba(26, 27, 46, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    transition: all var(--transition-normal);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#jdInput::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

#jdInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(26, 27, 46, 0.7);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(163, 137, 244, 0.1),
        0 0 20px rgba(163, 137, 244, 0.2);
}

/* Send button (search icon) enhancement */
.send-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-accent);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.send-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 20px rgba(163, 137, 244, 0.4),
        0 0 30px rgba(163, 137, 244, 0.3);
    border-color: #fff;
}

.send-btn:hover::before {
    width: 100px;
    height: 100px;
}

.send-btn:active {
    transform: translateY(0) scale(0.98);
}

.send-btn svg {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Character counter styling */
.char-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

#jdInput:focus ~ .input-footer .char-count {
    color: var(--accent-primary);
}/* ===================================
   STRATEGY PILLS & SEARCH CONTROLS
   =================================== */

.search-strategies {
    animation: slideIn 0.3s ease;
}

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

.strategy-pill {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: rgba(26, 27, 46, 0.3);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.strategy-pill:hover {
    background: rgba(163, 137, 244, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.strategy-pill.active {
    background: var(--gradient-accent);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(163, 137, 244, 0.3);
}

#industrySelect {
    transition: all var(--transition-normal);
}

#industrySelect:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(163, 137, 244, 0.1);
}

#industrySelect option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

/* Power Mode checkbox styling */
#powerMode {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
}

/* Info box styling */
.search-strategies > div:last-child {
    animation: fadeIn 0.5s ease 0.2s both;
}

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

/* Valbara taggar i spelplanen: tydlig skillnad mellan valt och bortvalt */
.badge-primary {
    background: rgba(139, 92, 246, 0.25);
    color: var(--text-primary, #fff);
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.25);
}
.badge-primary::after {
    content: " ✓";
}
.dagge-plan .badge-secondary {
    opacity: 0.45;
    text-decoration: line-through;
}

/* Resultatlistan: inga listpunkter */
#results-list {
    list-style: none;
    padding-left: 0;
}

/* ---------- Fas 1: kandidatkort, söklägen och chatt ---------- */
.candidate-headline { margin: 2px 0 0; color: var(--text-primary, #fff); font-size: 0.95rem; }
.candidate-meta { margin: 2px 0 0; color: var(--text-secondary); font-size: 0.85rem; }
.candidate-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.candidate-why { margin: 8px 0 0; font-size: 0.9rem; color: var(--text-secondary); font-style: italic; }
.candidate-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 0.85rem; }
.candidate-vector { opacity: 0.55; font-size: 0.78rem; }
.candidate-card.low-score { opacity: 0.55; }
.snippet-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.5; margin-bottom: 4px; }
.candidate-snippet p { margin: 0; }
.link-btn { background: none; border: none; padding: 0; color: var(--accent-primary); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }

.score-badge { border: 1px solid transparent; }
.score-5 { background: rgba(16, 185, 129, 0.2); color: #34d399; border-color: #34d399; }
.score-4 { background: rgba(16, 185, 129, 0.1); color: #6ee7b7; border-color: rgba(110, 231, 183, 0.5); }
.score-3 { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border-color: rgba(251, 191, 36, 0.5); }
.score-2, .score-1 { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); border-color: rgba(100, 116, 139, 0.3); }
.interim-badge { background: rgba(163, 137, 244, 0.18); color: var(--accent-primary); border: 1px solid var(--accent-primary); }
.interim-badge.maybe { opacity: 0.7; border-style: dashed; }

.mode-btn { border: 1px solid var(--glass-border); }
.mode-btn.recommended { border-color: var(--accent-primary); box-shadow: 0 0 14px rgba(163, 137, 244, 0.25); }
.mode-recommended { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; vertical-align: middle;
    background: var(--accent-primary); color: #12121f; padding: 2px 6px; border-radius: 6px; margin-left: 6px; }

.ask-box { padding: 14px; margin-bottom: 16px; }
.ask-row { display: flex; gap: 8px; }
.ask-row input { flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--glass-border);
    background: rgba(26, 27, 46, 0.5); color: var(--text-primary, #fff); font-size: 0.95rem; }
.ask-btn { padding: 10px 18px; border-radius: 8px; border: 1px solid var(--accent-primary);
    background: rgba(163, 137, 244, 0.2); color: var(--text-primary, #fff); cursor: pointer; }
.ask-btn:disabled { opacity: 0.4; cursor: default; }
#chat-log { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
#chat-log:not(:empty) { margin-bottom: 12px; }
.chat-bubble { padding: 10px 14px; border-radius: 10px; font-size: 0.92rem; line-height: 1.5; max-width: 90%; }
.chat-bubble.user { align-self: flex-end; background: rgba(163, 137, 244, 0.2); }
.chat-bubble.dagge { align-self: flex-start; background: rgba(255, 255, 255, 0.05); }
.mode-btn { background: rgba(255, 255, 255, 0.04); color: var(--text-primary, #fff); border-radius: 10px;
    cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.mode-btn:hover { background: rgba(163, 137, 244, 0.12); border-color: var(--accent-primary); }

/* Spelplanen: välj läge, sedan en tydlig sökknapp */
.mode-choice { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.mode-choice .mode-btn { padding: 10px 18px; font-size: 0.95rem; opacity: 0.7; }
.mode-choice .mode-btn.selected { opacity: 1; background: rgba(163, 137, 244, 0.25); border-color: var(--accent-primary); font-weight: 600; }
.search-go { display: block; width: 100%; max-width: 360px; margin: 0 auto; padding: 14px 24px; font-size: 1.1rem; font-weight: 700;
    border: none; border-radius: 12px; cursor: pointer; color: #12121f; background: var(--accent-primary);
    box-shadow: 0 4px 18px rgba(163, 137, 244, 0.35); transition: transform 0.15s, box-shadow 0.15s; }
.search-go:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(163, 137, 244, 0.5); }
.search-go:disabled { opacity: 0.4; cursor: default; transform: none; }

/* ---------- Fas 2: uppdrag och ringlistor (D-010) ---------- */
.add-btn { font-weight: 600; }
.added-label { color: #34d399; font-weight: 600; font-size: 0.85rem; }

.assignment-banner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 12px; }
.assignment-banner-count { opacity: 0.75; font-size: 0.9rem; }
.assignment-banner .ask-btn { margin-left: auto; padding: 6px 14px; }

.assignment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.assignment-card { padding: 18px; cursor: pointer; transition: border-color 0.2s, transform 0.2s; border: 1px solid var(--glass-border); }
.assignment-card:hover { border-color: var(--accent-primary); transform: translateY(-2px); }
.assignment-card.closed { opacity: 0.55; }
.assignment-card-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.assignment-card h3 { margin: 0; font-size: 1.1rem; }
.assignment-meta { margin: 4px 0 10px; color: var(--text-secondary); font-size: 0.85rem; }
.assignment-foot { margin: 10px 0 0; font-size: 0.8rem; opacity: 0.6; }
.empty-state { padding: 30px; text-align: center; color: var(--text-secondary); }

.count-row { display: flex; gap: 6px; flex-wrap: wrap; }
.count-chip { font-size: 0.78rem; padding: 3px 9px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); }
.count-chip.empty { opacity: 0.6; }
.count-chip.status-to_contact { color: var(--text-primary, #fff); }
.count-chip.status-contacted { color: #93c5fd; }
.count-chip.status-interested { color: #34d399; }
.count-chip.status-presented { color: #fbbf24; }
.count-chip.status-no { color: var(--text-muted); }

.back-link { margin-bottom: 10px; display: inline-block; }
.assignment-header { padding: 18px; margin-bottom: 14px; }
.assignment-title-row { display: flex; gap: 12px; align-items: center; }
.assignment-title { flex: 1; font-size: 1.4rem; font-weight: 700; background: transparent; border: 1px solid transparent;
    color: var(--text-primary, #fff); padding: 4px 8px; border-radius: 6px; margin-left: -8px; }
.assignment-title:hover, .assignment-title:focus { border-color: var(--glass-border); outline: none; }
.assignment-status, .contact-status { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--glass-border);
    background: rgba(26, 27, 46, 0.8); color: var(--text-primary, #fff); cursor: pointer; }

.contact-list { display: flex; flex-direction: column; gap: 8px; }
.contact-row { padding: 12px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border); border-left: 4px solid var(--text-primary, #fff); }
.contact-row.status-contacted { border-left-color: #93c5fd; }
.contact-row.status-interested { border-left-color: #34d399; }
.contact-row.status-presented { border-left-color: #fbbf24; }
.contact-row.status-no { border-left-color: var(--text-muted); opacity: 0.55; }
.contact-main { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto auto auto; gap: 12px; align-items: center; }
.contact-person { display: flex; gap: 10px; align-items: start; }
.contact-person strong { display: block; }
.contact-status-icon { font-size: 1.1rem; width: 18px; text-align: center; opacity: 0.8; }
.contact-headline, .contact-meta { display: block; font-size: 0.82rem; color: var(--text-secondary); }
.contact-badges { display: flex; gap: 4px; }
.contact-link { font-size: 0.85rem; color: var(--accent-primary); white-space: nowrap; }
.contact-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 4px 8px; }
.contact-remove:hover { color: #ef4444; }
.contact-reason { margin: 6px 0 0 28px; font-size: 0.82rem; font-style: italic; color: var(--text-secondary); }
.contact-fields { display: grid; grid-template-columns: 160px 220px 1fr; gap: 8px; margin: 8px 0 0 28px; }
.contact-input { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--glass-border);
    background: rgba(26, 27, 46, 0.5); color: var(--text-primary, #fff); font-size: 0.85rem; }
.contact-input:focus { outline: none; border-color: var(--accent-primary); }
@media (max-width: 1100px) {
    .contact-main { grid-template-columns: 1fr auto; }
    .contact-fields { grid-template-columns: 1fr; }
}
.contact-input.saved, .contact-status.saved { border-color: #34d399; box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25); transition: none; }
.contact-input, .contact-status { transition: border-color 0.6s, box-shadow 0.6s; }

/* ---------- Bevakning, notiser och uppföljning (D-012, D-013) ---------- */
.dashboard-header { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; }
.notif-wrap { position: relative; }
.notif-bell { position: relative; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border);
    border-radius: 10px; font-size: 1.15rem; padding: 6px 12px; cursor: pointer; color: var(--text-primary, #fff); }
.notif-bell:hover { border-color: var(--accent-primary); }
.notif-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: #ef4444; color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 360px; z-index: 50; padding: 10px;
    background: rgba(20, 21, 36, 0.98); border: 1px solid var(--glass-border); border-radius: 12px; }
.notif-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; }
.notif-item:hover { background: rgba(163, 137, 244, 0.12); }
.notif-time { display: block; font-size: 0.72rem; opacity: 0.5; margin-top: 2px; }
.notif-empty { padding: 12px; opacity: 0.6; font-size: 0.9rem; }
.notif-enable { margin: 6px 12px 2px; font-size: 0.8rem; }

.new-chip { font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: rgba(239, 68, 68, 0.18); color: #fca5a5; white-space: nowrap; }
.monitor-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--glass-border); }
.monitor-row .assignment-meta { margin: 0; }
.monitor-row .ask-btn { margin-left: auto; padding: 6px 14px; }
.monitor-toggle { display: flex; gap: 6px; align-items: center; cursor: pointer; font-weight: 600; }
.flash { padding: 12px 16px; margin-bottom: 14px; border-left: 3px solid var(--accent-primary); }
.finds-panel { padding: 16px; margin-bottom: 18px; border: 1px solid rgba(163, 137, 244, 0.4); }
.finds-panel h3, .due-panel h3 { margin: 0 0 4px; font-size: 1.05rem; }
.find-row { padding: 10px 0; border-top: 1px solid var(--glass-border); }
.find-row .contact-main { grid-template-columns: minmax(220px, 1fr) auto auto auto; }
.list-heading { margin: 4px 0 10px; font-size: 1.05rem; }

.due-panel { padding: 16px; margin-bottom: 18px; border: 1px solid rgba(251, 191, 36, 0.45); }
.due-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--glass-border); font-size: 0.9rem; }
.due-when { color: #fbbf24; font-weight: 600; white-space: nowrap; }
.due-row.overdue .due-when { color: #f87171; }
.due-note { opacity: 0.75; font-style: italic; }
.due-row .link-btn { margin-left: auto; }

.contact-fields { grid-template-columns: 150px 200px 170px 1fr; }
.follow-up { display: flex; align-items: center; gap: 4px; }
.follow-up input { width: 100%; color-scheme: dark; }
.contact-row.due { box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.5); }
@media (max-width: 1100px) { .contact-fields { grid-template-columns: 1fr 1fr; } }

/* ---------- Filter i resultatlistan (F1-8) ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filter-label { font-size: 0.85rem; opacity: 0.6; }
.filter-chip { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-size: 0.85rem; padding: 5px 12px;
    border-radius: 16px; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.04); user-select: none; }
.filter-chip input { display: none; }
.filter-chip.on { border-color: var(--accent-primary); background: rgba(163, 137, 244, 0.2); color: var(--text-primary, #fff); }

/* ---------- Avfärda fynd och bevakningens inställningar (F2-10, F2-11) ---------- */
.find-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dismiss-btn { color: var(--text-muted); font-size: 0.8rem; }
.dismiss-btn:hover { color: #f87171; }
.find-row .contact-main { grid-template-columns: minmax(220px, 1fr) auto auto auto; }
.params-edit { margin-top: 10px; font-size: 0.88rem; }
.params-edit summary { cursor: pointer; color: var(--text-secondary); list-style: none; }
.params-edit summary::-webkit-details-marker { display: none; }
.params-change { color: var(--accent-primary); margin-left: 6px; text-decoration: underline; }
.params-edit[open] .params-change { display: none; }
.params-form { display: grid; grid-template-columns: 2fr 1fr auto auto; gap: 10px; align-items: end; margin-top: 10px; }
.params-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; opacity: 0.85; }
@media (max-width: 1100px) { .params-form { grid-template-columns: 1fr; } }

/* ---------- Inloggning (D-016) ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { width: 100%; max-width: 400px; padding: 36px 32px; display: flex; flex-direction: column; gap: 14px; }
.login-box .logo { justify-content: center; margin: 0; }
.login-sub { text-align: center; color: var(--text-secondary); margin: 0 0 6px; }
.login-box label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-secondary); }
.login-box input[type=email], .login-box input[type=password] { padding: 11px 12px; border-radius: 8px; border: 1px solid var(--glass-border);
    background: rgba(26, 27, 46, 0.6); color: var(--text-primary, #fff); font-size: 1rem; }
.login-box input:focus { outline: none; border-color: var(--accent-primary); }
.login-btn { margin-top: 6px; padding: 12px; border-radius: 8px; border: none; font-size: 1rem; font-weight: 700; cursor: pointer;
    background: var(--accent-primary); color: #12121f; }
.login-error { padding: 10px 12px; border-radius: 8px; background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.5); color: #fca5a5; font-size: 0.9rem; }
.login-hint { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.login-hint code { display: block; margin-top: 6px; font-size: 0.75rem; word-break: break-all; opacity: 0.85; }
.user-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; margin-bottom: 8px; font-size: 0.85rem; color: var(--text-secondary); }
.user-bar form { margin: 0; }
.login-box .logo { width: 100%; justify-content: center; gap: 0; }
.logo-primary + .logo-secondary { margin-left: 0; }
.erase-btn { font-size: 0.75rem; color: var(--text-muted); margin: 6px 0 0 28px; }
.erase-btn:hover { color: #f87171; }
.logo { gap: 0; }
.login-box .logo { text-align: center; }

/* ---------- Sparade sökningar i uppdraget (F2-8) ---------- */
.searches-panel { padding: 16px; margin-bottom: 18px; }
.searches-panel h3 { margin: 0 0 4px; font-size: 1.05rem; }
.search-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--glass-border); font-size: 0.9rem; }
.search-when { font-weight: 600; white-space: nowrap; }
.search-meta { color: var(--text-secondary); }
.search-row .ask-btn { margin-left: auto; padding: 6px 14px; }
.search-row .ask-btn:disabled { opacity: 0.4; cursor: default; }

/* Nya från bevakningen: hopfälld lista */
.finds-panel > summary, .list-panel > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.finds-panel > summary::-webkit-details-marker, .list-panel > summary::-webkit-details-marker { display: none; }
.finds-panel > summary::before, .list-panel > summary::before { content: "▸"; color: var(--accent-primary); transition: transform 0.15s; }
.finds-panel[open] > summary::before, .list-panel[open] > summary::before { transform: rotate(90deg); }
.finds-panel > summary h3, .list-panel > summary h3 { margin: 0; }
.finds-panel[open] > summary { margin-bottom: 8px; }
.list-panel { padding: 16px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.02); }
.list-panel[open] > summary { margin-bottom: 12px; }

/* ==========================================================================
   Chattvyn (gren chatt-ui): sidomeny, tråd och inmatning längst ned
   ========================================================================== */
.chat-app { position: relative; z-index: 1; display: flex; height: 100vh; }
.chat-side { width: 250px; flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; padding: 18px 12px;
    background: rgba(15, 16, 26, 0.85); border-right: 1px solid var(--glass-border); }
.chat-logo { font-size: 1.35rem; margin: 0 8px 14px; }
.side-btn { text-align: left; padding: 9px 12px; border-radius: 8px; border: 1px solid transparent; background: none;
    color: var(--text-primary); font: inherit; font-size: 0.92rem; cursor: pointer; }
.side-btn:hover, .side-btn.active { background: rgba(163, 137, 244, 0.12); border-color: var(--glass-border); }
.side-label { margin: 16px 12px 4px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.recent { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; min-height: 0; }
.recent-item { text-align: left; padding: 7px 12px; border-radius: 8px; border: none; background: none; color: var(--text-secondary);
    font: inherit; font-size: 0.88rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.recent-item.active { background: rgba(163, 137, 244, 0.15); color: var(--text-primary); }
.side-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 0;
    border-top: 1px solid var(--glass-border); font-size: 0.85rem; color: var(--text-secondary); }

.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.chat-top { position: absolute; top: 14px; right: 18px; z-index: 20; }
.chat-scroll { flex: 1; overflow-y: auto; position: relative; padding: 32px 24px 12px; }
.chat-tools { flex: 1; overflow-y: auto; padding: 72px 32px 24px; }
#thread { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg .bubble { max-width: 100%; line-height: 1.55; font-size: 0.97rem; }
.msg.user .bubble { max-width: 75%; padding: 10px 16px; border-radius: 18px 18px 4px 18px; background: rgba(163, 137, 244, 0.2);
    white-space: pre-wrap; max-height: 240px; overflow-y: auto; }
.msg.bot .bubble { padding: 4px 2px; color: var(--text-primary); }
.msg.pending .bubble { color: var(--text-secondary); }
.msg-error { color: #f87171; }
.typing { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-primary); animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Resultatbubblan */
.msg.result .bubble { width: 100%; }
.result-head { font-weight: 700; font-size: 1.05rem; }
.result-note { margin: 2px 0 0; font-size: 0.82rem; color: var(--text-muted); }
.result-summary { margin: 4px 0 10px; color: var(--text-secondary); font-size: 0.92rem; }
.cand-group { margin: 16px 0 4px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.cand-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--glass-border); border-radius: 12px; overflow: hidden; }
.cand { padding: 10px 14px; background: rgba(26, 27, 46, 0.45); }
.cand-row { display: flex; align-items: center; gap: 12px; }
.cand + .cand { border-top: 1px solid rgba(163, 137, 244, 0.1); }
.cand:hover { background: rgba(163, 137, 244, 0.08); }
.cand-score { flex-shrink: 0; min-width: 42px; padding: 3px 0; border-radius: 999px; text-align: center;
    font-weight: 700; font-size: 0.8rem; cursor: help; border: 1px solid transparent; }
.cand-score.s5 { background: rgba(16, 185, 129, 0.2); color: #34d399; border-color: #34d399; }
.cand-score.s4 { background: rgba(16, 185, 129, 0.1); color: #6ee7b7; border-color: rgba(110, 231, 183, 0.5); }
.cand-score.s3 { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border-color: rgba(251, 191, 36, 0.5); }
.cand-score.s2, .cand-score.s1, .cand-score.s0 { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }
.cand-body { flex: 1; min-width: 0; }
.cand-name { color: var(--text-primary); font-weight: 600; text-decoration: none; }
.cand-name:hover { color: var(--accent-primary); text-decoration: underline; }
button.cand-name { background: none; border: none; padding: 0; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
button.cand-name::after { content: " ▸"; font-size: 0.8em; color: var(--text-muted); }
.cand.open button.cand-name::after { content: " ▾"; }
.cand-details { display: none; margin: 10px 0 2px 54px; }
.cand.open .cand-details { display: block; }
.cand-snippet { margin: 0; padding: 8px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.04);
    font-size: 0.86rem; line-height: 1.5; color: var(--text-secondary); }
.cand-why { margin: 8px 0 0; font-size: 0.86rem; color: var(--text-secondary); font-style: italic; }
/* LinkedIn är vägen till kandidaten: tydlig knapp i LinkedIns färg */
.li-btn { flex-shrink: 0; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
    background: #0a66c2; color: #fff; transition: transform 0.15s, background 0.15s; }
.li-btn:hover { background: #0b77e0; transform: translateY(-1px); }
.cand-tag { margin-left: 8px; font-size: 0.72rem; padding: 1px 7px; border-radius: 999px; vertical-align: 1px;
    color: var(--accent-primary); border: 1px solid var(--glass-border); }
.cand-meta { font-size: 0.86rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand-add { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--glass-border);
    background: none; color: var(--accent-primary); font-size: 1.1rem; cursor: pointer; display: grid; place-items: center; }
.cand-add:hover { background: rgba(163, 137, 244, 0.15); }
.cand-add.done { color: #34d399; border-color: rgba(52, 211, 153, 0.4); cursor: default; }
.cand-more { margin-top: 12px; }
.cand-more summary { cursor: pointer; color: var(--text-muted); font-size: 0.88rem; }
.cand-more .cand-list { margin-top: 8px; opacity: 0.75; }

/* Inmatningen */
.composer { padding: 12px 24px 22px; }
.composer-box { max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 10px 18px;
    border-radius: 22px; border: 1px solid var(--glass-border); background: rgba(26, 27, 46, 0.85);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); }
.composer-box:focus-within { border-color: var(--accent-primary); }
.composer-box textarea { flex: 1; resize: none; border: none; outline: none; background: none; color: var(--text-primary);
    font: inherit; font-size: 0.98rem; line-height: 1.5; padding: 6px 0; max-height: 220px; }
.composer-send { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--accent-primary); color: #12121f; font-size: 1.15rem; font-weight: 700; }
.composer-send:disabled { opacity: 0.3; cursor: default; }

.menu-btn, .menu-overlay { display: none; }
.chat-app { height: 100dvh; }

@media (max-width: 760px) {
    /* Sidomenyn glider in från vänster */
    .chat-side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: 270px; transform: translateX(-100%);
        transition: transform 0.2s ease; background: #0f101a; }
    .chat-side.open { transform: translateX(0); box-shadow: 8px 0 30px rgba(0, 0, 0, 0.5); }
    .menu-overlay { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, 0.5); }
    .menu-btn { display: grid; place-items: center; position: fixed; top: 12px; left: 12px; z-index: 30; width: 42px; height: 42px;
        border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(26, 27, 46, 0.95);
        color: var(--text-primary); font-size: 1.3rem; cursor: pointer; }
    .chat-top { top: 12px; right: 12px; }
    .chat-scroll { padding: 68px 12px 8px; }
    .chat-tools { padding: 68px 12px 16px; }
    .composer { padding: 8px 10px 12px; }
    .composer-box textarea { font-size: 16px; }   /* iPhone zoomar annars in */
    .msg.welcome { margin-top: 22vh; }
    .msg.welcome .bubble { font-size: 1.2rem; }
    .msg.user .bubble { max-width: 88%; }
    .cand { padding: 10px; }
    .cand-row { gap: 8px; }
    .cand-score { min-width: 36px; font-size: 0.75rem; }
    .cand-meta { white-space: normal; }
    .cand-details { margin-left: 0; }
    .ccard { padding: 12px; }
    .step, .step-no { padding: 5px 9px; }
    .step-no { margin-left: 0; }
    .ccard-foot .contact-input.notes { min-width: 100%; }
    .notif-panel { width: calc(100vw - 24px); right: -6px; }
    .view-head { padding-left: 4px; }
}

/* Startläget: välkomsttexten mitt i bild, som en tom chatt */
.msg.welcome { justify-content: center; margin-top: 30vh; }
.msg.welcome .bubble { font-size: 1.5rem; font-weight: 600; text-align: center; color: var(--text-primary); }
.recent-item small { display: block; font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }

/* ---------- Kontaktlistan (D-020): kort med LinkedIn-steg ---------- */
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.view-title { font-size: 1.4rem; margin: 0; }
.empty-note { color: var(--text-secondary); margin-top: 12px; }
.contact-filter { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--glass-border); background: rgba(26, 27, 46, 0.85);
    color: var(--text-primary); font: inherit; font-size: 0.9rem; }
#contacts-view { max-width: 860px; margin: 0 auto; }
.ccard-group { margin-bottom: 28px; }
.ccard-group-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0 0 8px; }
.ccard-group-title span { margin-left: 6px; padding: 0 7px; border-radius: 999px; background: rgba(163, 137, 244, 0.15); color: var(--accent-primary); }
.ccard { padding: 14px 16px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--glass-border);
    background: rgba(26, 27, 46, 0.55); border-left: 3px solid var(--glass-border); }
.ccard.status-to_contact { border-left-color: var(--accent-primary); }
.ccard.status-invited, .ccard.status-connected, .ccard.status-dm { border-left-color: #60a5fa; }
.ccard.status-replied, .ccard.status-called { border-left-color: #fbbf24; }
.ccard.status-presented { border-left-color: #34d399; }
.ccard.status-no { opacity: 0.55; border-left-color: #64748b; }
.ccard.due { box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.5); }
.ccard-top { display: flex; align-items: flex-start; gap: 12px; }
.ccard-top .cand-score { margin-top: 2px; }
.ccard-top .contact-remove { margin-left: auto; }
.cand-meta.wrap { white-space: normal; }
.ccard-snippet { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.03);
    font-size: 0.86rem; line-height: 1.5; color: var(--text-secondary); }
.ccard-why { margin: 8px 0 0; font-size: 0.86rem; color: var(--text-secondary); font-style: italic; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.step, .step-no { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--glass-border); background: none;
    color: var(--text-muted); font: inherit; font-size: 0.82rem; cursor: pointer; transition: background 0.15s, color 0.15s; }
.step:hover, .step-no:hover { color: var(--text-primary); border-color: var(--accent-primary); }
.step.done { background: rgba(96, 165, 250, 0.14); color: #bfdbfe; border-color: rgba(96, 165, 250, 0.45); }
.step.current { background: rgba(96, 165, 250, 0.3); color: #fff; font-weight: 600; }
.step-no { margin-left: auto; }
.step-no.on { background: rgba(100, 116, 139, 0.3); color: var(--text-primary); }
.ccard-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 0.85rem; }
.ccard-since { color: var(--text-secondary); }
.ccard-foot .follow-up.due { color: #fbbf24; }
.ccard-foot .contact-input.notes { flex: 1; min-width: 180px; }
.ccard-more { margin-top: 8px; }
.ccard-more summary { cursor: pointer; font-size: 0.8rem; color: var(--text-muted); }
.ccard-more .contact-fields { margin-top: 8px; }

.cand-row { cursor: pointer; }

/* E-post på kontaktkortet (D-021) */
.ccard-email { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.find-email { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--accent-primary); background: rgba(163, 137, 244, 0.12);
    color: var(--text-primary); font: inherit; font-size: 0.85rem; cursor: pointer; }
.find-email:hover { background: rgba(163, 137, 244, 0.25); }
.find-email:disabled { opacity: 0.6; cursor: default; }
.mail-link { color: var(--text-primary); font-weight: 600; text-decoration: none; }
.mail-link:hover { color: var(--accent-primary); text-decoration: underline; }
.email-chip { font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; border: 1px solid; }
.email-chip a { color: inherit; text-decoration: none; }
.email-chip.found { color: #34d399; border-color: rgba(52, 211, 153, 0.5); }
.email-chip.likely { color: #fbbf24; border-color: rgba(251, 191, 36, 0.5); }
.email-chip.guess { color: #f87171; border-color: rgba(248, 113, 113, 0.5); }
.email-note { font-size: 0.78rem; color: var(--text-muted); }
