:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(20, 27, 45, 0.7);
    /* More transparent for glassmorphism */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;

    /* Regular Blue Palette - Standardized */
    --neon-cyan: #3b82f6;
    /* Replaced with Blue 500 */
    --neon-magenta: #2563eb;
    /* Replaced with Blue 600 */
    --neon-purple: #1d4ed8;
    /* Replaced with Blue 700 */
    --neon-blue: #3b82f6;
    /* Base Blue */
    --neon-yellow: #fbbf24;
    /* Amber 400 (Readable Yellow) */

    --accent: #3b82f6;
    /* Regular Blue */
    --border: #1e293b;
    --font-main: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
}

header {
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    display: flex;
    flex-direction: row;
    /* Explicitly set row */
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: nowrap;
    /* Prevent wrapping */
}

.main-nav {
    display: flex;
    flex-direction: row;
    /* Explicitly set row */
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.logo-area {
    display: flex;
    flex-direction: column;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.search-area {
    flex: 1;
    max-width: 400px;
}

/* ... */
/* Views */
.view {
    display: none;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
}

.view.active {
    display: flex;
    overflow-y: auto;
}

/* Generator Styles */
.generator-container {
    padding: 1rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.gen-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
    margin-top: 2rem;
}

.gen-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

#gen-jd-input,
#gen-prompt-output {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    resize: none;
    font-size: 0.95rem;
    line-height: 1.5;
}

#gen-prompt-output {
    background: #111827;
    border-color: var(--accent-glow);
    min-height: 500px;
}

#search-input {
    width: 100%;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-checkbox {
    accent-color: var(--accent);
    cursor: pointer;
}

.filter-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

#search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.badge {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    box-shadow: 0 0 10px var(--accent-glow);
}

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

/* Kanban Board */
/* Target by ID to ensure specificity wins */
#view-board {
    display: flex;
    flex-direction: row !important;
    gap: 1rem;
    overflow-x: auto;
    align-items: flex-start;
}

.board {
    flex: 1;
    padding-bottom: 1rem;
}

.column {
    background: #111827;
    min-width: 300px;
    max-width: 300px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    height: 100%;
}

.column-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.column-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.count {
    background: var(--border);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
}

.sort-select:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.card-list {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-height: 150px;
    /* Ensure drop target exists */
}

/* Cards */
.card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
    position: relative;
    user-select: none;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--border);
}

.card-title {
    font-weight: 500;
    margin-bottom: 0.5rem;
    word-break: break-all;
    font-size: 0.95rem;
}

.card-company {
    color: var(--accent);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.card-notes {
    font-size: 0.85rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    /* Preserve line breaks */
    max-height: 80px;
    overflow-y: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    /* Limit to 3 lines */
    -webkit-box-orient: vertical;
}

.ghosting-tag {
    position: absolute;
    top: -8px;
    right: -4px;
    background: #FFD700;
    /* Gold/Yellow */
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transform: rotate(5deg);
}

.double-ghosting-tag {
    position: absolute;
    top: -8px;
    right: -4px;
    background: #f97316;
    /* Orange */
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transform: rotate(5deg);
}

.card.double-ghosted {
    background: rgba(249, 115, 22, 0.15) !important;
    /* Orange Tint */
    border: 1px solid #f97316 !important;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

.draft-tag {
    position: absolute;
    top: -8px;
    right: -4px;
    background: #3b82f6;
    /* Cool Blue */
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    z-index: 10;
    transform: rotate(5deg);
}

.step-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 6px;
    font-weight: 500;
    text-transform: capitalize;
}

.step-badge.pending {
    background: rgba(59, 130, 246, 0.15);
    /* Blue tint */
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.step-badge.fail {
    background: rgba(239, 68, 68, 0.15);
    /* Red tint */
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.step-badge.pass {
    background: rgba(34, 197, 94, 0.15);
    /* Green tint */
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Status Colors */
[data-status="new"] .column-header {
    border-top: 3px solid var(--text-secondary);
}

[data-status="applied"] .column-header {
    border-top: 3px solid var(--accent);
}

[data-status="interviewing"] .column-header {
    border-top: 3px solid var(--warning);
}

[data-status="offer"] .column-header {
    border-top: 3px solid var(--success);
}

[data-status="rejected"] .column-header {
    border-top: 3px solid var(--danger);
}

[data-status="bank"] .column-header {
    border-top: 3px solid #2cf8c5;
    /* Teal/Cyan */
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    padding: 1rem;
    /* Prevent touching edges */
    overflow-y: auto;
    /* Allow the overlay itself to scroll */
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 1100px;
    height: 90vh;
    max-height: 800px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    margin: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Internal scrolling handles overflow */
}

/* Modal Layout */
.modal-body {
    display: flex;
    gap: 2rem;
    flex: 1;
    overflow-y: auto;
    /* Allow body to scroll if needed, though we aim to avoid it */
    padding-top: 1rem;
}

.modal-col-left {
    flex: 6;
    /* 60% */
    border-right: 1px solid var(--border);
    padding-right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-col-right {
    flex: 4;
    /* 40% */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    margin-top: 1rem;
    padding-top: 1rem;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
    /* margin-top removed, handled by footer */
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: filter 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Checklist */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.checklist-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.checklist-controls {
    display: flex;
    gap: 0.5rem;
}

/* Checklist Dropdowns */
.checklist-select {
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    /* Removed custom SVG arrow to prevent double-arrow glitch */
    min-width: 140px;
}

.checklist-select:hover {
    border-color: var(--text-secondary);
}

/* Checklist Colors */
.checklist-select.pass {
    background-color: rgba(34, 197, 94, 0.2);
    border-color: var(--success);
    color: var(--success);
}

.checklist-select.fail {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    color: var(--danger);
}

.checklist-select.scheduled {
    background-color: rgba(168, 85, 247, 0.2);
    border-color: #c084fc;
    color: #c084fc;
}

.checklist-select.feedback {
    background-color: rgba(249, 115, 22, 0.2);
    border-color: #fb923c;
    color: #fb923c;
}

.checklist-select.pending {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

/* Prep Section */
.prep-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-list {
    list-style: none;
    padding: 0;
    max-height: 100px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
}

.file-list li {
    padding: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.file-list li:last-child {
    border-bottom: none;
}

.file-list li:empty::before {
    content: "No files yet (open folder to add)";
    font-style: italic;
    opacity: 0.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

/* --- NETWORKING VIEW STYLES --- */
.leads-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.leads-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leads-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 2fr 1fr 100px;
    gap: 1rem;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    align-items: center;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.leads-grid:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.leads-head-row {
    font-weight: bold;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    background: transparent;
}

.intel-text {
    color: #ffea00;
    font-size: 0.8rem;
}

.intel-db {
    color: #00ff96;
    font-size: 0.8rem;
}

/* Modal Parsing Styles */
#lead-paste-area {
    width: 100%;
    padding: 1rem;
    background: #0b0f19;
    border: 1px dashed var(--text-secondary);
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 1rem;
    resize: vertical;
}

#lead-paste-area:focus {
    border-color: var(--accent);
    color: var(--text-primary);
}

.sys-widget {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* --- Sci-Fi Dashboard Styles --- */


.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Reduced gap */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 1.5rem;
    /* Reduced padding */
}

.dashboard-row {
    display: flex;
    justify-content: center;
    width: 100%;
}

.dashboard-card {
    background: var(--card-bg);
    padding: 1.5rem;
    /* Reduced padding */
    border-radius: 16px;
    border: 1px solid rgba(0, 243, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.05), inset 0 0 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Subtle glowing top line */
.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0.8;
}

.dashboard-card.max-w-600 {
    max-width: 600px;
}

.dashboard-title {
    margin-bottom: 1rem;
    /* Reduced margin */
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
    width: 100%;
    text-align: left;
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-title::before {
    content: '///';
    color: var(--neon-magenta);
    font-size: 0.8rem;
    letter-spacing: 0;
}

.chart-container-doughnut {
    position: relative;
    height: 260px;
    /* Reduced height from 320px */
    width: 100%;
    display: flex;
    justify-content: center;
}

.chart-container-bar {
    position: relative;
    height: 300px;
    /* Reduced height from 400px */
    width: 100%;
}

.doughnut-center-text {
    position: absolute;
    top: 55%;
    /* Adjusted for legend */
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 10;
}

.doughnut-number {
    font-size: 3rem;
    /* Slightly smaller font */
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    line-height: 1;
}

.doughnut-label {
    font-size: 0.8rem;
    color: var(--neon-cyan);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}