:root {
    color-scheme: light;
    font-family: "Segoe UI", Arial, sans-serif;
    color: #172033;
    background: #f4f6fa;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
}

.mobile-menu-button { display: none; }

.sidebar {
    width: 260px;
    padding: 28px 18px;
    color: #ffffff;
    background: #17233f;
}

.brand {
    margin: 0 10px 28px;
    font-size: 20px;
    font-weight: 700;
}

.menu-link {
    display: block;
    margin-bottom: 6px;
    padding: 11px 12px;
    border-radius: 8px;
    color: #dce5f7;
    text-decoration: none;
}

.menu-link:hover,
.menu-link:focus-visible {
    color: #ffffff;
    background: #26385f;
}

.user-panel { margin-top: 28px; padding: 16px 10px 0; border-top: 1px solid rgb(255 255 255 / 15%); }
.user-panel strong,.user-panel span { display: block; }.user-panel span { margin: 4px 0 12px; color: #b8c5dc; font-size: 12px; }.user-panel button { width: 100%; color: #dce5f7; border: 1px solid #536487; background: transparent; }
.login-page { display: block; }.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }.login-card { width: min(100%,420px); }.login-card .notice { margin: 0; }.login-brand { margin: 0 0 12px; color: #2457a7; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.user-actions { white-space: nowrap; }.user-actions form { display: inline; }.link-button { padding: 0; color: #2457a7; background: transparent; font-weight: 400; }.link-button:hover { color: #194685; background: transparent; }
.candidate-placeholder { max-width: 720px; }
.phone-link { display: inline-block; min-height: 32px; line-height: 32px; font-weight: 600; }
.candidate-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; gap: 20px; max-width: 1400px; }
.candidate-layout .card { max-width: none; }
.candidate-main-column { display: grid; gap: 20px; min-width: 0; }
.candidate-history-column { display: grid; gap: 20px; min-width: 0; }
.candidate-history-column .card { margin: 0; }
.form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.checkbox-row,.button-row,.status-actions,.inline-action,.source-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.button-stack { display: grid; gap: 9px; margin-top: 14px; }.button-stack form { display: grid; gap: 9px; }
.secondary-button,.secondary-button:hover { color: #2457a7; border: 1px solid #9fb5d7; background: #fff; }
.object-choice { display: grid; gap: 12px; margin-top: 16px; }.object-choice select { width: 100%; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 18px; }
.candidate-task-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 12px; }
.candidate-task { padding: 16px; border: 1px solid #e1e6ef; border-radius: 10px; background: #fff; box-shadow: 0 5px 15px rgb(23 32 51 / 5%); }
.candidate-task h3,.candidate-task p { margin: 0 0 8px; }.source-stats { margin: 0 0 24px; }.source-stats h2 { width: 100%; margin-bottom: 5px; }

.content {
    width: 100%;
    padding: 36px;
    overflow-x: hidden;
}

.crm-view-switcher { display: grid; gap: 8px; margin-top: 22px; padding: 14px 10px 0; border-top: 1px solid rgb(255 255 255 / 15%); }
.crm-view-switcher > strong { font-size: 13px; }
.crm-view-switcher > div { display: grid; gap: 5px; }
.crm-view-switcher button { width: 100%; padding: 7px 8px; color: #dce5f7; border: 1px solid #536487; background: transparent; font-size: 12px; text-align: left; }
.crm-view-switcher button.is-active { color: #17233f; border-color: #fff; background: #fff; }
.crm-view-switcher small { color: #b8c5dc; }
.crm-navigation-toolbar { display: flex; align-items: center; gap: 10px; min-height: 34px; margin: -22px 0 14px; }
.crm-navigation-toolbar button { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.crm-navigation-toolbar button:disabled { color: #929dad; border-color: #d8dee7; background: #f5f6f8; cursor: default; }

h1 {
    margin-top: 0;
    font-size: 30px;
}

.card {
    max-width: 900px;
    padding: 24px;
    border: 1px solid #e1e6ef;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgb(23 32 51 / 6%);
}

h2 {
    margin-top: 0;
    font-size: 20px;
}

a {
    color: #2457a7;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-heading h1 {
    margin: 8px 0 0;
}

.button,
button {
    display: inline-block;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: #2457a7;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: #194685;
}

.secondary-link {
    padding: 9px 4px;
    color: #526178;
}

.filters {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid #e1e6ef;
    border-radius: 12px;
    background: #ffffff;
}

label {
    display: grid;
    gap: 6px;
    color: #526178;
    font-size: 13px;
    font-weight: 600;
}

.search-field {
    min-width: 270px;
    flex: 1;
}

input,
select,
textarea {
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #cbd3df;
    border-radius: 7px;
    color: #172033;
    background: #ffffff;
    font: inherit;
}

textarea {
    resize: vertical;
}

select {
    appearance: none;
    padding-right: 34px;
    background-image: linear-gradient(45deg,transparent 50%,#66758a 50%),linear-gradient(135deg,#66758a 50%,transparent 50%);
    background-position: calc(100% - 16px) 50%,calc(100% - 11px) 50%;
    background-size: 5px 5px,5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}

select:hover { border-color: #9eb0c7; }
select:focus-visible { border-color: #6f94c8; outline: 3px solid rgba(65,112,177,.14); }

.table-wrap {
    overflow-x: auto;
    border: 1px solid #e1e6ef;
    border-radius: 12px;
    background: #ffffff;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid #e7ebf2;
    text-align: left;
    vertical-align: top;
}

th {
    color: #526178;
    background: #f8f9fc;
    font-size: 12px;
    white-space: nowrap;
}

.empty-state {
    padding: 40px;
    color: #68758a;
    text-align: center;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    color: #274879;
    background: #eaf1fb;
    font-size: 12px;
    white-space: nowrap;
}

.large-tags .tag {
    padding: 7px 11px;
    font-size: 14px;
}

.stacked-form {
    display: grid;
    gap: 18px;
}

.notice {
    max-width: 900px;
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 8px;
}

.notice.error {
    color: #842029;
    background: #f8d7da;
}

.report {
    margin-top: 22px;
}

.report-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.report-grid div {
    min-width: 120px;
    padding: 12px;
    border-radius: 8px;
    background: #f4f6fa;
}

.report-grid dt {
    color: #68758a;
    font-size: 12px;
}

.report-grid dd {
    margin: 3px 0 0;
    font-size: 24px;
    font-weight: 700;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    max-width: 1120px;
}

.detail-grid .card {
    max-width: none;
}

.details {
    display: grid;
    grid-template-columns: minmax(130px, 0.7fr) minmax(0, 1.3fr);
    gap: 10px 16px;
    margin-bottom: 0;
}

.details dt {
    color: #68758a;
}

.details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.rating-box {
    min-width: 105px;
    padding: 10px 16px;
    border-radius: 12px;
    color: #ffffff;
    background: #2457a7;
    text-align: center;
}

.rating-box span,
.rating-box small {
    display: block;
}

.rating-box strong {
    font-size: 30px;
}

.rating-reasons {
    padding-left: 20px;
    line-height: 1.8;
}

.full-width { grid-column: 1 / -1; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.quick-actions { display: grid; gap: 3px; margin-top: 7px; font-size: 12px; white-space: nowrap; }
.small-button { display: inline-block; padding: 6px 9px; border-radius: 6px; color: white; background: #2457a7; text-decoration: none; }
.dashboard-section { margin-bottom: 28px; }
.history-item { padding: 16px 0; border-top: 1px solid #e1e6ef; }
.history-item h3 { margin: 0 0 10px; font-size: 16px; }
.history-item p { margin: 6px 0; }
.warning { padding: 10px 12px; border-radius: 7px; color: #7a4b00; background: #fff3cd; font-weight: 600; }
.checkbox { display: flex; grid-template-columns: auto 1fr; align-items: center; }
.checkbox input { min-height: auto; }
.danger, .danger:hover { background: #b4232c; }
.danger-link { color: #b4232c; }
.action-status { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #eaf1fb; font-weight: 600; }
.ai-confirmed { margin-top: 18px; padding: 10px 12px; border-radius: 7px; color: #2457a7; background: #eaf1fb; }
.ai-history-summary { margin-top: 12px; padding: 14px; border-left: 4px solid #2457a7; border-radius: 6px; background: #f4f7fc; }
.notice.success { color: #17633a; background: #dff3e7; }
