:root {
    --ink-900: #0f172a;
    --ink-800: #1f2937;
    --ink-700: #334155;
    --ink-500: #64748b;
    --line-soft: rgba(255, 255, 255, 0.4);
    --line-strong: rgba(15, 23, 42, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.56);
    --glass-bg-strong: rgba(255, 255, 255, 0.72);
    --glass-sidebar: rgba(9, 19, 44, 0.62);
    --primary: #3058a6;
    --primary-dark: #22427f;
    --accent-green: #2ecc71;
    --accent-green-dark: #27ae60;
    --success: #2ecc71;
    --danger: #b94a4a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--ink-800);
    background:
        radial-gradient(circle at 12% 16%, rgba(70, 112, 191, 0.22), transparent 34%),
        radial-gradient(circle at 88% 8%, rgba(147, 197, 253, 0.25), transparent 30%),
        radial-gradient(circle at 80% 88%, rgba(148, 163, 184, 0.22), transparent 35%),
        linear-gradient(160deg, #f3f6fc 0%, #e9eff8 45%, #f5f8fd 100%);
    line-height: 1.45;
    overflow-x: hidden;
}

.container {
    min-height: 100vh;
    display: flex;
    position: relative;
}

.sidebar {
    width: 280px;
    position: fixed;
    inset: 12px auto 12px 12px;
    color: #f8fbff;
    background: linear-gradient(190deg, rgba(17, 37, 82, 0.68), var(--glass-sidebar));
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 20px;
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    padding: 24px 14px;
    box-shadow: 0 22px 48px rgba(11, 24, 57, 0.3);
}

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fbff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(3, 7, 15, 0.16);
}

.hero-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    min-width: 0;
}

.logo {
    padding: 0 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

.logo h1 {
    font-size: 20px;
    letter-spacing: 0.4px;
    font-weight: 700;
}

/* Admin page header overrides - use app primary colors to match UI priority */
body.admin-page .admin-header {
    background: linear-gradient(190deg, var(--primary-dark), var(--primary));
    color: #eef6ff;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 18px 40px rgba(6,14,35,0.35);
}

body.admin-page .admin-title {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.05;
    font-weight: 600;
}

body.admin-page .admin-back-link {
    white-space: nowrap;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(14, 24, 42, 0.92), rgba(10, 17, 31, 0.82)), rgba(9, 14, 25, 0.72);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.7rem;
    font-weight: 600;
}

/* Make skill tags compact */
.skills-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap:8px; }
.skill-tag { padding:6px 10px; border-radius:10px; background:rgba(255,255,255,0.025); display:flex; align-items:center; justify-content:space-between; gap:8px; }
.skill-tag .btn-remove { border:none; background:transparent; color:#ffd6d6; font-weight:700; }

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin: 8px 0;
}
.nav-link {
    text-decoration: none;
    color: #f8fbff;
    display: block;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)), rgba(9, 14, 25, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.45rem 0.6rem;
    border-radius: 12px;
    display:flex;
    justify-content:space-between;
    gap:0.45rem;
    align-items:center;
    width: 100%;
    box-shadow: 0 6px 12px rgba(3, 7, 15, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #eef6ff;
}

.sidebar-footer {
    position: absolute;
    bottom: 18px;
    left: 14px;
    right: 14px;
}

.btn-download {
    width: 100%;
    font-weight: 700;
    border-radius: 12px;
    padding: 12px;
    font-weight: 700;
    color: #f8fbff;
    background: linear-gradient(130deg, rgba(46, 204, 113, 0.68), rgba(39, 174, 96, 0.62));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
}

.btn-download:hover {
    background: linear-gradient(130deg, rgba(52, 231, 128, 0.8), rgba(46, 204, 113, 0.75));
}

.main-content {
    margin-left: 308px;
    width: calc(100% - 308px);
    padding: 24px;
    min-width: 0;
}

.top-bar {
    background: var(--glass-bg-strong);
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    box-shadow: 0 14px 30px rgba(27, 41, 77, 0.1);
}

.top-bar h2 {
    color: var(--ink-900);
}

.stats-summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-card {
    min-width: 155px;
    border-radius: 13px;
    padding: 10px 14px;
    background: linear-gradient(150deg, rgba(37, 69, 133, 0.74), rgba(58, 101, 188, 0.58));
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #eff5ff;
}

.stat-card.accent {
    background: linear-gradient(150deg, rgba(46, 204, 113, 0.72), rgba(39, 174, 96, 0.65));
    border: 1px solid rgba(46, 204, 113, 0.4);
}

.stat-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

.tab-content {
    display: none;
    animation: rise 0.28s ease;
}

.tab-content.active {
    display: block;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 16px 30px rgba(21, 38, 74, 0.1);
}

.card h3 {
    color: var(--ink-900);
    margin-bottom: 12px;
}

body.admin-page {
    min-height: 100vh;
    padding: 16px;
    color: #e7edf8;
    background:
        radial-gradient(circle at 14% 14%, rgba(54, 89, 160, 0.24), transparent 28%),
        radial-gradient(circle at 82% 10%, rgba(46, 204, 113, 0.12), transparent 24%),
        radial-gradient(circle at 80% 88%, rgba(41, 66, 128, 0.24), transparent 32%),
        linear-gradient(160deg, #07101f 0%, #0c1628 46%, #111c31 100%);
}

/* Strong overrides to handle any stale HTML served by development server */
body.admin-page .subtitle {
    display: none !important;
}

body.admin-page .admin-back-link,
body.admin-page .nav-link.admin-back-link {
    text-decoration: none !important;
}

body.admin-page::before {
    opacity: 0.28;
}

.admin-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.admin-header {
    /* Use the exact requested darker gradient for admin header */
    background: linear-gradient(180deg, rgba(14, 24, 42, 0.92), rgba(10, 17, 31, 0.82)), rgba(9, 14, 25, 0.72);
    color: #f8fbff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 18px 40px rgba(11, 24, 57, 0.2);
    margin-bottom: 16px;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 12px;
}

.admin-header h2 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.05;
    letter-spacing: 0.01em;
}

.admin-header .subtitle {
    color: rgba(234, 243, 255, 0.82);
    margin-bottom: 0;
}

.admin-back-link {
    white-space: nowrap;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.85rem;
    width: auto;
    flex: 0 0 auto;
}

/* High-specificity override to ensure admin back-link uses the darker primary shade
   (helps when browsers have cached older CSS or older markup is served). Remove
   !important once visual parity is confirmed. */
div.admin-shell div.top-bar.admin-header a.admin-back-link,
body.admin-page .admin-header > a.admin-back-link,
body.admin-page .admin-back-link {
    background: linear-gradient(180deg, rgba(14, 24, 42, 0.92), rgba(10, 17, 31, 0.82)), rgba(9, 14, 25, 0.72);
    border-color: rgba(255,255,255,0.08);
    color: #ffffff;
}

/* Replace any stray leading arrow characters in older served HTML by
   hiding the original text and showing a clean label via a pseudo-element. */
body.admin-page .nav-link.admin-back-link {
    color: transparent !important;
    position: relative;
}

body.admin-page .nav-link.admin-back-link::after {
    content: "Back to App";
    color: #eaf3ff;
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.admin-card {
    overflow: hidden;
}

.admin-section-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.admin-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.admin-input-row input {
    flex: 1;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 17, 31, 0.7);
    color: #f3f7ff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    font: inherit;
}

.admin-input-row input:focus {
    outline: none;
    border-color: rgba(46, 204, 113, 0.42);
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.12);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.65rem;
    align-items: start;
}

.skill-tag {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)), rgba(9, 14, 25, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    display: flex;
    gap: 0.45rem;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-shadow: 0 10px 20px rgba(3, 7, 15, 0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #f2f6ff;
}

.skill-tag.highlight {
    border-color: rgba(46,204,113,0.86);
    box-shadow: 0 6px 18px rgba(46,204,113,0.08);
}

/* Search input/button in admin stats */
.stat-card input#skillSearchInput {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: #f2f6ff;
}

/* Ensure search-row uses flex layout for search input and buttons */
.admin-stats .stat-card.search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
}
.admin-stats .stat-card.search-row input#skillSearchInput { flex: 1; padding: 8px 10px; border-radius: 10px; }

.stat-card .btn-primary {
    background: linear-gradient(130deg, rgba(46,204,113,0.88), rgba(39,174,96,0.84));
    color: #f8fbff;
    border: 1px solid rgba(46,204,113,0.35);
}

.btn-remove {
    background: rgba(185, 74, 74, 0.16);
    color: #ffd6d6;
    border: 1px solid rgba(185, 74, 74, 0.34);
    font-weight: 800;
    cursor: pointer;
    padding: 0.16rem 0.55rem;
    line-height: 1;
    min-width: 0;
}

.admin-actions {
    margin-top: 1.15rem;
}

#message.message {
    margin-bottom: 1rem;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 17, 31, 0.54);
    color: #f3f7ff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
}

#message.message.success,
#message.message.error {
    display: block;
}

#message.message.success {
    background: rgba(46,204,113,0.14);
    border-color: rgba(46,204,113,0.24);
    color: var(--primary-dark);
}

#message.message.error {
    background: rgba(185,74,74,0.10);
    border-color: rgba(185,74,74,0.18);
    color: var(--danger);
}

@media (max-width: 640px) {
    body.admin-page {
        padding: 10px;
    }

    body.admin-page .admin-header {
        flex-direction: column;
        align-items: stretch;
    }

    body.admin-page .admin-back-link {
        width: 100%;
    }

    .admin-input-row,
    .admin-section-title {
        flex-direction: column;
        align-items: stretch;
    }

    .skill-tag {
        width: 100%;
    }

    .admin-actions {
        flex-direction: column;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }
}

.subtitle {
    color: var(--ink-500);
    margin-bottom: 12px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
}

.upload-area {
    border: 1px dashed rgba(48, 88, 166, 0.45);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(235, 242, 255, 0.5));
    border-radius: 14px;
    padding: 48px 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: rgba(36, 68, 128, 0.7);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(230, 238, 255, 0.62));
    transform: translateY(-2px);
}

.upload-status {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 600;
}

.upload-status.success {
    background: rgba(45, 143, 98, 0.14);
    color: #1f6c49;
}

.upload-status.error {
    background: rgba(185, 74, 74, 0.14);
    color: #923838;
}

.jobs-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 16px;
}

.job-form {
    display: grid;
    gap: 14px;
}

.job-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.filter-group.full-width {
    grid-column: 1 / -1;
}

.jobs-board {
    display: grid;
    gap: 12px;
}

.job-card {
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.job-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(30, 48, 87, 0.14);
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.job-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink-900);
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.job-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(46, 204, 113, 0.12);
    color: var(--accent-green-dark);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.job-summary {
    color: var(--ink-700);
    font-size: 14px;
    line-height: 1.5;
}

.job-detail-grid {
    display: grid;
    gap: 10px;
}

.job-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.upload-results-table th,
.upload-results-table td {
    font-size: 13px;
    padding: 8px 10px;
}

.status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 9px;
    text-transform: uppercase;
}

.status-uploaded {
    color: #1f6c49;
    background: rgba(45, 143, 98, 0.16);
}

.status-duplicate {
    color: #8b5a18;
    background: rgba(183, 128, 48, 0.2);
}

.status-failed {
    color: #923838;
    background: rgba(185, 74, 74, 0.16);
}

.candidates-list {
    display: grid;
    gap: 10px;
}

.candidate-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-left: 4px solid rgba(38, 88, 168, 0.82);
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 12px;
    cursor: pointer;
}

.candidate-name {
    font-weight: 700;
    color: var(--ink-900);
}

.candidate-email {
    color: var(--ink-500);
    font-size: 13px;
}

.candidate-score {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
}

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.46);
    background: rgba(255, 255, 255, 0.44);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th,
td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 14px;
}

th {
    text-transform: uppercase;
    font-size: 12px;
    color: var(--ink-900);
    background: rgba(255, 255, 255, 0.58);
    letter-spacing: 0.4px;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.56);
}

.score {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 12px;
}

.score.excellent {
    color: #1f6c49;
    background: rgba(45, 143, 98, 0.16);
}

.score.good {
    color: #1f4f9a;
    background: rgba(48, 88, 166, 0.15);
}

.score.fair {
    color: #8b5a18;
    background: rgba(183, 128, 48, 0.2);
}

.score.poor {
    color: #923838;
    background: rgba(185, 74, 74, 0.16);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--ink-900);
    font-weight: 700;
}

.filter-group input,
.filter-group select,
.filter-group textarea {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 11px;
    padding: 10px;
    font-size: 14px;
    color: var(--ink-800);
    background: rgba(255, 255, 255, 0.66);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font: inherit;
}

/* Active Job Top Selector Styling */
.active-top-selector {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-800);
    background: rgba(255, 255, 255, 0.66);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.active-top-selector:hover {
    border-color: rgba(48, 88, 166, 0.3);
    background: rgba(255, 255, 255, 0.8);
}

.active-top-selector:focus {
    outline: none;
    border-color: rgba(48, 88, 166, 0.6);
    box-shadow: 0 0 0 3px rgba(48, 88, 166, 0.14);
}

.active-top-selector option {
    color: var(--ink-900);
    background: rgba(255, 255, 255, 0.96);
}
/* Ensure native select dropdowns and their options have good contrast */
.filter-group select,
.filter-group select option {
    color: var(--ink-900);
    background: rgba(255, 255, 255, 0.96);
}

.filter-group select::-ms-expand {
    display: inline-block;
}

.filter-group textarea {
    min-height: 120px;
    resize: vertical;
}

.filter-group input:focus,
.filter-group select:focus,
.filter-group textarea:focus {
    outline: none;
    border-color: rgba(48, 88, 166, 0.6);
    box-shadow: 0 0 0 3px rgba(48, 88, 166, 0.14);
}

.filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    border-radius: 11px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    color: #f8fbff;
    border: 1px solid rgba(46, 204, 113, 0.5);
    background: linear-gradient(130deg, rgba(46, 204, 113, 0.88), rgba(39, 174, 96, 0.84));
    box-shadow: 0 10px 20px rgba(46, 204, 113, 0.25);
}

.btn-resume {
    color: #f8fbff;
    border: 1px solid rgba(46, 204, 113, 0.55);
    background: linear-gradient(130deg, rgba(74, 222, 128, 0.95), rgba(34, 197, 94, 0.92));
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.22);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-resume:hover {
    color: #f8fbff;
    text-decoration: none;
}

.btn-secondary {
    color: var(--ink-900);
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-danger {
    background: rgba(185, 74, 74, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff7f7;
    font-size: 12px;
    padding: 6px 10px;
}

.btn-small {
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.1;
}

#activeJobTopCandidates .candidate-item {
    background: linear-gradient(180deg, rgba(255,255,255,0.58), rgba(235,242,255,0.72));
    border: 1px solid rgba(48, 88, 166, 0.12);
    box-shadow: 0 10px 22px rgba(34, 72, 154, 0.08);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}

#filteredTable .candidate-results-grid {
    display: grid;
    gap: 12px;
}

#filteredTable .candidate-item,
.candidate-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.58), rgba(235,242,255,0.72));
    border: 1px solid rgba(48, 88, 166, 0.12);
    box-shadow: 0 10px 22px rgba(34, 72, 154, 0.08);
    padding: 12px;
    border-radius: 12px;
}

/* Responsive breakpoints: make layout fluid on tablets and phones */
@media (max-width: 1200px) {
    .sidebar { width: 240px; }
    .main-content { margin-left: 264px; width: calc(100% - 264px); }
}

@media (max-width: 900px) {
    .sidebar {
        width: min(320px, calc(100vw - 24px));
        inset: 12px auto 12px 12px;
        z-index: 40;
        transform: translateX(-112%);
        transition: transform 0.25s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 12px;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .logo h1 { font-size: 18px; }
    .nav-menu { display: flex; flex-wrap: wrap; gap: 8px; }
    .nav-link { flex: 1 1 auto; }
}

@media (max-width: 640px) {
    .container {
        display: block;
    }

    .dashboard-grid { grid-template-columns: 1fr; }
    .jobs-layout { grid-template-columns: 1fr; }
    .job-form-grid { grid-template-columns: 1fr; }
    .upload-area { padding: 28px 12px; }
    .card { padding: 12px; }
    .top-bar { padding: 12px; }
    .stat-card { min-width: 120px; }
    .logo-img { height: 34px; }

    .hero-heading {
        width: 100%;
        justify-content: space-between;
    }

    .sidebar-toggle {
        width: 100%;
    }

    .stats-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body { font-size: 14px; }
    .logo h1 { font-size: 16px; }
    .btn-primary, .btn-secondary, .btn-danger { padding: 8px 12px; }
    .admin-input-row { flex-direction: column; align-items: stretch; }
    .admin-stats { grid-template-columns: 1fr; }
    .top-bar.dashboard-hero { padding: 16px; }
    .hero-heading h2 { font-size: 2rem; }
    .stat-card { min-width: 0; }
}

#filteredTable .candidate-card-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#filteredTable .pagination-bar {
    margin-top: 14px;
}

#activeJobTopCandidates .candidate-name {
    color: var(--ink-900);
}

#activeJobTopCandidates .candidate-email {
    color: var(--ink-700);
}

#activeJobTopCandidates .job-pill {
    background: rgba(48, 88, 166, 0.08);
    color: var(--primary-dark);
    border-color: rgba(48, 88, 166, 0.12);
}

#activeJobTopCandidates .btn-primary.btn-small,
#activeJobRankingTable .btn-primary.btn-small {
    color: #f8fbff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(130deg, #22489A 0%, #3BA7D6 100%);
    box-shadow: 0 8px 18px rgba(34, 72, 154, 0.18);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover {
    transform: translateY(-1px);
}

.btn-resume:hover {
    transform: translateY(-1px);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(9, 17, 35, 0.42);
    z-index: 1000;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

#candidateModal .modal-content {
    background: linear-gradient(180deg, #0f254a 0%, #153a6a 100%);
    color: #f8fbff;
    border-radius: 12px;
    padding: 20px;
    max-width: 880px;
    width: 95%;
    box-shadow: 0 20px 50px rgba(20, 49, 90, 0.45);
}

#candidateModal .modal-content h3 {
    color: #ffffff;
}

#candidateModal .detail-section h4 {
    color: rgba(255, 255, 255, 0.92);
}

#candidateModal .detail-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
}

#candidateModal .detail-label {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 700;
}

#candidateModal .detail-value {
    color: #e6f0ff;
}

#candidateModal .close {
    color: rgba(255, 255, 255, 0.9);
    font-size: 22px;
}

#candidateModal .btn-primary {
    background: linear-gradient(130deg, #22489a 0%, #3ba7d6 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

#candidateModal .detail-section {
    margin-bottom: 12px;
}

.modal-content {
    width: min(760px, 94vw);
    max-height: 86vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 18px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px;
    position: relative;
    box-shadow: 0 16px 34px rgba(11, 23, 48, 0.2);
}

.close {
    position: absolute;
    right: 12px;
    top: 8px;
    cursor: pointer;
    font-size: 26px;
    color: var(--ink-500);
}

.detail-section {
    margin-bottom: 12px;
}

.detail-section h4 {
    color: var(--ink-900);
    margin-bottom: 8px;

/* Additional simple responsive tweaks */
@media (max-width: 700px) {
    table { min-width: 0 !important; width: 100% !important; }
    th, td { white-space: normal !important; word-break: break-word; }
    .table-container { overflow-x: auto; }
    img, .logo-img { max-width: 100%; height: auto; }
    .sidebar { position: relative; width: 100%; transform: none; inset: auto; }
    .main-content { margin-left: 0; width: 100%; padding: 12px; }
    .filter-actions { flex-direction: column; }
    .admin-input-row { flex-direction: column; align-items: stretch; }
    .modal-content { width: 96vw; max-width: 96vw; }
}
    border-bottom: 1px solid rgba(15, 23, 42, 0.12);
    padding-bottom: 6px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px dashed rgba(15, 23, 42, 0.14);
    padding: 6px 0;
}

.detail-label {
    font-weight: 700;
    color: var(--ink-800);
}

.detail-value {
    color: var(--ink-500);
    text-align: right;
}

canvas {
    max-height: 320px;
}

.empty-state {
    text-align: center;
    color: var(--ink-500);
    padding: 24px;
}

@media (max-width: 920px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: calc(100% - 24px);
        inset: auto;
        margin: 12px;
    }

    .sidebar-footer {
        position: static;
        margin-top: 8px;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .jobs-layout {
        grid-template-columns: 1fr;
    }

    .job-form-grid {
        grid-template-columns: 1fr;
    }
}

body {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: #e7edf8;
    background:
        radial-gradient(circle at 15% 12%, rgba(228, 195, 133, 0.18), transparent 24%),
        radial-gradient(circle at 82% 8%, rgba(119, 151, 221, 0.18), transparent 28%),
        radial-gradient(circle at 80% 88%, rgba(41, 66, 128, 0.22), transparent 30%),
        linear-gradient(160deg, #07101f 0%, #0c1628 44%, #111c31 100%);
    line-height: 1.55;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0));
    opacity: 0.35;
}

.container {
    min-height: 100vh;
    display: flex;
    position: relative;
}

.sidebar {
    width: 280px;
    position: fixed;
    inset: 14px auto 14px 14px;
    color: #f4f7fb;
    background:
        linear-gradient(180deg, rgba(9, 18, 36, 0.94), rgba(10, 17, 31, 0.82)),
        radial-gradient(circle at top, rgba(34, 197, 94, 0.16), transparent 42%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
    padding: 26px 16px;
    box-shadow:
        0 30px 60px rgba(4, 8, 18, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

    .active-top-control {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 16px;
        flex-wrap: wrap;
    }

    .active-top-control label {
        margin: 0;
        font-size: 14px;
        font-weight: 700;
        color: #f4f7fb;
    }

    padding: 0 12px 22px;
        min-width: 96px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 14px;
        padding: 12px 14px;
        font-size: 14px;
        font-weight: 700;
        color: #f4f7fb;
        background: rgba(255, 255, 255, 0.06);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    font-family: "Cormorant Garamond", Georgia, serif;
    letter-spacing: 0.8px;
    font-weight: 700;
    text-transform: uppercase;
    color: #f8fafc;
}
        border-color: rgba(74, 222, 128, 0.32);
        background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    color: rgba(245, 248, 255, 0.82);
    display: block;
    padding: 13px 14px;
        border-color: rgba(74, 222, 128, 0.45);
        box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.14);
    font-weight: 600;
    transition: transform 0.22s ease, background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
        color: #101726;
        background: rgba(255, 255, 255, 0.96);
.nav-link.active {
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
    color: #fff9ef;
}

.btn-download {
    border: 1px solid rgba(34, 197, 94, 0.42);
    border-radius: 14px;
    padding: 12px;
    font-weight: 700;
    color: #fffaf1;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.92), rgba(74, 222, 128, 0.82));
    box-shadow: 0 14px 28px rgba(10, 76, 32, 0.22);
}

.btn-download:hover {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.96), rgba(34, 197, 94, 0.88));
    box-shadow: 0 18px 34px rgba(10, 76, 32, 0.32);
}

.main-content {
    margin-left: 308px;
    width: calc(100% - 308px);
    padding: 28px;
}

.top-bar.dashboard-hero {
    position: relative;
    overflow: hidden;
    min-height: 144px;
    padding: 30px 32px;
    align-items: stretch;
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(12, 19, 33, 0.92), rgba(22, 33, 58, 0.78)),
        radial-gradient(circle at 18% 22%, rgba(74, 222, 128, 0.14), transparent 32%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 28px 60px rgba(5, 10, 20, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.top-bar.dashboard-hero::before,
.top-bar.dashboard-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.top-bar.dashboard-hero::before {
    width: 240px;
    height: 240px;
    right: -110px;
    top: -110px;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.16), transparent 66%);
}

.top-bar.dashboard-hero::after {
    width: 160px;
    height: 160px;
    right: 150px;
    bottom: -90px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 70%);
}

#page-title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(34px, 4vw, 58px);
    line-height: 0.95;
    letter-spacing: 0.02em;
    color: #f8fafc;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    width: min(640px, 100%);
    align-self: center;
    min-width: 0;
}

.stat-card {
    min-width: 0;
    border-radius: 18px;
    padding: 16px 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06)),
        rgba(10, 17, 31, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #f2f6ff;
    box-shadow: 0 18px 36px rgba(3, 7, 15, 0.22);
}

.stat-card.accent {
    background:
        linear-gradient(135deg, rgba(22, 163, 74, 0.26), rgba(34, 197, 94, 0.62)),
        rgba(10, 17, 31, 0.62);
    border-color: rgba(74, 222, 128, 0.28);
}

.stat-label {
    color: rgba(243, 246, 255, 0.72);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-value {
    font-size: 30px;
    font-weight: 700;
    font-family: "Cormorant Garamond", Georgia, serif;
    letter-spacing: 0.02em;
}

.top-bar h2 {
    color: #f8fafc;
}

.tab-content {
    display: none;
    animation: rise 0.3s ease;
}

.card {
    background:
        linear-gradient(180deg, rgba(14, 24, 42, 0.88), rgba(10, 17, 31, 0.74)),
        rgba(9, 14, 25, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow:
        0 22px 50px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card:hover {
    box-shadow:
        0 28px 58px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
}

.card h3 {
    color: #f7f9fc;
    margin-bottom: 18px;
    font-size: 18px;
    font-weight: 700;
    font-family: "Cormorant Garamond", Georgia, serif;
    letter-spacing: 0.02em;
}

.card--featured {
    grid-row: span 2;
}

.bento-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
}

.bento-grid > .card {
    grid-column: span 4;
    min-height: 280px;
}

.bento-grid > .card--featured {
    grid-column: span 8;
    min-height: 380px;
}

.bento-grid > .card:nth-child(2),
.bento-grid > .card:nth-child(3),
.bento-grid > .card:nth-child(4) {
    min-height: 300px;
}

.upload-area {
    border: 1px dashed rgba(74, 222, 128, 0.34);
    background:
        radial-gradient(circle at top, rgba(74, 222, 128, 0.1), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(13, 20, 34, 0.54));
    border-radius: 18px;
    padding: 54px 24px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: rgba(74, 222, 128, 0.62);
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.subtitle,
.candidate-email,
.detail-value,
.empty-state,
.job-summary,
.upload-area p {
    color: rgba(232, 238, 248, 0.74);
}

.filter-group label,
.detail-label,
.job-card-title,
.candidate-name,
.score,
th {
    color: #f4f7fb;
}

.filter-group input,
.filter-group select,
.filter-group textarea {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    color: #f4f7fb;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.filter-group input:focus,
.filter-group select:focus,
.filter-group textarea:focus {
    outline: none;
    border-color: rgba(74, 222, 128, 0.45);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.14);
}

.btn-primary,
.btn-secondary,
.btn-danger {
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
    color: #101726;
    border: 1px solid rgba(74, 222, 128, 0.55);
    background: linear-gradient(135deg, #bbf7d0, #22c55e);
    box-shadow: 0 12px 24px rgba(10, 76, 32, 0.25);
}

.btn-secondary {
    color: #f4f7fb;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-danger {
    background: rgba(185, 74, 74, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff7f7;
    font-size: 12px;
    padding: 6px 10px;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover {
    transform: translateY(-1px);
}

.table-container {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(6, 10, 18, 0.34);
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(245, 248, 255, 0.78);
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 13px;
    font-weight: 600;
}

.pagination-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-page {
    min-width: 100px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: rgba(245, 248, 255, 0.82);
}

.pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th,
td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
}

th {
    text-transform: uppercase;
    font-size: 11px;
    color: rgba(245, 248, 255, 0.76);
    background: rgba(255, 255, 255, 0.03);
    letter-spacing: 0.55px;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.score.excellent,
.score.good,
.score.fair,
.score.poor,
.status-uploaded,
.status-duplicate,
.status-failed {
    color: #f8fafc;
}

.score.excellent,
.status-uploaded {
    background: rgba(16, 185, 129, 0.14);
}

.score.good {
    background: rgba(34, 197, 94, 0.14);
}

.score.fair,
.status-duplicate {
    background: rgba(132, 204, 22, 0.14);
}

.score.poor,
.status-failed {
    background: rgba(185, 74, 74, 0.16);
}

.candidate-item,
.job-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.candidate-score {
    color: #86efac;
}

canvas {
    max-height: 320px;
    max-width: 100%;
}

@media (max-width: 920px) {
    .top-bar.dashboard-hero {
        padding: 24px;
    }

    .stats-summary {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-grid > .card,
    .bento-grid > .card--featured {
        grid-column: auto;
        min-height: auto;
        grid-row: auto;
    }
}

.top-bar {
    position: relative;
    overflow: hidden;
    min-height: 144px;
    padding: 30px 32px;
    align-items: stretch;
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(8, 20, 13, 0.94), rgba(17, 31, 20, 0.8)),
        radial-gradient(circle at 18% 22%, rgba(74, 222, 128, 0.14), transparent 32%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 28px 60px rgba(5, 10, 20, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.top-bar h2 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(34px, 4vw, 58px);
    line-height: 0.95;
    letter-spacing: 0.02em;
    color: #f8fafc;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.dashboard-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
}

.dashboard-grid > .card {
    grid-column: span 4;
    min-height: 280px;
}

.dashboard-grid > .card:first-child {
    grid-column: span 8;
    grid-row: span 2;
    min-height: 380px;
}

@media (max-width: 920px) {
    .top-bar {
        padding: 24px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid > .card,
    .dashboard-grid > .card:first-child {
        grid-column: auto;
        grid-row: auto;
        min-height: auto;
    }
}

/* Final responsive safety overrides (kept at file end to win cascade) */
@media (max-width: 1100px) {
    .container {
        display: block !important;
    }

    .sidebar {
        position: static !important;
        inset: auto !important;
        width: calc(100% - 24px) !important;
        margin: 12px !important;
        transform: none !important;
    }

    .sidebar-footer {
        position: static !important;
        margin-top: 12px;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 14px !important;
    }

    .sidebar-toggle {
        display: none !important;
    }

    .top-bar,
    .top-bar.dashboard-hero {
        min-height: 0 !important;
        padding: 16px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }

    .hero-heading {
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .stats-summary {
        width: 100% !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .dashboard-grid,
    .bento-grid,
    .jobs-layout,
    .job-form-grid,
    .admin-stats {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 760px) {
    body {
        overflow-x: hidden;
    }

    .card {
        padding: 14px !important;
        border-radius: 16px;
    }

    .stats-summary {
        grid-template-columns: 1fr !important;
    }

    .filter-actions,
    .admin-input-row,
    .admin-section-title,
    .job-detail-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .pagination-bar {
        flex-direction: column;
        align-items: stretch;
    }

    table {
        min-width: 0 !important;
        width: 100% !important;
    }

    th,
    td {
        white-space: normal !important;
        word-break: break-word;
        font-size: 12px;
        padding: 8px 6px;
    }

    .modal-content,
    #candidateModal .modal-content {
        width: 96vw !important;
        max-width: 96vw !important;
        padding: 14px;
    }
}

img,
canvas,
svg {
    max-width: 100%;
    height: auto;
}

/* Device-targeted responsive lock for iPad and phones */
@media (max-width: 1024px) {
    .sidebar {
        position: static !important;
        width: calc(100% - 20px) !important;
        margin: 10px !important;
        border-radius: 18px;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 12px !important;
    }

    .top-bar,
    .top-bar.dashboard-hero {
        min-height: auto !important;
        padding: 14px !important;
        border-radius: 18px;
    }

    #page-title,
    .top-bar h2 {
        font-size: clamp(28px, 5vw, 40px) !important;
        line-height: 1.05;
    }

    .stats-summary {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 820px) {
    .stats-summary {
        grid-template-columns: 1fr !important;
    }

    .stat-card {
        padding: 12px !important;
    }

    .stat-value {
        font-size: 24px !important;
    }
}

@media (max-width: 768px) {
    .container,
    .main-content,
    .card,
    .table-container,
    .upload-area,
    .job-card,
    .candidate-item,
    .modal-content {
        max-width: 100% !important;
    }

    .nav-menu {
        display: block !important;
    }

    .nav-menu li {
        margin: 6px 0 !important;
    }

    .nav-link {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px !important;
    }

    .main-content {
        padding: 10px !important;
    }

    .card {
        padding: 12px !important;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger,
    .btn-download,
    .btn-resume {
        width: 100%;
        min-width: 0;
    }

    .filter-group input,
    .filter-group select,
    .filter-group textarea,
    .admin-input-row input {
        width: 100%;
        min-width: 0;
    }
}
