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

:root {
    --bg-primary: #0B0A1A;
    --bg-secondary: #13112A;
    --bg-card: rgba(22, 18, 50, 0.7);
    --bg-card-hover: rgba(30, 24, 65, 0.85);
    --purple-500: #7C3AED;
    --purple-400: #A78BFA;
    --purple-300: #C4B5FD;
    --purple-glow: rgba(124, 58, 237, 0.25);
    --blue-500: #2563EB;
    --blue-400: #60A5FA;
    --green-500: #059669;
    --green-400: #34D399;
    --gold-500: #D9A938;
    --gold-400: #FBBF24;
    --red-400: #F87171;
    --pink-400: #F472B6;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border-subtle: rgba(124, 58, 237, 0.15);
    --border-active: rgba(124, 58, 237, 0.4);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a { color: var(--purple-400); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--purple-300); }

/* === LAYOUT === */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #16123A 0%, #0E0C24 100%);
    border-right: 1px solid var(--border-subtle);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--bg-primary) 0%, #0D0B22 50%, #0A1628 100%);
}

/* === SIDEBAR === */
.sidebar-header {
    padding: 30px 24px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}
.sidebar-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}
.sidebar-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.sidebar-username {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 20px 12px;
    flex: 1;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 4px;
}
.sidebar-nav a:hover {
    background: rgba(124, 58, 237, 0.1);
    color: var(--text-primary);
}
.sidebar-nav a.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(37, 99, 235, 0.12));
    color: var(--purple-300);
    border: 1px solid var(--border-active);
}
.sidebar-nav a .nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-subtle);
}
.sidebar-footer a {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: var(--transition);
}
.sidebar-footer a:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red-400);
}

/* === PAGE HEADER === */
.page-header {
    margin-bottom: 32px;
}
.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--purple-400), var(--blue-400), var(--green-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* === METRIC CARDS === */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}
.metric-card:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}
.metric-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}
.metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.metric-purple .metric-value { color: var(--purple-400); }
.metric-blue .metric-value { color: var(--blue-400); }
.metric-gold .metric-value { color: var(--gold-400); }
.metric-green .metric-value { color: var(--green-400); }
.metric-pink .metric-value { color: var(--pink-400); }

/* === APPLICATION CARDS === */
.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 22px 26px;
    margin-bottom: 12px;
    transition: var(--transition);
    cursor: pointer;
}
.app-card:hover {
    border-color: var(--border-active);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}
.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.app-card-info h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.app-card-info .role {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.app-card-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.app-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.app-card-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.app-card-summary {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* === STATUS BADGES === */
.badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-evaluated { background: rgba(124, 58, 237, 0.15); color: var(--purple-400); }
.badge-applied { background: rgba(37, 99, 235, 0.15); color: var(--blue-400); }
.badge-interview { background: rgba(217, 169, 56, 0.15); color: var(--gold-400); }
.badge-offer { background: rgba(5, 150, 105, 0.15); color: var(--green-400); }
.badge-rejected { background: rgba(239, 68, 68, 0.1); color: var(--red-400); }
.badge-discarded, .badge-skip { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }
.badge-responded { background: rgba(96, 165, 250, 0.15); color: var(--blue-400); }

/* === SCORE === */
.score { font-weight: 800; font-size: 1.05rem; }
.score-high { color: var(--green-400); }
.score-mid { color: var(--gold-400); }
.score-low { color: var(--red-400); }

/* === CV CARDS === */
.cvs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.cv-card {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.06), rgba(37, 99, 235, 0.05));
    border: 1px solid rgba(5, 150, 105, 0.2);
    border-radius: var(--radius-md);
    padding: 22px;
    transition: var(--transition);
}
.cv-card:hover {
    border-color: rgba(5, 150, 105, 0.45);
    box-shadow: 0 6px 24px rgba(5, 150, 105, 0.1);
    transform: translateY(-2px);
}
.cv-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.cv-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}
.cv-card .cv-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 6px;
}
.cv-badge {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.cv-badge-tailored { background: rgba(217, 169, 56, 0.12); color: var(--gold-400); }
.cv-badge-general { background: rgba(96, 165, 250, 0.12); color: var(--blue-400); }
.cv-card-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
    color: white;
}
.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
    color: white;
}
.btn-secondary {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: var(--purple-400);
}
.btn-secondary:hover {
    background: rgba(124, 58, 237, 0.18);
    border-color: rgba(124, 58, 237, 0.4);
    color: var(--purple-300);
}
.btn-green {
    background: rgba(5, 150, 105, 0.12);
    border: 1px solid rgba(5, 150, 105, 0.25);
    color: var(--green-400);
}
.btn-green:hover {
    background: rgba(5, 150, 105, 0.2);
    color: var(--green-400);
}
.btn-danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: var(--red-400);
    font-size: 0.8rem;
    padding: 6px 14px;
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* === FORMS === */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(22, 18, 50, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--purple-500);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.form-control::placeholder {
    color: var(--text-muted);
}
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2394A3B8' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}
select.form-control option {
    background: #1a1540;
    color: var(--text-primary);
}
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 720px;
}

/* === FILE UPLOAD === */
.file-upload {
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}
.file-upload:hover {
    border-color: var(--purple-500);
    background: rgba(124, 58, 237, 0.04);
}
.file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.file-upload-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
.file-upload p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.file-upload .file-types {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 6px;
}

/* === FILTERS BAR === */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}
.filters-bar select {
    padding: 8px 36px 8px 14px;
    font-size: 0.85rem;
}
.filter-count {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: auto;
}

/* === FLASH MESSAGES === */
.flash {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}
.flash-success {
    background: rgba(5, 150, 105, 0.12);
    border: 1px solid rgba(5, 150, 105, 0.25);
    color: var(--green-400);
}
.flash-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--red-400);
}

/* === LOGIN PAGE === */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #0B0A1A 0%, #13112A 40%, #0A1628 100%);
    padding: 20px;
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.login-logo {
    text-align: center;
    margin-bottom: 36px;
}
.login-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--purple-400), var(--blue-400), var(--green-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 6px;
}
.login-card .form-control {
    padding: 14px 18px;
}
.login-card .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 0.95rem;
    margin-top: 8px;
}
.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--red-400);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
    text-align: center;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}
.empty-state h3 {
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}
.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === DETAIL PANEL === */
.detail-panel {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: -4px;
    margin-bottom: 12px;
    animation: slideDown 0.25s ease;
}
.detail-panel.open { display: block; }
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.detail-item label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
.detail-item p {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-top: 2px;
}

/* === SECTION TITLE === */
.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* === DIVIDER === */
.divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 28px 0;
}

/* === ANIMATIONS === */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    .sidebar-header { display: none; }
    .sidebar-nav {
        display: flex;
        padding: 10px;
        gap: 4px;
    }
    .sidebar-nav a { white-space: nowrap; padding: 10px 14px; }
    .sidebar-footer { display: none; }
    .layout { flex-direction: column; }
    .main-content { margin-left: 0; padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .cvs-grid { grid-template-columns: 1fr; }
    .app-card-header { flex-direction: column; }
}

/* === RANGE INPUT === */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--red-400), var(--gold-400), var(--green-400));
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--purple-500);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(124, 58, 237, 0.35); }
