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

:root {
    --ink: #0a0a0a;
    --paper: #fafaf8;
    --accent: #1a5cff;
    --accent-light: #e8effe;
    --muted: #6b6b6b;
    --border: #e2e2e0;
    --warm: #f5f0e8;
    --green: #059669;
    --green-light: #ecfdf5;
    --red: #dc2626;
    --red-light: #fef2f2;
    --yellow: #d97706;
    --yellow-light: #fffbeb;
}

body {
    font-family: 'DM Sans', sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.15;
}

/* APP NAV */
.app-nav {
    padding: 16px 48px;
    display: flex;
    align-items: center;
    gap: 48px;
    border-bottom: 1px solid var(--border);
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--ink);
    text-decoration: none;
}
.logo span { color: var(--accent); }

.nav-tabs { display: flex; gap: 4px; }

.nav-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.15s;
}
.nav-tab:hover { background: var(--warm); color: var(--ink); }
.nav-tab.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

/* MAIN CONTENT */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 48px;
}

/* DASHBOARD VIEW */
.dashboard-header {
    margin-bottom: 32px;
}
.dashboard-header h1 {
    font-size: 28px;
    letter-spacing: -0.5px;
}
.dashboard-header p { color: var(--muted); margin-top: 4px; }

.pipeline-overview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: transform 0.15s;
}
.stat-card:hover { transform: translateY(-2px); }

.stat-card .number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
}
.stat-card .label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    font-weight: 500;
}

/* ROLES LIST */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.section-header h2 { font-size: 22px; }

.role-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.role-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.role-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}
.role-card h3 { font-size: 18px; margin-bottom: 4px; }
.role-meta { font-size: 13px; color: var(--muted); }

.badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
}
.badge-active { background: var(--green-light); color: var(--green); }
.badge-sourced { background: var(--accent-light); color: var(--accent); }
.badge-closed { background: var(--warm); color: var(--muted); }

.role-stats {
    display: flex;
    gap: 24px;
}
.role-stat { font-size: 13px; color: var(--muted); }
.role-stat strong { color: var(--ink); font-weight: 600; }

/* NEW ROLE FORM */
.form-container {
    max-width: 640px;
}
.form-container h1 {
    font-size: 28px;
    margin-bottom: 8px;
}
.form-container p { color: var(--muted); margin-bottom: 32px; }

.form-group {
    margin-bottom: 24px;
}
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
.form-group .hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    background: white;
    color: var(--ink);
    transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
textarea { resize: vertical; min-height: 120px; }

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

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-primary {
    background: var(--ink);
    color: white;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-accent {
    background: var(--accent);
    color: white;
}
.btn-accent:hover { opacity: 0.9; }
.btn-outline {
    background: white;
    color: var(--ink);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--paper); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-danger { background: var(--red-light); color: var(--red); }
.btn-danger:hover { background: var(--red); color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ROLE DETAIL */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'DM Sans', sans-serif;
}
.back-link:hover { color: var(--ink); }

.role-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
}
.role-detail-header h1 { font-size: 28px; margin-bottom: 8px; }
.role-detail-header .meta { color: var(--muted); font-size: 14px; }
.role-actions { display: flex; gap: 8px; }

.candidate-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.candidate-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
}
.candidate-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.candidate-table tr:last-child td { border-bottom: none; }
.candidate-table tr:hover td { background: var(--paper); }

.score-badge {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 6px;
}
.score-high { background: var(--green-light); color: var(--green); }
.score-mid { background: var(--accent-light); color: var(--accent); }
.score-low { background: var(--yellow-light); color: var(--yellow); }

.status-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
}
.status-sourced { background: var(--warm); color: var(--muted); }
.status-contacted { background: var(--accent-light); color: var(--accent); }
.status-replied { background: var(--green-light); color: var(--green); }
.status-scheduled { background: #f0fdf4; color: #166534; }
.status-hired { background: #ecfdf5; color: #059669; }
.status-rejected { background: var(--red-light); color: var(--red); }

/* OUTREACH MODAL */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.2s;
}
.modal-overlay.visible { opacity: 1; }

.modal {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 640px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.2s;
}
.modal-overlay.visible .modal { transform: translateY(0); }

.modal h2 { font-size: 22px; margin-bottom: 24px; }
.modal .email-preview {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}
.modal .email-preview .subject {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.modal .email-preview .body {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink);
}
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* LOADING */
.loading {
    text-align: center;
    padding: 60px;
    color: var(--muted);
}
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; color: var(--ink); margin-bottom: 8px; }
.empty-state p { margin-bottom: 24px; }

/* TOAST */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--ink);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
}
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

/* RESPONSIVE */
@media (max-width: 768px) {
    .app-nav { padding: 12px 16px; gap: 16px; flex-wrap: wrap; }
    main { padding: 24px 16px; }
    .pipeline-overview { grid-template-columns: repeat(3, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .role-detail-header { flex-direction: column; gap: 16px; }
    .candidate-table { font-size: 13px; }
    .candidate-table th, .candidate-table td { padding: 10px 12px; }
}

@media (max-width: 480px) {
    .pipeline-overview { grid-template-columns: repeat(2, 1fr); }
    .nav-tabs { overflow-x: auto; }
}
