:root {
    --primary-cyan: #00bcd4;
    --primary-dark: #0097a7;
    --primary-darker: #00838f;
    --accent-light: #4dd0e1;
    --accent-lighter: #b3e5fc;
    --background-gradient: #fafafa;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-light: 0 8px 32px rgba(0, 188, 212, 0.1);
    --shadow-medium: 0 16px 48px rgba(0, 188, 212, 0.15);
    --shadow-heavy: 0 24px 64px rgba(0, 188, 212, 0.2);
    --glow-cyan: rgba(0, 188, 212, 0.5);
    --glow-cyan-light: rgba(77, 208, 225, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background-gradient);
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
    font-weight: 400;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: white;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    z-index: 100;
    box-shadow: var(--shadow-light);
    border-radius: 20px;
    margin: 20px 20px 0 20px;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 56px;
    width: auto;
}

.logo:hover {
    transform: none;
    filter: none;
}

.brand-text h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.brand-text p {
    font-size: 14px;
    color: var(--primary-darker);
    font-weight: 500;
    opacity: 0.8;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px;
    width: 100%;
    color: #333333;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 80px;
    animation: fadeInUp 0.8s ease-out;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    color: #333333;
    margin-bottom: 16px;
    letter-spacing: -1px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--primary-dark);
    font-weight: 400;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Upload Section */
.upload-section {
    margin-bottom: 80px;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.upload-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 188, 212, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.upload-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(0, 188, 212, 0), rgba(77, 208, 225, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.upload-card:hover {
    transform: translateY(-12px);
    box-shadow: 
        0 20px 60px rgba(0, 188, 212, 0.3),
        0 0 40px var(--glow-cyan-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: var(--accent-light);
}

.upload-card:hover::after {
    opacity: 1;
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.3), rgba(77, 208, 225, 0.3));
}

.upload-card.drag-over {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(0, 188, 212, 0.4),
        0 0 50px var(--glow-cyan),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: var(--primary-cyan);
    border-width: 2px;
}

.upload-card.drag-over .upload-icon {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 
        0 12px 32px var(--glow-cyan),
        0 0 50px var(--glow-cyan);
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-dark));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 24px rgba(0, 188, 212, 0.4),
        0 0 20px var(--glow-cyan-light);
    transition: all 0.3s ease;
    position: relative;
}

.upload-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--accent-light));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-card:hover .upload-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 
        0 12px 32px var(--glow-cyan),
        0 0 40px var(--glow-cyan);
}

.upload-card:hover .upload-icon::before {
    opacity: 1;
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: 0.5;
        filter: blur(10px);
    }
    50% {
        opacity: 1;
        filter: blur(15px);
    }
}

.upload-icon i {
    font-size: 32px;
    color: white;
}

.upload-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: #333333;
    margin-bottom: 8px;
}

.upload-card p {
    font-size: 16px;
    color: #666666;
    opacity: 0.8;
    margin-bottom: 32px;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 10;
    top: 0;
    left: 0;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    border: 2px dashed #888888;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #666666;
}

.file-input-label:hover {
    background: linear-gradient(135deg, #e8f9ff, #d4f4ff);
    border-color: var(--primary-cyan);
    transform: scale(1.02);
    color: var(--primary-dark);
}

.file-input-label i {
    font-size: 20px;
}

.file-status {
    font-size: 14px;
    font-weight: 500;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.file-status.success {
    color: #10b981;
}

.file-status.success i {
    color: #10b981;
}

/* Action Section */
.action-section {
    text-align: center;
}

.analyze-button {
    position: relative;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-dark));
    color: white;
    border: none;
    padding: 20px 48px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 12px 32px rgba(0, 188, 212, 0.4),
        0 0 20px var(--glow-cyan-light);
    overflow: hidden;
    min-width: 200px;
    letter-spacing: 0.5px;
}

.analyze-button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--accent-light));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.analyze-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.2);
}

.analyze-button:not(:disabled):hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 20px 48px var(--glow-cyan),
        0 0 40px var(--glow-cyan);
    background: linear-gradient(135deg, var(--primary-dark), var(--accent-light));
}

.analyze-button:not(:disabled):hover::before {
    opacity: 1;
    animation: glow-pulse 2s ease-in-out infinite;
}

.analyze-button:not(:disabled):active {
    transform: translateY(-2px) scale(0.98);
}

.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: opacity 0.3s ease;
}

.button-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.analyze-button.loading .button-content {
    opacity: 0;
}

.analyze-button.loading .button-loader {
    opacity: 1;
}

/* Results Section */
.results-section {
    display: none;
    animation: fadeInUp 0.6s ease-out;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 40px;
}

.result-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(79, 70, 229, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 16px 48px rgba(0, 188, 212, 0.2),
        0 0 30px var(--glow-cyan-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: var(--accent-light);
}

.result-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #333333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-card .result-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
    transition: all 0.3s ease;
}

.result-card:hover .result-icon {
    background: linear-gradient(135deg, var(--primary-dark), var(--accent-light));
    box-shadow: 0 6px 20px var(--glow-cyan);
    transform: scale(1.1);
}

.result-card p {
    color: #4a5568;
    line-height: 1.7;
    font-size: 15px;
}

.skill-match {
    background: linear-gradient(135deg, #90EE90, #98FB98);
    color: #155724;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.match-score {
    text-align: center;
    padding: 40px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-cyan) 0deg, var(--accent-light) 180deg, #e2e8f0 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
}

.score-value {
    position: relative;
    z-index: 1;
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-darker);
}

.loading-state {
    text-align: center;
    padding: 60px;
    color: var(--primary-dark);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--accent-lighter);
    border-top: 4px solid var(--primary-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Footer */
.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
    border-radius: 20px 20px 0 0;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 40px;
    text-align: right;
}

.footer-content p {
    color: #333333;
    font-size: 14px;
    font-weight: 500;
}

.footer-content strong {
    color: #333333;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        margin: 10px;
        border-radius: 16px;
    }
    
    .header-content {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .logo {
        height: 40px;
    }
    
    .main-content {
        padding: 30px 16px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .upload-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .upload-card {
        padding: 24px 16px;
    }
    
    .upload-icon {
        width: 60px;
        height: 60px;
    }
    
    .upload-icon i {
        font-size: 24px;
    }
    
    .upload-card h3 {
        font-size: 20px;
    }
    
    .analyze-button {
        padding: 16px 32px;
        font-size: 16px;
        width: 100%;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .brand-text h1 {
        font-size: 20px;
    }
    
    .brand-text p {
        font-size: 12px;
    }
    
    .footer-content {
        padding: 16px;
        text-align: center;
    }
    
    .candidate-card {
        padding: 16px;
    }
    
    .view-resume-btn {
        width: 100%;
        margin: 5px 0 !important;
    }
    
    .modal-content, .analysis-popup {
        width: 95%;
        max-height: 90vh;
    }
    
    .popup-content {
        padding: 16px;
    }
    
    .skills-list {
        gap: 6px;
    }
    
    .skill-tag {
        font-size: 0.85em;
    }
    
    .table-wrapper {
        padding: 16px;
    }
    
    .candidates-table {
        font-size: 12px;
    }
    
    .candidates-table th,
    .candidates-table td {
        padding: 10px 8px;
    }
    
    .action-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .upload-card h3 {
        font-size: 18px;
    }
    
    .analyze-button {
        padding: 14px 24px;
        font-size: 14px;
    }
    
    .candidates-table {
        font-size: 11px;
    }
    
    .candidates-table th:nth-child(1),
    .candidates-table td:nth-child(1) {
        display: none;
    }
}

.result-card:hover .result-icon {
    background: linear-gradient(135deg, var(--primary-cyan), var(--accent-light));
}

/* Sela organization visual alignment */
:root {
    color-scheme: light;
    --org-bg: #fbfefe;
    --org-surface: rgba(255, 255, 255, 0.82);
    --org-surface-strong: rgba(255, 255, 255, 0.94);
    --org-ink: #122228;
    --org-muted: rgba(18, 34, 40, 0.62);
    --org-line: rgba(18, 34, 40, 0.1);
    --org-accent: #86ced9;
    --org-accent-strong: #58bccb;
    --org-shadow: 0 30px 80px rgba(16, 30, 35, 0.08);
    --org-topbar: rgba(255, 255, 255, 0.66);
}

body {
    font-family: "Instrument Sans", sans-serif;
    color: var(--org-ink);
    background:
        radial-gradient(circle at 18% 30%, rgba(134, 206, 217, 0.12), transparent 32%),
        radial-gradient(circle at 82% 32%, rgba(134, 206, 217, 0.1), transparent 28%),
        linear-gradient(180deg, var(--org-bg) 0%, #f7fbfc 56%, #f3f9fa 100%);
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 20%),
        linear-gradient(180deg, #09090b 0%, #111216 48%, #0b0b0d 100%);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}

.page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-shell {
    display: grid;
    justify-items: center;
    gap: 1rem;
}

.notify-loader-mark {
    width: min(44rem, 86vw);
    height: auto;
    color: #f4f1ea;
}

.notify-loader-text {
    font-family: "Poppins", sans-serif;
}

.loader-by {
    margin-top: -0.2rem;
    font-size: 0.8rem;
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: rgba(244, 241, 234, 0.62);
}

.loader-logo {
    width: min(7.5rem, 28vw);
    height: auto;
    object-fit: contain;
}

.loader-logo-wrap {
    display: block;
    width: min(7.5rem, 28vw);
}

.loader-logo-wrap .loader-logo {
    width: 100%;
}

@media (prefers-color-scheme: light) {
    .page-loader {
        background:
            radial-gradient(circle at top, rgba(88, 188, 203, 0.14), transparent 22%),
            linear-gradient(180deg, #fbfefe 0%, #f5fafb 48%, #eef6f7 100%);
    }

    .notify-loader-mark {
        color: #122228;
    }

    .notify-loader-text {
        text-shadow: none;
    }

    .loader-by {
        color: rgba(18, 34, 40, 0.6);
    }

    .loader-logo {
        filter: drop-shadow(0 8px 18px rgba(18, 34, 40, 0.1));
    }
}

.app-container {
    position: relative;
    isolation: isolate;
}

.header {
    position: sticky;
    top: 18px;
    z-index: 100;
    width: min(calc(100% - 24px), 1380px);
    margin: 18px auto 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: var(--org-topbar);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 34px rgba(17, 17, 17, 0.06);
}

.header-content {
    max-width: none;
    padding: 14px 22px;
}

.logo-section {
    gap: 18px;
}

.logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.brand-text p,
.eyebrow {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--org-muted);
}

.header nav a {
    color: var(--org-muted) !important;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: color 0.22s ease;
}

.header nav a:hover {
    color: var(--org-ink) !important;
}

.main-content {
    max-width: 1180px;
    padding: 76px 24px 56px;
}

.hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 260px);
    align-items: center;
    gap: 32px;
    margin-bottom: 56px;
    text-align: left;
}

.hero-title {
    margin: 10px 0 16px;
    max-width: 760px;
    font-family: "Manrope", sans-serif;
    font-size: clamp(2.8rem, 6vw, 5.6rem);
    line-height: 0.96;
    letter-spacing: 0;
    color: var(--org-ink);
}

.hero-subtitle {
    max-width: 650px;
    margin: 0;
    color: var(--org-muted) !important;
    font-size: 1.08rem;
    line-height: 1.7;
}

.hero-figure {
    width: min(100%, 230px);
    justify-self: center;
    filter: drop-shadow(0 28px 60px rgba(18, 34, 40, 0.12));
}

.upload-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 22px;
    margin-bottom: 42px;
}

.upload-card,
.result-card,
.scanned-table-section,
.candidate-card,
.analysis-popup,
.modal-content {
    background: var(--org-surface);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 24px;
    box-shadow: var(--org-shadow);
    backdrop-filter: blur(20px);
}

.upload-card {
    padding: 32px;
    text-align: left;
}

.upload-card:hover,
.result-card:hover {
    transform: translateY(-4px);
    border-color: rgba(134, 206, 217, 0.7);
    box-shadow: 0 34px 88px rgba(16, 30, 35, 0.12);
}

.upload-card h3,
.result-card h3,
.scanned-table-section h3,
.analysis-section h3 {
    font-family: "Manrope", sans-serif;
    letter-spacing: 0;
    color: var(--org-ink);
}

.upload-card p,
.result-card p,
.analysis-section p,
.analysis-section li,
.contact-info {
    color: var(--org-muted);
}

.upload-icon,
.result-card .result-icon {
    border-radius: 18px;
    background: linear-gradient(135deg, var(--org-accent), var(--org-accent-strong));
    box-shadow: 0 16px 32px rgba(88, 188, 203, 0.24);
}

.file-input-label {
    border: 1px dashed rgba(18, 34, 40, 0.18) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.62) !important;
    color: var(--org-ink) !important;
}

.file-input-label:hover {
    border-color: var(--org-accent-strong) !important;
    background: rgba(134, 206, 217, 0.12) !important;
}

.analyze-button,
.view-resume-btn,
.clear-all-btn,
.clear-btn,
.action-btn {
    border-radius: 999px !important;
    background: var(--org-ink) !important;
    color: #ffffff !important;
    box-shadow: 0 16px 32px rgba(18, 34, 40, 0.14) !important;
    letter-spacing: 0;
}

.analyze-button:not(:disabled):hover,
.view-resume-btn:hover,
.clear-all-btn:hover,
.clear-btn:hover,
.action-btn:hover {
    transform: translateY(-2px);
    background: #213941 !important;
}

.analyze-button:disabled {
    background: rgba(18, 34, 40, 0.28) !important;
}

.results-section {
    margin-top: 28px;
}

.selected-files-panel,
.bulk-summary-card {
    margin-top: 15px;
    padding: 16px 18px;
    background: var(--org-surface-strong);
    color: var(--org-ink);
    border: 1px solid var(--org-line);
    border-radius: 14px;
    box-shadow: var(--org-shadow);
}

.bulk-summary-card {
    margin: 0 0 20px;
}

.selected-files-panel p,
.selected-files-panel li,
.bulk-summary-card strong {
    color: var(--org-ink);
}

.candidate-file-name {
    color: var(--org-muted) !important;
    font-size: 0.9em;
    margin: 5px 0;
}

.table-wrapper,
.preview-box,
.resume-content,
.analysis-section {
    background: rgba(255, 255, 255, 0.66) !important;
    border: 1px solid var(--org-line);
    border-radius: 18px;
}

.candidates-table th {
    color: var(--org-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.score-badge,
.status-badge,
.ats-score,
.skill-tag {
    border-radius: 999px !important;
}

.footer {
    margin-top: 40px;
    background: transparent;
    border-top: 1px solid var(--org-line);
    border-radius: 0;
}

.footer-content {
    max-width: 1180px;
    padding: 22px 24px;
}

.footer-content p {
    color: var(--org-muted);
}

@media (prefers-color-scheme: dark) {
    :root {
        --org-bg: #0b1115;
        --org-surface: rgba(14, 24, 29, 0.78);
        --org-surface-strong: rgba(16, 28, 33, 0.9);
        --org-ink: #eef7f8;
        --org-muted: rgba(238, 247, 248, 0.66);
        --org-line: rgba(238, 247, 248, 0.1);
        --org-topbar: rgba(11, 17, 21, 0.62);
    }

    body {
        background: linear-gradient(180deg, #0b1115 0%, #0e181d 100%);
    }

    .page-loader {
        background:
            radial-gradient(circle at top, rgba(207, 216, 220, 0.08), transparent 24%),
            linear-gradient(180deg, #0b1115 0%, #0e181d 48%, #081014 100%);
    }

    .notify-loader-mark {
        color: #eef7f8;
    }

    .upload-card,
    .result-card,
    .scanned-table-section,
    .candidate-card,
    .selected-files-panel,
    .bulk-summary-card,
    .analysis-popup,
    .modal-content {
        border-color: rgba(255, 255, 255, 0.08);
    }
}

@media (max-width: 768px) {
    .header {
        top: 10px;
        width: min(calc(100% - 20px), 1380px);
        border-radius: 28px;
    }

    .header-content {
        flex-direction: row;
        text-align: left;
    }

    .main-content {
        padding: 44px 16px 36px;
    }

    .hero-section {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 36px;
    }

    .hero-figure {
        width: 150px;
        justify-self: start;
    }

    .hero-title {
        font-size: clamp(2.4rem, 13vw, 4rem);
    }

    .upload-card {
        padding: 24px;
    }
}

/* Scanned Candidates Table */
.scanned-table-section {
    margin-top: 60px;
    animation: fadeInUp 0.6s ease-out;
}

.scanned-table-section h3 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-wrapper {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 
        0 8px 32px rgba(79, 70, 229, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.table-wrapper:hover {
    box-shadow: 
        0 12px 40px rgba(0, 188, 212, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.candidates-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.candidates-table thead {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.candidates-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.candidates-table td {
    padding: 16px;
    border-bottom: 1px solid #f1f3f5;
}

.candidates-table tbody tr {
    transition: background 0.2s;
}

.candidates-table tbody tr:hover {
    background: #f8f9fa;
}

.score-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.score-badge:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    transform: scale(1.05);
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.status-badge:hover {
    transform: scale(1.05);
}

.status-qualified {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    box-shadow: 0 4px 12px rgba(21, 87, 36, 0.2);
}

.status-review {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    box-shadow: 0 4px 12px rgba(133, 100, 4, 0.2);
}

.status-rejected {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    box-shadow: 0 4px 12px rgba(114, 28, 36, 0.2);
}

.action-btn {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 50px;
    cursor: pointer;
    margin-right: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.action-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--accent-light));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--glow-cyan);
}

.delete-btn {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.clear-btn {
    margin-top: 12px;
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    z-index: 20;
}

.clear-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.clear-btn i {
    margin-right: 6px;
}

.clear-all-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.clear-all-btn:hover {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

/* Final Sela theme pass: keep older table/modal rules from breaking light/dark modes. */
.logo-section {
    min-width: 0;
}

.header {
    border-color: rgba(255, 255, 255, 0.72);
}

.header-content {
    min-height: 78px;
}

.logo {
    display: block;
    flex: 0 0 auto;
}

.upload-card p[style],
.file-input-label p[style],
.file-input-label i[style] {
    color: var(--org-muted) !important;
}

.bulk-upload-area,
.processing-status,
.upload-card,
.result-card,
.scanned-table-section,
.candidate-card,
.popup-content,
.analysis-popup,
.modal-content,
.resume-content,
.preview-box,
.analysis-section,
.loading-content {
    background: var(--org-surface-strong) !important;
    color: var(--org-ink) !important;
    border-color: var(--org-line) !important;
}

.popup-header,
.analysis-header {
    background: var(--org-surface-strong) !important;
    color: var(--org-ink) !important;
    border-color: var(--org-line) !important;
}

.scanned-table-section h3,
.candidate-card h3,
.analysis-section h3,
.popup-header h2,
.analysis-header h2,
.resume-content,
.preview-box,
.analysis-item h4 {
    color: var(--org-ink) !important;
}

.loading-text,
.candidate-card p,
.analysis-item p,
.analysis-item li {
    color: var(--org-muted) !important;
}

.table-wrapper {
    background: color-mix(in srgb, var(--org-surface-strong) 88%, transparent) !important;
    border: 1px solid var(--org-line) !important;
    box-shadow: var(--org-shadow) !important;
}

.table-wrapper:hover {
    box-shadow: 0 24px 62px rgba(16, 30, 35, 0.1) !important;
}

.candidates-table {
    color: var(--org-ink);
}

.candidates-table thead {
    background: color-mix(in srgb, var(--org-surface-strong) 72%, var(--org-accent) 10%) !important;
}

.candidates-table th {
    color: var(--org-muted) !important;
    border-bottom-color: var(--org-line) !important;
}

.candidates-table td {
    color: var(--org-ink);
    border-bottom-color: var(--org-line) !important;
}

.candidates-table tbody tr:hover {
    background: color-mix(in srgb, var(--org-accent) 12%, transparent) !important;
}

.action-btn:not(.delete-btn),
.view-resume-btn {
    background: var(--org-ink) !important;
    color: var(--org-bg) !important;
}

.modal,
.popup-overlay,
.analysis-popup-overlay {
    background-color: rgba(8, 16, 20, 0.54) !important;
    backdrop-filter: blur(8px);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --org-accent: #cfd8dc;
        --org-accent-strong: #e6eef1;
        --org-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
    }

    body {
        background:
            radial-gradient(circle at 20% 10%, rgba(207, 216, 220, 0.06), transparent 30%),
            linear-gradient(180deg, #0b1115 0%, #0e181d 100%) !important;
    }

    .header {
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
    }

    .file-input-label {
        background: rgba(255, 255, 255, 0.04) !important;
        border-color: rgba(255, 255, 255, 0.12) !important;
    }

    .table-wrapper:hover {
        box-shadow: 0 24px 62px rgba(0, 0, 0, 0.28) !important;
    }

    .status-qualified {
        background: rgba(35, 134, 83, 0.18) !important;
        color: #8ee2b2 !important;
    }

    .status-review {
        background: rgba(188, 139, 35, 0.18) !important;
        color: #f4d27c !important;
    }

    .status-rejected {
        background: rgba(220, 38, 38, 0.18) !important;
        color: #f6a3a3 !important;
    }
}

/* Match the Bulk Mailer header/topbar sizing and behavior. */
.header {
    position: fixed !important;
    top: 18px !important;
    left: 50% !important;
    z-index: 100 !important;
    width: min(calc(100% - 24px), 1380px) !important;
    margin: 0 !important;
    padding: 17px 22px !important;
    transform: translateX(-50%) !important;
    border: 1px solid rgba(255, 255, 255, 0.72) !important;
    border-radius: 999px !important;
    background: var(--org-topbar) !important;
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 34px rgba(17, 17, 17, 0.06) !important;
    transition: width 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease !important;
}

.header.is-compact {
    width: min(calc(100% - 56px), 940px) !important;
    padding: 12px 16px !important;
    background: rgba(255, 255, 255, 0.82) !important;
    box-shadow: 0 16px 40px rgba(17, 17, 17, 0.08) !important;
}

.header-content {
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
}

.logo-section {
    display: inline-flex !important;
    align-items: center !important;
    height: 42px !important;
    gap: 0 !important;
    overflow: visible !important;
}

.logo {
    width: 50px !important;
    height: 50px !important;
    object-fit: contain !important;
    display: block !important;
    transform: scale(2) !important;
    transform-origin: left center !important;
}

.header nav {
    display: flex;
    gap: 24px;
}

.header nav a {
    position: relative;
    letter-spacing: -0.03em;
}

.header nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--org-accent-strong), var(--org-accent));
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.header nav a:hover::after {
    transform: scaleX(1);
}

.header-center-symbol {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 128px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.header-center-symbol picture,
.header-analyse-logo {
    display: block;
}

.header-analyse-logo {
    width: 128px;
    height: 46px;
    object-fit: contain;
    object-position: center;
}

.main-content {
    padding-top: 150px !important;
}

@media (prefers-color-scheme: dark) {
    .header {
        border-color: rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22) !important;
    }

    .header.is-compact {
        background: rgba(12, 19, 24, 0.84) !important;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3) !important;
    }

    .header-center-symbol {
        filter: none;
    }
}

@media (max-width: 720px) {
    .header {
        position: sticky !important;
        top: 10px !important;
        left: auto !important;
        width: calc(100% - 20px) !important;
        margin: 10px auto 0 !important;
        padding: 14px 16px !important;
        transform: none !important;
        border-radius: 24px !important;
    }

    .logo-section {
        height: 36px !important;
    }

    .logo {
        width: 56px !important;
        height: 56px !important;
        transform: none !important;
    }

    .header nav {
        flex-wrap: nowrap;
        gap: 16px;
        align-items: center;
        margin-left: auto;
    }

    .header-center-symbol {
        width: 104px;
        height: 38px;
    }

    .header-analyse-logo {
        width: 104px;
        height: 38px;
    }

    .main-content {
        padding-top: 44px !important;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 14px !important;
    }

    .header nav {
        gap: 12px;
    }

    .header nav a {
        font-size: 0.88rem !important;
    }

    .logo {
        width: 50px !important;
        height: 50px !important;
    }
}

/* Button and table alignment fixes for the Sela dark theme. */
.analyze-button,
.clear-btn,
.clear-all-btn,
.view-resume-btn,
.action-btn {
    border: 1px solid var(--org-line) !important;
    background: var(--org-ink) !important;
    color: var(--org-bg) !important;
}

.analyze-button i,
.analyze-button span,
.clear-btn i,
.clear-btn span,
.clear-all-btn i,
.clear-all-btn span,
.view-resume-btn i,
.view-resume-btn span,
.action-btn i,
.action-btn span {
    color: currentColor !important;
}

.analyze-button:disabled,
.clear-btn:disabled,
.clear-all-btn:disabled,
.view-resume-btn:disabled,
.action-btn:disabled {
    border-color: var(--org-line) !important;
    background: color-mix(in srgb, var(--org-ink) 14%, transparent) !important;
    color: var(--org-muted) !important;
    opacity: 1 !important;
    box-shadow: none !important;
}

.clear-btn,
.clear-all-btn,
.delete-btn {
    background: #dc2626 !important;
    color: #ffffff !important;
}

.clear-btn:hover,
.clear-all-btn:hover,
.delete-btn:hover {
    background: #b91c1c !important;
}

.candidates-table {
    table-layout: fixed;
    min-width: 980px;
}

.candidates-table th:nth-child(1),
.candidates-table td:nth-child(1) {
    width: 56px;
}

.candidates-table th:nth-child(5),
.candidates-table td:nth-child(5),
.candidates-table th:nth-child(6),
.candidates-table td:nth-child(6) {
    width: 120px;
    text-align: center;
}

.candidates-table th:last-child,
.candidates-table td:last-child {
    min-width: 128px;
    width: 128px;
    text-align: center;
}

.candidates-table td:last-child {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 77px;
    vertical-align: middle;
}

.candidates-table td:last-child .action-btn {
    flex: 0 0 40px;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
    vertical-align: middle;
}

.candidates-table td:last-child .action-btn i {
    display: block;
    width: 1em;
    line-height: 1;
}

.scanned-table-section > div:first-child {
    align-items: center !important;
    width: 100%;
    margin-bottom: 28px !important;
    padding: 0 !important;
}

.scanned-table-section {
    padding: 34px 36px 36px !important;
    overflow: hidden;
}

.scanned-table-section h3 {
    margin: 0 !important;
    line-height: 1.1;
}

.scanned-table-section .clear-all-btn {
    margin-left: auto;
    min-width: 150px;
    justify-content: center;
}

.scanned-table-section .table-wrapper {
    width: 100%;
}

@media (max-width: 720px) {
    .scanned-table-section {
        padding: 24px 18px !important;
    }

    .scanned-table-section > div:first-child {
        gap: 16px !important;
    }

    .scanned-table-section .clear-all-btn {
        margin-left: 0;
    }
}

@media (prefers-color-scheme: dark) {
    .analyze-button,
    .view-resume-btn,
    .action-btn:not(.delete-btn) {
        background: #eef7f8 !important;
        color: #0b1115 !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    .analyze-button:disabled,
    .clear-btn:disabled,
    .clear-all-btn:disabled,
    .view-resume-btn:disabled,
    .action-btn:disabled {
        background: rgba(238, 247, 248, 0.1) !important;
        color: rgba(238, 247, 248, 0.42) !important;
        border-color: rgba(238, 247, 248, 0.12) !important;
    }

    .clear-btn,
    .clear-all-btn,
    .delete-btn {
        background: #ef4444 !important;
        color: #ffffff !important;
        border-color: rgba(239, 68, 68, 0.3) !important;
    }
}

/* Upload card contrast fixes. */
.upload-icon,
.result-card .result-icon {
    color: var(--org-bg) !important;
}

.upload-icon i,
.result-card .result-icon i {
    color: currentColor !important;
}

.file-input-label {
    font-weight: 700;
}

.file-input-label i,
.file-input-label span {
    color: currentColor !important;
}

@media (prefers-color-scheme: dark) {
    .upload-icon,
    .result-card .result-icon {
        background: rgba(238, 247, 248, 0.1) !important;
        color: #eef7f8 !important;
        border: 1px solid rgba(238, 247, 248, 0.12);
        box-shadow: none !important;
    }

    .file-input-label {
        background: rgba(238, 247, 248, 0.08) !important;
        color: #eef7f8 !important;
        border-color: rgba(238, 247, 248, 0.18) !important;
    }

    .file-input-label:hover {
        background: rgba(238, 247, 248, 0.14) !important;
        border-color: rgba(238, 247, 248, 0.36) !important;
    }
}

/* Candidate table column alignment fixes. */
.candidates-table {
    width: 100% !important;
    min-width: 1120px;
    table-layout: fixed !important;
}

.candidates-table th,
.candidates-table td {
    vertical-align: middle !important;
}

.candidates-table th:nth-child(1),
.candidates-table td:nth-child(1) {
    width: 58px !important;
    text-align: center;
}

.candidates-table th:nth-child(2),
.candidates-table td:nth-child(2) {
    width: 23% !important;
}

.candidates-table th:nth-child(3),
.candidates-table td:nth-child(3) {
    width: 22% !important;
}

.candidates-table th:nth-child(4),
.candidates-table td:nth-child(4) {
    width: 15% !important;
}

.candidates-table th:nth-child(5),
.candidates-table td:nth-child(5) {
    width: 120px !important;
    text-align: center;
}

.candidates-table th:nth-child(6),
.candidates-table td:nth-child(6) {
    width: 130px !important;
    text-align: center;
}

.candidates-table th:nth-child(7),
.candidates-table td:nth-child(7) {
    width: 130px !important;
    text-align: center;
}

.candidates-table td:nth-child(2),
.candidates-table td:nth-child(3),
.candidates-table td:nth-child(4) {
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.45;
}

.candidates-table td:nth-child(2) strong {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.candidates-table td:last-child {
    display: table-cell !important;
    min-height: 0 !important;
    white-space: nowrap;
}

.candidates-table td:last-child .action-btn {
    display: inline-flex !important;
    margin: 0 4px !important;
    vertical-align: middle;
}

/* Give data-heavy sections enough desktop width while keeping side gutters. */
.main-content {
    width: 100% !important;
    max-width: min(1680px, calc(100% - 88px)) !important;
}

.upload-section,
.results-section,
.scanned-table-section {
    width: 100%;
}

.scanned-table-section .table-wrapper {
    padding-left: 32px !important;
    padding-right: 32px !important;
    overflow-x: auto;
}

.candidates-table {
    min-width: 1180px;
}

@media (max-width: 900px) {
    .main-content {
        max-width: calc(100% - 28px) !important;
    }

    .scanned-table-section .table-wrapper {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }
}

/* Bulk results theme overrides. The bulk template has local styles, so keep these
   late and explicit to prevent white panels/chips in dark mode. */
.results-section h3,
.candidate-card h4,
.bulk-summary-card strong,
.selected-files-panel p,
.selected-files-panel li {
    color: var(--org-ink) !important;
}

.bulk-summary-card,
.selected-files-panel {
    background: var(--org-surface-strong) !important;
    color: var(--org-ink) !important;
    border: 1px solid var(--org-line) !important;
}

.candidate-card .contact-info,
.candidate-card p,
.candidate-file-name {
    color: var(--org-muted) !important;
}

.candidate-card .skill-tag {
    background: color-mix(in srgb, var(--org-ink) 12%, transparent) !important;
    color: var(--org-ink) !important;
    border: 1px solid var(--org-line) !important;
}

@media (prefers-color-scheme: dark) {
    .candidate-card .skill-tag {
        background: rgba(238, 247, 248, 0.1) !important;
        color: #eef7f8 !important;
        border-color: rgba(238, 247, 248, 0.14) !important;
    }
}
