/* ═══════════════════════════════════════════════════════════════
   TalentMatch Pro – Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Colors */
    --bg-primary: #0f1117;
    --bg-secondary: #161922;
    --bg-tertiary: #1c2030;
    --bg-card: #1a1e2e;
    --bg-hover: #242838;
    --bg-input: #1c2030;
    --border: #2a2f42;
    --border-focus: #4f7cff;

    --text-primary: #e8eaf0;
    --text-secondary: #8b92a8;
    --text-muted: #5a6178;
    --text-link: #6b8aff;

    --accent: #4f7cff;
    --accent-hover: #3d6bef;
    --accent-light: rgba(79, 124, 255, 0.12);
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.12);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.12);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.12);

    /* Typography */
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --sidebar-w: 240px;
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.2s ease;
}

/* ─── Light Theme ─────────────────────────────────────────── */
[data-theme="light"] {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #edf0f5;
    --bg-card: #ffffff;
    --bg-hover: #e8ecf1;
    --bg-input: #ffffff;
    --border: #d1d5de;
    --border-focus: #4f7cff;

    --text-primary: #1a1d26;
    --text-secondary: #5a6178;
    --text-muted: #8b92a8;
    --text-link: #3d6bef;

    --accent: #4f7cff;
    --accent-hover: #3d6bef;
    --accent-light: rgba(79, 124, 255, 0.10);
    --success: #16a34a;
    --success-light: rgba(22, 163, 74, 0.10);
    --warning: #d97706;
    --warning-light: rgba(217, 119, 6, 0.10);
    --danger: #dc2626;
    --danger-light: rgba(220, 38, 38, 0.10);
}
[data-theme="light"] .card { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
[data-theme="light"] .stat-card { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
[data-theme="light"] .modal { box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
[data-theme="light"] .btn-success { color: #fff; }
[data-theme="light"] .login-container { background: transparent; }

/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}
a { color: var(--text-link); text-decoration: none; }
input, select, textarea, button { font-family: var(--font); }

/* ─── Screens ─────────────────────────────────────────────── */
.screen { display: none; height: 100vh; }
.screen.active { display: flex; }

/* ─── Login ───────────────────────────────────────────────── */
.login-container {
    margin: auto;
    width: 100%;
    max-width: 380px;
    padding: 2rem;
}
.login-brand {
    text-align: center;
    margin-bottom: 2.5rem;
}
.logo-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.3rem; color: white;
    margin-bottom: 1rem;
}
.login-brand h1 {
    font-size: 1.6rem; font-weight: 700;
    color: var(--text-primary);
}
.login-brand h1 span { color: var(--accent); }
.login-brand p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 0.3rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }

/* ─── Forms ───────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label {
    font-size: 0.8rem; font-weight: 600;
    color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em;
}
input, select, textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border var(--transition);
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-light);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; display: block; margin-bottom: 0.25rem; }
.input { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.65rem 0.85rem; color: var(--text-primary); font-size: 0.95rem; transition: border var(--transition); outline: none; width: 100%; box-sizing: border-box; }
.input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-light); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
    white-space: nowrap;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #e85555; }
.btn-success { background: var(--success); color: #0f1117; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-full { width: 100%; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
.btn-icon { padding: 0.4rem; border-radius: var(--radius); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    flex-shrink: 0;
}
.sidebar-header {
    padding: 1.2rem 1rem;
    display: flex; align-items: center; gap: 0.7rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

/* Instance Switcher (Cloud / Test) */
.instance-switcher {
    cursor: pointer;
    margin-left: auto;
    transition: transform 0.2s;
}
.instance-switcher:hover {
    transform: scale(1.05);
}
.instance-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.logo-small {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; color: white;
    flex-shrink: 0;
}
.logo-text { font-weight: 700; font-size: 1rem; }
.sidebar-nav {
    flex: 1; padding: 0.6rem 0.5rem;
    display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem; font-weight: 500;
    transition: all var(--transition);
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-light); color: var(--accent); }
.nav-item .material-icons-outlined { font-size: 1.25rem; }
.nav-divider { height: 1px; background: var(--border); margin: 0.5rem 0.75rem; }

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 0.5rem;
}
.user-info { flex: 1; display: flex; align-items: center; gap: 0.5rem; overflow: hidden; }
.user-avatar {
    width: 32px; height: 32px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; color: var(--accent);
    flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--text-muted); text-transform: capitalize; }

/* ─── Content ─────────────────────────────────────────────── */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

/* ─── Page Header ─────────────────────────────────────────── */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem;
}
.page-header h2 { font-size: 1.4rem; font-weight: 700; }
.page-header-actions { display: flex; gap: 0.5rem; }

/* ─── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}
.stat-card .stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; margin-top: 0.3rem; }
.stat-card .stat-sub { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* ─── Table ───────────────────────────────────────────────── */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}
tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--bg-hover); }
tbody tr { cursor: pointer; }

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.72rem; font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--accent-light); color: var(--accent); }
.badge-neutral { background: var(--bg-tertiary); color: var(--text-secondary); }

/* ─── Tags ────────────────────────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.78rem; color: var(--text-secondary);
}
.tag .remove-tag {
    cursor: pointer; font-size: 0.9rem;
    color: var(--text-muted);
    transition: color var(--transition);
}
.tag .remove-tag:hover { color: var(--danger); }

/* ─── Match Score ─────────────────────────────────────────── */
.match-score {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px;
    border-radius: 50%;
    font-size: 0.85rem; font-weight: 700;
    border: 3px solid;
}
.match-score.high { border-color: var(--success); color: var(--success); }
.match-score.medium { border-color: var(--warning); color: var(--warning); }
.match-score.low { border-color: var(--danger); color: var(--danger); }

/* ─── Match Card ──────────────────────────────────────────── */
.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex; gap: 1rem; align-items: flex-start;
    transition: border-color var(--transition);
    cursor: pointer;
}
.match-card:hover { border-color: var(--accent); }
.match-card-content { flex: 1; }
.match-card-content h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.match-card-content p { font-size: 0.85rem; color: var(--text-secondary); }
.match-card-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* ─── Anonymization Toggles ───────────────────────────────── */
.anon-toggle {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0;
}
.anon-toggle label { font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; }
.switch {
    position: relative;
    width: 40px; height: 22px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 11px;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.switch input { display: none; }
.switch .slider {
    position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition);
}
.switch input:checked + .slider {
    transform: translateX(18px);
    background: #fff;
}
.switch:has(input:checked) {
    background: var(--accent);
    border-color: var(--accent);
}

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%; max-width: 600px;
    max-height: 85vh;
    display: flex; flex-direction: column;
}
.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 600; }
.modal-body { padding: 1.25rem; overflow-y: auto; flex: 1; }
.modal-body .form-group { margin-bottom: 0.75rem; }
.modal-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 0.5rem;
}
.modal.modal-wide { max-width: 900px; }

/* ─── Loading ─────────────────────────────────────────────── */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 17, 23, 0.85);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 3000;
}
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { margin-top: 1rem; color: var(--text-secondary); }

/* ─── Empty State ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state .material-icons-outlined { font-size: 3rem; margin-bottom: 0.75rem; display: block; }
.empty-state p { font-size: 0.95rem; margin-bottom: 1rem; }

/* ─── Error Message ───────────────────────────────────────── */
.error-msg {
    background: var(--danger-light);
    color: var(--danger);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ─── Drag & Drop Zone ────────────────────────────────────── */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    transition: all var(--transition);
    cursor: pointer;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}
.drop-zone .material-icons-outlined { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }

/* ─── Drag & Drop List Items ──────────────────────────────── */
.drag-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.4rem;
    cursor: grab;
    transition: all var(--transition);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.drag-item strong { flex-shrink: 0; }
.drag-item .text-muted { flex: 1; }
.drag-item .btn { flex-shrink: 0; margin-left: auto; }
.drag-item:hover { background: var(--bg-hover); border-color: var(--accent); }
.drag-item.ai-skill-item { cursor: pointer; }
.drag-item.ai-skill-item:hover { background: var(--accent-light); border-color: var(--accent); }
.drag-item.dragging { opacity: 0.5; }
.drag-target { border: 2px dashed var(--accent); background: var(--accent-light); min-height: 60px; border-radius: var(--radius); padding: 0.5rem; }

/* ─── Search Bar ──────────────────────────────────────────── */
.search-bar {
    position: relative; max-width: 350px;
}
.search-bar input {
    width: 100%; padding-left: 2.5rem;
}
.search-bar .material-icons-outlined {
    position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
    font-size: 1.1rem; color: var(--text-muted);
}

/* ─── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tab {
    padding: 0.6rem 1.1rem;
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── Section Divider ─────────────────────────────────────── */
.section-title {
    font-size: 0.75rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1.5rem 0 0.75rem;
}

/* ─── Scroll ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.hidden { display: none !important; }

/* ─── Logo Images ─────────────────────────────────────────────── */
.logo-img { margin-bottom: 0.5rem; }
.logo-small-img { flex-shrink: 0; }

/* ─── Avatar Small ────────────────────────────────────────────── */
.avatar-sm {
    width: 36px; height: 36px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; color: var(--accent);
    overflow: hidden; flex-shrink: 0;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

/* ─── Detail Grid ─────────────────────────────────────────────── */
.detail-grid { display: flex; flex-direction: column; }
.detail-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.text-body { font-size: 0.9rem; line-height: 1.6; color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

/* ─── Photo Upload ────────────────────────────────────────────── */
.photo-upload-area {
    display: flex; flex-direction: column; align-items: center; padding: 1.25rem 0;
}
.photo-wrapper {
    position: relative; width: 140px; height: 140px; border-radius: 50%; cursor: pointer;
}
.photo-wrapper:hover .photo-overlay { opacity: 1; }
.employee-photo {
    width: 140px; height: 140px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--accent); box-shadow: 0 4px 20px rgba(79, 124, 255, 0.2);
    transition: transform var(--transition), box-shadow var(--transition);
}
.photo-wrapper:hover .employee-photo { transform: scale(1.03); box-shadow: 0 6px 28px rgba(79, 124, 255, 0.3); }
.photo-overlay {
    position: absolute; inset: 0; border-radius: 50%;
    background: rgba(0, 0, 0, 0.55); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 0.25rem;
    opacity: 0; transition: opacity var(--transition);
}
.photo-overlay .material-icons-outlined { font-size: 1.5rem; color: #fff; }
.photo-overlay span:last-child { font-size: 0.7rem; color: rgba(255,255,255,0.85); font-weight: 500; }
.photo-placeholder {
    width: 140px; height: 140px; border-radius: 50%;
    background: var(--bg-tertiary); border: 3px dashed var(--border);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
    cursor: pointer; transition: border-color var(--transition), background var(--transition);
}
.photo-placeholder:hover { border-color: var(--accent); background: var(--accent-light); }
.photo-placeholder .material-icons-outlined { font-size: 2.5rem; color: var(--text-muted); transition: color var(--transition); }
.photo-placeholder:hover .material-icons-outlined { color: var(--accent); }
.photo-placeholder .photo-hint { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }
.photo-placeholder:hover .photo-hint { color: var(--accent); }

/* ─── Project/Edu Cards ───────────────────────────────────────── */
.project-card, .edu-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem;
    margin-bottom: 0.75rem;
}
.project-header, .edu-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.3rem; }
.project-meta { display: flex; gap: 0.5rem; align-items: center; margin: 0.3rem 0; flex-wrap: wrap; }
.project-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }

/* ─── Requirements List ───────────────────────────────────────── */
.requirements-list { display: flex; flex-direction: column; gap: 0.5rem; }
.req-item {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.req-header { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.2rem; }
.req-header button { margin-left: auto; }
.req-name { font-size: 0.9rem; font-weight: 500; }

/* ─── Match Card Selected ─────────────────────────────────────── */
.match-card.selected { border-color: var(--accent); background: var(--accent-light); }
.match-reasoning { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; padding: 0.5rem 0; }
.anon-controls { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

/* ─── Stats Grid (Dashboard) ──────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stats-grid .stat-card { cursor: pointer; transition: border-color var(--transition); }
.stats-grid .stat-card:hover { border-color: var(--accent); }
.stat-icon { margin-bottom: 0.5rem; color: var(--accent); }
.stat-icon .material-icons-outlined { font-size: 1.5rem; }

/* ─── Dashboard Grid ──────────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.list-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
}
.list-item:hover { background: var(--bg-hover); margin: 0 -0.5rem; padding: 0.6rem 0.5rem; border-radius: var(--radius); }
.list-item:last-child { border-bottom: none; }
.list-item-avatar {
    width: 36px; height: 36px; background: var(--accent-light); color: var(--accent);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.list-item-icon { color: var(--text-muted); }
.list-item-info { flex: 1; display: flex; flex-direction: column; }
.list-item-info strong { font-size: 0.9rem; }
.list-item-info .text-muted { font-size: 0.8rem; }

/* ─── Admin Sections ──────────────────────────────────────────── */
.admin-sections { display: flex; flex-direction: column; gap: 1.5rem; }
.admin-sections .table { font-size: 0.85rem; }
.btn-danger-text { color: var(--danger) !important; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-grid .full-width { grid-column: 1 / -1; }
.form-divider { padding: 0.75rem 0 0.25rem; border-top: 1px solid var(--border); margin-top: 0.5rem; }

/* ─── CV Preview ──────────────────────────────────────────────── */
.cv-container {
    background: white; color: #1a1a2e;
    border-radius: var(--radius-lg);
    overflow: auto;
    max-height: calc(100vh - 180px);
}
.cv-preview {
    padding: 2rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
}
.cv-preview.landscape { max-width: none; }
.cv-preview.portrait { max-width: 800px; margin: 0 auto; }

.cv-header { display: flex; gap: 1.5rem; align-items: center; padding-bottom: 1rem; border-bottom: 2px solid #4f7cff; margin-bottom: 1.5rem; }
.cv-header-info { flex: 1; }
.cv-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid #4f7cff; }
.cv-name { font-size: 1.4rem; color: #1a1a2e; margin: 0; }
.cv-title { font-size: 0.95rem; color: #555; margin: 0.2rem 0; }
.cv-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.8rem; color: #777; margin-top: 0.3rem; }
.cv-meta span { display: flex; align-items: center; gap: 0.2rem; }
.cv-meta .material-icons-outlined { font-size: 0.9rem; }

.cv-section { margin-bottom: 1.25rem; }
.cv-section h3 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: #4f7cff; border-bottom: 1px solid #e0e0e0; padding-bottom: 0.3rem; margin-bottom: 0.75rem; }

.cv-skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.4rem; }
.cv-skill { display: flex; justify-content: space-between; padding: 0.3rem 0.5rem; background: #f5f5ff; border-radius: 4px; font-size: 0.8rem; }
.cv-skill-name { font-weight: 600; }
.cv-skill-level { color: #666; }
.cv-skill-years { color: #4f7cff; font-weight: 600; }

.cv-project { padding: 0.6rem 0; border-bottom: 1px solid #eee; }
.cv-project:last-child { border-bottom: none; }
.cv-project-header { font-size: 0.9rem; }
.cv-client { color: #777; }
.cv-project-meta { display: flex; gap: 0.5rem; align-items: center; margin: 0.2rem 0; }
.cv-project-meta .badge { font-size: 0.7rem; background: #e8eeff; color: #4f7cff; }
.cv-project-desc { font-size: 0.8rem; color: #555; margin: 0.3rem 0; }
.cv-tech { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.cv-tech-tag { font-size: 0.7rem; padding: 0.1rem 0.4rem; background: #f0f0f0; border-radius: 3px; color: #555; }

.cv-cert-list { list-style: none; padding: 0; }
.cv-cert-list li { padding: 0.2rem 0; font-size: 0.85rem; }
.cv-cert-list li::before { content: "✓ "; color: #4f7cff; font-weight: bold; }
.cv-edu { padding: 0.3rem 0; font-size: 0.85rem; }
.cv-subtitle-line { font-size: 0.95rem; color: #555; margin: 0.2rem 0; }

/* ─── CV Editable Elements ────────────────────────────────── */
.cv-editable-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.cv-edit-hint {
    font-size: 0.75rem;
    color: #bbb;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    flex-shrink: 0;
}
.cv-editable-wrap:hover .cv-edit-hint {
    opacity: 1;
}
.cv-editable {
    outline: none;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 1px 3px;
    margin: -1px -3px;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: text;
    min-width: 40px;
}
.cv-editable:hover {
    border-color: rgba(79, 124, 255, 0.3);
    background: rgba(79, 124, 255, 0.03);
}
.cv-editable:focus {
    border-color: #4f7cff;
    background: rgba(79, 124, 255, 0.05);
    box-shadow: 0 0 0 2px rgba(79, 124, 255, 0.1);
}
.cv-editable[contenteditable="true"]::before {
    /* Placeholder for empty editable fields */
}
.cv-edit-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #f0f4ff;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #4f7cff;
    margin-top: 1rem;
}
.cv-edit-banner .material-icons-outlined {
    font-size: 1rem;
}

/* CV Color Schemes */
.cv-preview.color-dark .cv-header { border-bottom-color: #333; }
.cv-preview.color-dark .cv-section h3 { color: #333; }
.cv-preview.color-dark .cv-skill { background: #f0f0f0; }

.cv-preview.color-green .cv-header { border-bottom-color: #10b981; }
.cv-preview.color-green .cv-photo { border-color: #10b981; }
.cv-preview.color-green .cv-section h3 { color: #10b981; }
.cv-preview.color-green .cv-skill { background: #ecfdf5; }
.cv-preview.color-green .cv-cert-list li::before { color: #10b981; }
.cv-preview.color-green .cv-project-meta .badge { background: #ecfdf5; color: #10b981; }

/* ─── Spinner Small ───────────────────────────────────────────── */
.spinner-sm {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

/* ─── Page Loading ────────────────────────────────────────────── */
.page-loading {
    display: flex; justify-content: center; align-items: center;
    padding: 4rem 0;
}
.page { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── Two-Column Layout ───────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ─── Toast Notifications ────────────────────────────────── */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 420px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
}
.toast-visible { opacity: 1; transform: translateX(0); }
.toast-exit { opacity: 0; transform: translateX(100%); }
.toast-icon { font-size: 1.25rem; flex-shrink: 0; }
.toast-text { flex: 1; }
.toast-close {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 1.25rem; padding: 0; line-height: 1;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info { border-left: 3px solid var(--accent); }
.toast-info .toast-icon { color: var(--accent); }

/* ─── CV Import Review ───────────────────────────────────── */
.cv-review-section { margin-bottom: 0.5rem; }
.cv-review-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.35rem;
    cursor: pointer;
    transition: background var(--transition);
    font-size: 0.85rem;
}
.cv-review-item:hover { background: var(--bg-hover); }
.cv-review-item input[type="checkbox"] {
    margin-top: 0.15rem;
    flex-shrink: 0;
    accent-color: var(--accent);
}
.cv-review-item span { flex: 1; line-height: 1.4; }

/* ─── Mobile Menu Button ─────────────────────────────────── */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 101;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.4rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition);
}
.mobile-menu-btn:hover { background: var(--bg-hover); }

/* ─── Sidebar Backdrop (Mobile) ──────────────────────────── */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* ─── Responsive: Tablet ─────────────────────────────────── */
@media (max-width: 1024px) {
    .sidebar { width: 60px; }
    .sidebar .logo-text, .sidebar .nav-item span:last-child,
    .sidebar .user-details { display: none; }
    .sidebar-header { justify-content: center; }
    .nav-item { justify-content: center; padding: 0.7rem; }
    .sidebar-footer { flex-direction: column; }
    .two-col { grid-template-columns: 1fr; }
    #toast-container { right: 0.5rem; left: 0.5rem; max-width: none; }
}

/* ─── Globaler Fortschrittsbalken ────────────────────────── */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}
#progress-bar.pb-visible { opacity: 1; }
#progress-bar.pb-hidden  { opacity: 0; }

.pb-track {
    width: 100%;
    height: 3px;
    background: rgba(79, 124, 255, 0.18);
}
.pb-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    transition: width 0.35s ease;
}
#progress-bar.pb-error .pb-fill {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}
.pb-label {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px 2px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 0 0 4px 4px;
    max-width: 480px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 18px;
    opacity: 0.92;
}
#progress-bar.pb-error .pb-label { color: var(--danger); }

/* ─── Responsive: Mobile ─────────────────────────────────── */
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    .sidebar { position: fixed; left: -250px; width: 250px; transition: left 0.3s; z-index: 100; }
    .sidebar.open { left: 0; }
    .sidebar .logo-text, .sidebar .nav-item span:last-child,
    .sidebar .user-details { display: initial; }
    .sidebar-header { justify-content: flex-start; }
    .nav-item { justify-content: flex-start; padding: 0.6rem 0.75rem; }
    .sidebar-footer { flex-direction: row; }
    .content { margin-left: 0; padding-top: 3.5rem; }
    .page-header { flex-direction: column; gap: 0.75rem; }
    .page-header-actions { flex-wrap: wrap; width: 100%; }
    .search-bar { max-width: 100%; }
    .form-row { flex-direction: column; }
    .modal { max-width: 95vw; margin: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .three-col { grid-template-columns: 1fr; }
}

/* Old fullscreen overlay removed – using KI Tasks Bar instead */

/* ═══════════════════════════════════════════════════════════════
   KI Tasks Cards (Non-Blocking, Top-Right Corner)
   Positioned in the top-right so sidebar + page header stay usable
   ═══════════════════════════════════════════════════════════════ */
#ki-tasks-container {
    position: fixed;
    top: 12px;
    right: 16px;
    width: 360px;
    max-width: calc(100vw - 280px);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

#ki-tasks-container > * {
    pointer-events: auto;
}

.ki-task {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    animation: kiSlideIn 0.35s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

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

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

.ki-task-icon {
    font-size: 1.3rem;
    min-width: 30px;
    text-align: center;
    color: var(--accent);
}

.ki-task-icon .ki-robot-mini {
    animation: kiPulse 2s ease-in-out infinite;
}

@keyframes kiPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.ki-task-title {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ki-task-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ki-task-progress {
    width: 140px;
    min-width: 140px;
}

.ki-task-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.ki-task-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 2px;
    transition: width 0.5s ease;
    width: 0%;
}

.ki-task-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: all var(--transition);
}

.ki-task-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Success state */
.ki-task-success {
    border-bottom-color: var(--success);
}

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

.ki-task-success .ki-task-icon .ki-robot-mini {
    animation: none;
}

.ki-task-success .ki-task-fill {
    background: var(--success);
}

/* Error state */
.ki-task-error {
    border-bottom-color: var(--danger);
}

.ki-task-error .ki-task-icon {
    color: var(--danger);
}

.ki-task-error .ki-task-icon .ki-robot-mini {
    animation: none;
}

.ki-task-error .ki-task-fill {
    background: var(--danger);
}

/* Success/Error left border color */
.ki-task-success {
    border-left-color: var(--success);
}
.ki-task-error {
    border-left-color: var(--danger);
}

/* Responsive: full width on mobile */
@media (max-width: 768px) {
    #ki-tasks-container {
        top: 8px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
    }
    .ki-task {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 6px;
    }
    .ki-task-progress {
        width: 100%;
        min-width: 100%;
        order: 10;
    }
}

/* Tablet: sidebar is smaller */
@media (min-width: 769px) and (max-width: 1024px) {
    #ki-tasks-container {
        max-width: calc(100vw - 100px);
    }
}
