
:root {
    --navy: #142b4a;
    --navy-dark: #0d1e35;
    --sky-blue: #38a8e8;
    --background: #f4f7fb;
    --white: #ffffff;
    --text: #26364b;
    --muted: #7d8a9b;
    --border: #e5ebf2;
    --danger: #d64545;
    --shadow: 0 4px 18px rgba(20, 43, 74, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
    font-size: 14px;
}

[hidden] {
    display: none !important;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.topbar {
    height: 68px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-size: 24px;
    font-weight: 700;
    color: var(--navy);
}

.brand span {
    color: var(--sky-blue);
}

.topbar-label {
    color: var(--navy);
    font-size: 14px;
}

.layout {
    display: flex;
    min-height: calc(100vh - 68px);
}

.sidebar {
    width: 237px;
    flex-shrink: 0;
    background: var(--navy);
    padding: 28px 14px;
    color: var(--white);
}

.nav-heading {
    font-size: 11px;
    font-weight: 700;
    color: #b7c7da;
    margin: 12px 12px 14px;
    letter-spacing: 0.5px;
}

.sidebar a {
    display: block;
    color: #edf4fc;
    text-decoration: none;
    padding: 13px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    font-size: 14px;
    transition: 0.2s;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.09);
}

.sidebar a.active {
    background: var(--sky-blue);
    color: white;
    font-weight: 600;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 30px;
    overflow-x: hidden;
}

.app-page {
    width: 100%;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-heading h1 {
    font-size: 25px;
    color: var(--navy);
    margin-bottom: 7px;
}

.page-heading p {
    color: var(--muted);
    font-size: 14px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.card,
.section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 11px;
    box-shadow: var(--shadow);
}

.card {
    padding: 22px;
}

.card span {
    display: block;
    color: var(--muted);
    margin-bottom: 13px;
}

.card strong {
    color: var(--navy);
    font-size: 29px;
}

.section {
    padding: 22px;
    margin-bottom: 22px;
}

.section h2 {
    color: var(--navy);
    font-size: 18px;
    margin-bottom: 14px;
}

.section p {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 15px;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 17px;
    border-radius: 7px;
    border: 1px solid transparent;
    font-weight: 600;
    transition: 0.2s;
}

.primary-btn {
    background: var(--sky-blue);
    color: white;
}

.primary-btn:hover {
    background: #2094d6;
}

.secondary-btn {
    background: white;
    color: var(--navy);
    border-color: var(--border);
}

.secondary-btn:hover {
    background: #f1f6fb;
    border-color: #cbd8e6;
}

.candidate-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.candidate-toolbar input,
#globalCandidateSearch {
    width: min(100%, 460px);
}

input,
select {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid #dce4ee;
    border-radius: 7px;
    background: white;
    color: var(--text);
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--sky-blue);
    box-shadow: 0 0 0 3px rgba(56, 168, 232, 0.12);
}

#candidateCount {
    color: var(--muted);
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.candidate-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.candidate-table th {
    background: #f6f9fc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.candidate-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.candidate-table tbody tr:hover {
    background: #fbfdff;
}

.empty-state {
    text-align: center;
    color: var(--muted) !important;
    padding: 28px !important;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 45, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    overflow-y: auto;
}

.modal-content {
    background: white;
    width: min(850px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 15px 55px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 23px;
}

.modal-header h2 {
    color: var(--navy);
    font-size: 21px;
    margin-bottom: 7px;
}

.modal-header p {
    color: var(--muted);
}

.close-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 28px;
    line-height: 1;
    padding: 0 5px;
}

.close-btn:hover {
    color: var(--danger);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group label {
    display: block;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.profile-field {
    padding: 15px;
    background: #f7faff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-wrap: anywhere;
    min-width: 0;
}

.profile-field strong {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 9px;
}

.profile-field p {
    color: var(--navy);
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.search-results {
    margin-top: 20px;
}

.search-result {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.search-result h3 {
    color: var(--navy);
    margin-bottom: 5px;
}

.search-result p {
    margin: 0;
}

@media (max-width: 1050px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .topbar {
        padding: 0 16px;
        height: 60px;
    }

    .brand {
        font-size: 21px;
    }

    .topbar-label {
        display: none;
    }

    .layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        padding: 10px;
        display: flex;
        overflow-x: auto;
        gap: 5px;
    }

    .nav-heading {
        display: none;
    }

    .sidebar a {
        white-space: nowrap;
        margin: 0;
        padding: 11px 13px;
    }

    .main {
        padding: 18px 13px;
    }

    .cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .card {
        padding: 15px;
    }

    .card strong {
        font-size: 24px;
    }

    .form-grid,
    .profile-details {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 8px;
        align-items: flex-start;
    }

    .modal-content {
        padding: 18px;
        max-height: 96vh;
    }

    .page-heading {
        align-items: flex-start;
    }

    .search-result {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 380px) {
    .cards {
        grid-template-columns: 1fr;
    }
}

/* Recycle Bin */

.danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 7px;
    border: 1px solid #f0cccc;
    background: #fff5f5;
    color: #c03939;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.danger-btn:hover {
    background: #ffe5e5;
    border-color: #e8aaaa;
}

.recycle-count {
    color: var(--muted);
    font-size: 13px;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

/* =========================================
   TALENTCORE LOGIN SCREEN
========================================= */

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #0d1e35, #142b4a);
}

.login-card {
    width: min(420px, 100%);
    padding: 38px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
    color: var(--navy);
    font-size: 30px;
    margin-bottom: 10px;
}

.login-card h1 span {
    color: var(--sky-blue);
}

.login-card > p {
    color: var(--muted);
    margin-bottom: 28px;
    line-height: 1.5;
}

.login-card .form-group {
    margin-bottom: 20px;
}

.login-card .primary-btn {
    width: 100%;
    margin-top: 10px;
    min-height: 44px;
}

#loginMessage,
#inviteMessage,
#userManagementMessage {
    margin-top: 14px;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.5;
}

#loginButton:disabled,
#sendInvitationBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* User Management */

#usersPage .candidate-toolbar h2 {
    margin: 0;
}

#userSearch {
    max-width: 350px;
}

#userTableBody td {
    overflow-wrap: anywhere;
}

@media (max-width: 480px) {
    .login-card {
        padding: 25px 20px;
    }
}
