:root {
    --fd-bg: #dde3f1;
    --fd-surface: #ffffff;
    --fd-surface-muted: #f2f4ff;
    --fd-text: #1f2535;
    --fd-text-soft: #5e6986;
    --fd-border: #c3cde2;
    --fd-primary: #6d59c8;
    --fd-primary-soft: #f3efff;
    --fd-success: #4fba78;
    --fd-warning: #e2ae3e;
    --fd-danger: #d76262;
    --fd-info: #66a7de;
    --fd-shadow: 0 12px 30px rgba(30, 40, 70, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--fd-bg);
    color: var(--fd-text);
    transition: background-color 0.25s ease, color 0.25s ease;
    position: relative;
}

.fd-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 78px 1fr;
    transition: grid-template-columns 0.28s ease;
}

body.fd-sidebar-open .fd-shell {
    grid-template-columns: 230px 1fr;
}

.fd-sidebar {
    background: var(--fd-surface);
    border-right: 1px solid var(--fd-border);
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    transition: padding 0.28s ease;
}

body.fd-sidebar-open .fd-sidebar {
    align-items: stretch;
    padding: 14px 12px;
}

.fd-sidebar-top {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/*
 * У вузькому сайдбарі логотип і кнопка не поміщаються в один ряд без стискання —
 * тому за замовчуванням колонка; у розгорнутому — ряд з відступом між ними.
 */
body.fd-sidebar-open .fd-sidebar-top {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.fd-sidebar-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid #e9e2ff;
    border-radius: 10px;
    background: var(--fd-primary-soft);
    color: var(--fd-primary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: none;
    flex-shrink: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.fd-sidebar-toggle:hover {
    border-color: #ddd5f5;
    filter: brightness(0.98);
}

body.fd-sidebar-open .fd-sidebar-toggle,
.fd-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fd-logo {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--fd-primary);
    background: var(--fd-primary-soft);
    border: 1px solid #e9e2ff;
    font-weight: 700;
    overflow: hidden;
}

.fd-logo img {
    width: 28px;
    height: 28px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.fd-nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
}

.fd-nav-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fd-nav-bottom form {
    margin: 0;
}

.fd-nav-item {
    width: 100%;
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--fd-text-soft);
    text-decoration: none;
    background: transparent;
}

.fd-nav-item-button {
    cursor: default;
    border: 1px solid transparent;
    padding: 0;
}

button#theme-toggle.fd-nav-item-button {
    cursor: pointer;
    font: inherit;
}

.fd-nav-item .fd-icon {
    width: 30px;
    min-width: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
}

.fd-nav-label {
    display: none;
    font-size: 13px;
    font-weight: 600;
}

body.fd-sidebar-open .fd-nav-item {
    justify-content: flex-start;
    padding: 0 12px;
}

body.fd-sidebar-open .fd-nav-label {
    display: inline;
}

.fd-nav-item.active {
    color: var(--fd-primary);
    background: var(--fd-primary-soft);
    border-color: #e9e2ff;
}

.fd-content {
    padding: 18px 20px;
}

.fd-board {
    max-width: 1240px;
    margin: 0 auto;
    background: var(--fd-surface);
    border: 1px solid var(--fd-border);
    border-radius: 18px;
    padding: 18px 20px 22px;
    box-shadow: var(--fd-shadow);
}

/* Повна ширина робочої області (наприклад, довга анкета кандидата) */
.fd-board.fd-board--wide {
    max-width: none;
    width: 100%;
}

.fd-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.fd-topbar h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.fd-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fd-company-switch-form,
.fd-company-create-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fd-company-switch-select {
    min-width: 170px;
    max-width: 240px;
}

.fd-company-create-input {
    width: 150px;
    min-height: 34px;
    padding: 7px 10px;
}

.fd-company-create-form .fd-btn {
    white-space: nowrap;
    min-height: 34px;
}

/* Конструктор анкет: більш виразні блоки кроків/питань */
.fd-q-step-head {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.fd-q-step-main {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.fd-q-step-title-wrap {
    min-width: 320px;
    flex: 1;
}

.fd-q-step-order-wrap {
    width: 110px;
}

.fd-q-fields-block {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--fd-border);
    border-radius: 12px;
    background: var(--fd-surface-muted);
}

.fd-q-fields-table {
    margin-top: 10px;
    border-color: #dfe5f0;
}

.fd-q-field-required-row {
    display: flex;
    justify-content: center;
    width: 100%;
}

.fd-q-step-panel + .fd-q-step-panel {
    margin-top: 32px;
}

.fd-q-field-edit-cell {
    padding: 14px 12px 26px;
    vertical-align: top;
    background: var(--fd-surface, #fff);
    border-top: 1px solid var(--fd-border);
}

.fd-q-field-edit-cell .fd-form-grid {
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.fd-q-field-actions-col {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.fd-q-field-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}

.fd-q-field-actions__form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.fd-q-field-drag-col {
    width: 42px;
    vertical-align: middle;
    text-align: center;
}

.fd-q-drag-handle {
    cursor: grab;
    user-select: none;
    display: inline-block;
    padding: 4px 6px;
    color: var(--fd-muted, #7a8199);
    letter-spacing: -2px;
    line-height: 1;
}

.fd-q-drag-handle:active {
    cursor: grabbing;
}

tbody.js-q-field-group.is-dragging {
    opacity: 0.65;
}

.fd-review-actions {
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
}

.fd-row.fd-review-actions {
    flex-wrap: nowrap;
}

.fd-review-col-view { width: 1%; min-width: 52px; }
.fd-review-col-candidate { width: 16%; min-width: 190px; }
.fd-review-col-vacancy { width: 16%; min-width: 170px; }
.fd-review-col-questionnaire { width: 13%; min-width: 130px; }
.fd-review-col-filled { width: 13%; min-width: 120px; }
.fd-review-col-notes { width: 17%; min-width: 140px; }
.fd-review-col-date { width: 9%; min-width: 95px; }
.fd-review-col-actions { width: 1%; min-width: 118px; }

.fd-table td.fd-review-col-view,
.fd-table td.fd-review-col-candidate,
.fd-table td.fd-review-col-vacancy,
.fd-table td.fd-review-col-questionnaire,
.fd-table td.fd-review-col-filled,
.fd-table td.fd-review-col-notes,
.fd-table td.fd-review-col-date,
.fd-table td.fd-review-col-actions {
    vertical-align: middle;
}

.fd-table td.fd-review-col-view {
    white-space: nowrap;
    text-align: center;
}

.fd-review-date-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.25;
}

.fd-review-actions .fd-btn,
.fd-review-actions form .fd-btn {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
}

.fd-review-fill-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* Tom Select: пошук у селектах форми відгуку */
.fd-review-form-selects .ts-wrapper {
    width: 100%;
}

.fd-review-form-selects .ts-wrapper.single .ts-control {
    min-height: 42px;
    padding: 9px 36px 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--fd-border);
    background: #fff;
    color: var(--fd-text);
    font-size: 14px;
    line-height: 1.35;
    align-items: center;
    box-shadow: none;
}

.fd-review-form-selects .ts-wrapper.single .ts-control::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--fd-text-soft);
    margin-top: -3px;
    pointer-events: none;
    transition: transform 0.15s ease, margin-top 0.15s ease;
}

.fd-review-form-selects .ts-wrapper.single.dropdown-active .ts-control::after {
    transform: rotate(180deg);
    margin-top: -5px;
}

.fd-review-form-selects .ts-wrapper.single .ts-control > input {
    font-size: 14px;
    min-width: 0 !important;
    color: var(--fd-text) !important;
    caret-color: var(--fd-text);
    opacity: 1 !important;
}

.fd-review-form-selects .ts-wrapper.single .ts-control > input::placeholder {
    color: var(--fd-text-soft);
    opacity: 1;
}

/* Порожній вибір: не показувати як рядок у списку і не дублювати з placeholder у полі */
.fd-review-form-selects .ts-dropdown .option[data-value=""] {
    display: none !important;
}

.fd-review-form-selects .ts-wrapper.single .ts-control > .item[data-value=""] {
    display: none !important;
}

.fd-review-form-selects .ts-wrapper.focus .ts-control {
    outline: none;
    border-color: #8a74e8;
    box-shadow: 0 0 0 3px rgba(138, 116, 232, 0.16);
}

.ts-dropdown {
    z-index: 250;
    border-radius: 10px;
    border: 1px solid var(--fd-border);
    margin-top: 6px;
    box-shadow: var(--fd-shadow);
    background: var(--fd-surface);
    color: var(--fd-text);
}

.ts-dropdown .ts-dropdown-content {
    max-height: 280px;
}

.ts-dropdown .option {
    padding: 8px 11px;
    font-size: 14px;
}

.ts-dropdown .active {
    background: var(--fd-primary-soft);
    color: var(--fd-text);
}

.ts-dropdown .highlight {
    background: rgba(109, 89, 200, 0.22);
    border-radius: 3px;
}

html.theme-dark .fd-review-form-selects .ts-wrapper.single .ts-control {
    background: #1b2a40;
    border-color: #2c4060;
    color: #dce6f6;
}

html.theme-dark .fd-review-form-selects .ts-wrapper.single .ts-control::after {
    border-top-color: #9bb0cf;
}

html.theme-dark .fd-review-form-selects .ts-wrapper.focus .ts-control {
    border-color: #9f8dff;
    box-shadow: 0 0 0 3px rgba(159, 141, 255, 0.2);
}

html.theme-dark .fd-review-form-selects .ts-wrapper.single .ts-control > input {
    color: #dce6f6 !important;
    caret-color: #dce6f6;
}

html.theme-dark .fd-review-form-selects .ts-wrapper.single .ts-control > input::placeholder {
    color: #9bb0cf;
}

html.theme-dark .ts-dropdown {
    background: #1b2a40;
    border-color: var(--fd-border);
    color: #dce6f6;
}

html.theme-dark .ts-dropdown .active {
    background: #2a2550;
    color: #dce6f6;
}

html.theme-dark .ts-dropdown .option {
    color: #dce6f6;
}

html.theme-dark .ts-dropdown .optgroup-header {
    background: #1b2a40;
    color: #9bb0cf;
}

.fd-readonly-value {
    border: 1px solid var(--fd-border);
    border-radius: 10px;
    padding: 9px 11px;
    background: var(--fd-surface-muted);
    color: var(--fd-text);
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 42px;
}

.fd-fill-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
    justify-content: center;
}

.fd-fill-stepper-item {
    border: 1px solid var(--fd-border);
    border-radius: 12px;
    background: var(--fd-surface);
    color: var(--fd-text);
    min-height: 42px;
    padding: 7px 11px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.fd-fill-stepper-item:hover {
    border-color: #d6dcef;
}

.fd-fill-stepper-item__num {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: var(--fd-primary-soft);
    color: var(--fd-primary);
    flex-shrink: 0;
}

.fd-fill-stepper-item__title {
    font-size: 13px;
    font-weight: 600;
}

.fd-fill-stepper-item.is-active {
    border-color: #9f8dff;
    background: var(--fd-primary-soft);
}

.fd-fill-stepper-item.is-completed .fd-fill-stepper-item__num {
    background: #ddf7e7;
    color: #247548;
}

.fd-fill-step-nav {
    width: 100%;
    align-items: center;
}

.fd-fill-step-nav .js-fill-prev-step {
    margin-right: auto;
}

.fd-fill-step-nav .js-fill-next-step,
.fd-fill-step-nav button[type="submit"] {
    margin-left: auto;
}

.fd-select-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.fd-select-options-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fd-select-options-row .fd-input {
    flex: 1;
    min-width: 0;
}

.fd-select-options-row .js-select-option-remove {
    flex-shrink: 0;
    min-width: 38px;
    padding-left: 10px;
    padding-right: 10px;
}

.fd-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.fd-hero h1 {
    margin: 0;
    font-size: 44px;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.fd-hero .accent {
    color: var(--fd-primary);
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 5px;
}

.fd-btn {
    border: 1px solid var(--fd-border);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    color: #4d5671;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.36s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.36s cubic-bezier(0.22, 1, 0.36, 1), filter 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.fd-btn.primary {
    background: linear-gradient(135deg, #7e6adb 0%, #6955c2 100%);
    border-color: #6e5ac8;
    color: #fff;
    box-shadow: 0 10px 20px rgba(109, 89, 200, 0.24);
}

.fd-btn:hover {
    transform: translateY(-1px) scale(1.01);
    border-color: #d6dcef;
    box-shadow: 0 8px 18px rgba(36, 47, 75, 0.12);
}

.fd-btn.primary:hover {
    filter: brightness(1.03);
    box-shadow: 0 12px 24px rgba(109, 89, 200, 0.32);
}

.fd-btn:active {
    transform: translateY(0);
}

.fd-btn.fd-btn--icon {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
}

.fd-btn.fd-btn--icon svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fd-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.fd-card {
    border-radius: 14px;
    border: 1px solid var(--fd-border);
    padding: 14px;
    background: var(--fd-surface);
}

.fd-card.soft-purple { background: #f7f3ff; }
.fd-card.soft-sand { background: #fbf8f0; }
.fd-card.soft-blue { background: #eff7fb; }
.fd-card.soft-green { background: #f0fbf5; }

.fd-card-title {
    font-size: 12px;
    color: var(--fd-text-soft);
}

.fd-card-value {
    margin-top: 8px;
    font-size: 34px;
    font-weight: 700;
}

.fd-card-foot {
    margin-top: 16px;
    font-size: 12px;
    color: #7c6abf;
}

.fd-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.fd-panel {
    border: 1px solid var(--fd-border);
    border-radius: 14px;
    padding: 14px;
    background: var(--fd-surface);
}

.fd-panel.fd-panel--form-full {
    max-width: none;
    width: 100%;
}

.fd-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.fd-mini-title {
    font-size: 12px;
    color: var(--fd-text-soft);
}

.fd-mini-value {
    margin-top: 5px;
    font-size: 22px;
    font-weight: 700;
}

.fd-chart {
    height: 160px;
    border-radius: 12px;
    border: 1px solid var(--fd-border);
    background:
        linear-gradient(to top, rgba(109, 89, 200, 0.15) 0 46%, transparent 46% 100%),
        repeating-linear-gradient(to right, transparent 0 52px, rgba(180, 192, 214, 0.25) 52px 53px);
}

.fd-progress {
    height: 8px;
    background: #e7ebf4;
    border-radius: 999px;
    overflow: hidden;
}

.fd-progress > span {
    display: block;
    height: 100%;
    width: 62%;
    background: linear-gradient(90deg, #6d59c8 0 45%, #8bd56f 45% 77%, #80c3e9 77% 100%);
}

.fd-ui-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.fd-section-title {
    margin: 0 0 10px;
    font-size: 16px;
}

.fd-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fd-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.fd-badge.success { background: #ddf7e7; color: #247548; }
.fd-badge.warning { background: #fff3d7; color: #8a6605; }
.fd-badge.danger { background: #ffe2e2; color: #a43a3a; }
.fd-badge.info { background: #e2f1ff; color: #2d6fa7; }
.fd-badge.neutral { background: #e8ecf4; color: #4a5568; }

.fd-alert {
    border-radius: 12px;
    border: 1px solid var(--fd-border);
    padding: 10px 12px;
    font-size: 13px;
}

.fd-alert.info { background: #f0f8ff; }
.fd-alert.success { background: #eefbf3; }
.fd-alert.warning { background: #fff8e9; }
.fd-alert.danger { background: #fff0f0; }

.fd-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.fd-tab {
    border: 1px solid var(--fd-border);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    color: #72819a;
    background: #fff;
}

.fd-tab.active {
    background: var(--fd-primary);
    color: #fff;
    border-color: var(--fd-primary);
}

/* Секції довгих форм (анкета кандидата тощо) */
.fd-form-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fd-form-section {
    margin: 0;
    padding: 16px 18px 18px;
    border: 1px solid var(--fd-border);
    border-radius: 14px;
    background: var(--fd-surface-muted);
}

.fd-form-section-title {
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--fd-border);
    font-size: 15px;
    font-weight: 700;
    color: var(--fd-text);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.fd-form-section .fd-form-grid {
    gap: 12px;
}

.fd-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.fd-form-grid .full {
    grid-column: 1 / -1;
}

.fd-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--fd-text-soft);
}

.fd-input,
.fd-select,
.fd-textarea {
    width: 100%;
    border: 1px solid var(--fd-border);
    border-radius: 10px;
    padding: 9px 11px;
    background: #fff;
    color: var(--fd-text);
    font-size: 14px;
}

.fd-textarea {
    min-height: 86px;
    resize: vertical;
}

/* Чекбокси в стилі інтерфейсу (primary, заокруглення як у полів) */
.fd-checkbox {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 100%;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--fd-text);
}

.fd-checkbox > span {
    flex: 1;
    min-width: 0;
}

.fd-checkbox.fd-checkbox--centered {
    align-items: center;
}

.fd-checkbox.fd-checkbox--centered input[type="checkbox"] {
    margin-top: 0;
}

.fd-relocation-ready-row {
    padding-top: 14px;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fd-relocation-ready-row .fd-checkbox {
    font-size: 14px;
}

.fd-form-cell--checkbox {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fd-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex-shrink: 0;
    border: 2px solid #cfd6e6;
    border-radius: 6px;
    background: var(--fd-surface);
    box-shadow: inset 0 1px 2px rgba(30, 40, 70, 0.05);
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.fd-checkbox input[type="checkbox"]:hover {
    border-color: #b8c4dc;
}

.fd-checkbox input[type="checkbox"]:checked {
    background-color: var(--fd-primary);
    border-color: var(--fd-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5l3 3 6-7' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 11px 11px;
    box-shadow: none;
}

.fd-checkbox input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(109, 89, 200, 0.28);
}

.fd-checkbox input[type="checkbox"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Поруч із компактними блоками медіа лишаємо той самий вигляд, що й у інших fd-checkbox */
.fd-checkbox.fd-form-photo-compact__remove {
    gap: 10px;
    font-size: 13px;
    align-items: flex-start;
}

.fd-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--fd-border);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
}

.fd-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6d59c8, #5cbad4);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.fd-table-wrap {
    border: 1px solid var(--fd-border);
    border-radius: 14px;
    overflow: hidden;
}

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

.fd-table th,
.fd-table td {
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid var(--fd-border);
}

.fd-table th {
    background: var(--fd-surface-muted);
    color: #7f8ca4;
    font-weight: 600;
}

.fd-table tr:last-child td {
    border-bottom: none;
}

.fd-table .fd-table-cell-clip {
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Фото + резюме: відцентровані картки, порожній / з файлом */
.fd-form-media-row {
    width: 100%;
}

.fd-form-media-row__wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 26px;
    align-items: stretch;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
}

@media (max-width: 700px) {
    .fd-form-media-row__wrap {
        grid-template-columns: 1fr;
        max-width: 420px;
    }
}

.fd-form-media-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    min-height: 280px;
    padding: 22px 18px 24px;
    border: 1px solid var(--fd-border);
    border-radius: 16px;
    background: linear-gradient(168deg, var(--fd-surface-muted) 0%, var(--fd-surface) 48%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        0 2px 12px rgba(30, 40, 70, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fd-form-media-card--has-file {
    border-color: #e2dcf5;
    background: linear-gradient(172deg, var(--fd-primary-soft) 0%, var(--fd-surface) 55%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 8px 32px rgba(109, 89, 200, 0.1);
}

html.theme-dark .fd-form-media-card {
    background: linear-gradient(168deg, #1a2538 0%, rgba(27, 42, 64, 0.55) 100%);
    box-shadow: none;
    border-color: var(--fd-border);
}

html.theme-dark .fd-form-media-card--has-file {
    border-color: #4a4080;
    background: linear-gradient(172deg, #2a2550 0%, rgba(27, 42, 64, 0.6) 58%);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.32);
}

.fd-form-media-card__label {
    width: 100%;
    margin-bottom: 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--fd-text-soft);
}

.fd-form-media-card .fd-field-error {
    width: 100%;
    text-align: left;
}

.fd-form-media-row__photo-stack,
.fd-form-media-row__resume-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    flex: 1;
}

/* Порожній стан — фото */
.fd-form-photo-compact__placeholder--card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 210px;
    min-height: 118px;
    padding: 18px 14px;
    margin: 0 auto;
    border-radius: 14px;
    border: 1.5px dashed #c9d2e3;
    background: rgba(255, 255, 255, 0.65);
}

html.theme-dark .fd-form-photo-compact__placeholder--card {
    border-color: #3d5270;
    background: rgba(15, 24, 38, 0.45);
}

.fd-form-photo-compact__placeholder-icon {
    width: 46px;
    height: 46px;
    opacity: 0.62;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46' fill='none' stroke='%2394a3b8' stroke-width='1.35'%3E%3Crect x='7' y='14' width='32' height='22' rx='3.5'/%3E%3Ccircle cx='23' cy='25' r='5'/%3E%3Cpath d='M15 14v-3a2 2 0 012-2h10a2 2 0 012 2v3'/%3E%3C/svg%3E") center / contain no-repeat;
}

html.theme-dark .fd-form-photo-compact__placeholder-icon {
    opacity: 0.75;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46' fill='none' stroke='%239bb0cf' stroke-width='1.35'%3E%3Crect x='7' y='14' width='32' height='22' rx='3.5'/%3E%3Ccircle cx='23' cy='25' r='5'/%3E%3Cpath d='M15 14v-3a2 2 0 012-2h10a2 2 0 012 2v3'/%3E%3C/svg%3E");
}

.fd-form-photo-compact__placeholder-cap {
    font-size: 12px;
    font-weight: 600;
    color: var(--fd-text-soft);
}

/* Порожній стан — резюме */
.fd-form-resume-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 210px;
    min-height: 118px;
    padding: 18px 14px;
    margin: 0 auto;
    border-radius: 14px;
    border: 1.5px dashed #c9d2e3;
    background: rgba(255, 255, 255, 0.65);
}

html.theme-dark .fd-form-resume-placeholder {
    border-color: #3d5270;
    background: rgba(15, 24, 38, 0.45);
}

.fd-form-resume-placeholder__icon {
    width: 46px;
    height: 46px;
    opacity: 0.62;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46' fill='none' stroke='%2394a3b8' stroke-width='1.35'%3E%3Cpath d='M13 8h12l8 8v22a2.5 2.5 0 01-2.5 2.5H13A2.5 2.5 0 0110.5 38V10.5A2.5 2.5 0 0113 8z'/%3E%3Cpath d='M25 8v10h10'/%3E%3Cpath d='M15 28h16M15 24h11'/%3E%3C/svg%3E") center / contain no-repeat;
}

html.theme-dark .fd-form-resume-placeholder__icon {
    opacity: 0.75;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46' fill='none' stroke='%239bb0cf' stroke-width='1.35'%3E%3Cpath d='M13 8h12l8 8v22a2.5 2.5 0 01-2.5 2.5H13A2.5 2.5 0 0110.5 38V10.5A2.5 2.5 0 0113 8z'/%3E%3Cpath d='M25 8v10h10'/%3E%3Cpath d='M15 28h16M15 24h11'/%3E%3C/svg%3E");
}

.fd-form-resume-placeholder__cap {
    font-size: 12px;
    font-weight: 600;
    color: var(--fd-text-soft);
}

/* Слот вибору файлу */
.fd-form-media-file-slot {
    width: 100%;
    max-width: 300px;
    padding: 12px 14px 14px;
    border-radius: 12px;
    border: 1px dashed #b8c4d8;
    background: rgba(255, 255, 255, 0.82);
    text-align: left;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.fd-form-media-card--has-file .fd-form-media-file-slot {
    border-style: solid;
    border-color: #d8deea;
    background: rgba(255, 255, 255, 0.95);
}

html.theme-dark .fd-form-media-file-slot {
    border-color: #3d5270;
    background: rgba(22, 34, 52, 0.75);
}

html.theme-dark .fd-form-media-card--has-file .fd-form-media-file-slot {
    border-color: #4a5f80;
    background: rgba(26, 38, 58, 0.9);
}

.fd-form-media-file-slot__label {
    display: block;
    margin-bottom: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fd-text-soft);
}

.fd-form-media-file-slot .fd-input--in-media-slot {
    width: 100%;
    max-width: none;
    margin: 0;
}

.fd-form-media-hint {
    margin: 0;
    max-width: 280px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--fd-text-soft);
}

.fd-form-media-remove {
    margin-top: 2px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(215, 98, 98, 0.07);
    border: 1px solid rgba(215, 98, 98, 0.12);
}

html.theme-dark .fd-form-media-remove {
    background: rgba(215, 98, 98, 0.1);
    border-color: rgba(215, 98, 98, 0.2);
}

.fd-form-media-card .fd-resume-tile__meta {
    align-items: flex-start;
}

.fd-resume-tile--in-card {
    margin-top: 0;
    width: 100%;
    max-width: 300px;
    justify-content: flex-start;
    box-shadow: 0 2px 14px rgba(30, 40, 70, 0.07);
}

html.theme-dark .fd-resume-tile--in-card {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

/* Компактний ряд фото (елементи всередині колонки) */
.fd-form-photo-compact__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 12px;
}

.fd-form-photo-compact__thumb {
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: zoom-in;
    border-radius: 10px;
    line-height: 0;
}

.fd-form-photo-compact__thumb:focus-visible {
    outline: 2px solid var(--fd-primary);
    outline-offset: 3px;
}

.fd-form-photo-compact__thumb img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--fd-border);
    display: block;
    pointer-events: none;
}

.fd-form-photo-compact__thumb.fd-form-photo-compact__thumb--in-card img {
    width: 88px;
    height: 88px;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(30, 40, 70, 0.14);
}

.fd-form-photo-compact__thumb.fd-form-photo-compact__thumb--in-card {
    border-radius: 14px;
    box-shadow: 0 0 0 3px rgba(109, 89, 200, 0.14);
}

html.theme-dark .fd-form-photo-compact__thumb.fd-form-photo-compact__thumb--in-card img {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.fd-form-photo-compact__placeholder {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px dashed var(--fd-border);
    background: var(--fd-surface-muted);
}

.fd-form-photo-compact__fields {
    flex: 1;
    min-width: min(200px, 100%);
    max-width: 360px;
}

.fd-input.fd-input--file-compact {
    padding: 5px 8px;
    font-size: 13px;
    min-height: 0;
}

.fd-form-photo-compact__hint {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: var(--fd-text-soft);
}

.fd-form-photo-compact__remove {
    margin: 6px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--fd-text);
    cursor: pointer;
}

html.theme-dark .fd-form-photo-compact__placeholder {
    background: rgba(27, 42, 64, 0.45);
    border-color: var(--fd-border);
}

.fd-form-photo-compact__placeholder.fd-form-photo-compact__placeholder--card {
    width: 100%;
    height: auto;
    min-height: 118px;
    max-width: 210px;
    margin: 0 auto;
}

/* Плитка резюме (іконка розширення + скачати) */
.fd-resume-tile {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 10px 14px;
    border: 1px solid var(--fd-border);
    border-radius: 12px;
    background: var(--fd-surface-muted);
    text-decoration: none;
    color: var(--fd-text);
    max-width: 100%;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.fd-resume-tile:hover {
    border-color: #d0d8e8;
    background: #f0f3fa;
}

.fd-resume-tile__badge {
    flex-shrink: 0;
    min-width: 52px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-align: center;
    color: #fff;
    line-height: 1.2;
}

.fd-resume-tile__badge--pdf {
    background: linear-gradient(145deg, #e74c3c 0%, #c0392b 100%);
}

.fd-resume-tile__badge--doc,
.fd-resume-tile__badge--docx {
    background: linear-gradient(145deg, #2b579a 0%, #1e3d6f 100%);
}

.fd-resume-tile__badge--unknown {
    background: linear-gradient(145deg, #6d59c8 0%, #5548a3 100%);
}

.fd-resume-tile__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.fd-resume-tile__text {
    font-size: 13px;
    font-weight: 600;
    color: var(--fd-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fd-resume-tile__fname {
    font-size: 11px;
    color: var(--fd-text-soft);
    word-break: break-all;
    line-height: 1.35;
}

html.theme-dark .fd-resume-tile {
    background: rgba(27, 42, 64, 0.45);
}

html.theme-dark .fd-resume-tile:hover {
    background: rgba(35, 52, 78, 0.65);
    border-color: #3d5270;
}

/* Мініатюра в таблиці кандидатів + лайтбокс */
.fd-table-photo-trigger {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: zoom-in;
    border-radius: 10px;
    line-height: 0;
    vertical-align: middle;
}

.fd-table-photo-trigger:focus-visible {
    outline: 2px solid var(--fd-primary);
    outline-offset: 2px;
}

.fd-table-photo-trigger img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--fd-border);
    display: block;
    pointer-events: none;
}

.fd-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 20px 24px;
    background: rgba(18, 26, 42, 0.88);
    backdrop-filter: blur(5px);
    cursor: zoom-out;
    box-sizing: border-box;
}

.fd-photo-lightbox[hidden] {
    display: none !important;
}

.fd-photo-lightbox__img {
    max-width: min(960px, 92vw);
    max-height: 86vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    cursor: default;
}

.fd-photo-lightbox__close {
    position: fixed;
    top: 14px;
    right: 18px;
    z-index: 1;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    background: rgba(30, 40, 58, 0.65);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.fd-photo-lightbox__close:hover {
    background: rgba(50, 62, 88, 0.85);
}

html.theme-dark .fd-photo-lightbox {
    background: rgba(0, 0, 0, 0.78);
}

.fd-sublabel {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--fd-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fd-salary-row {
    display: grid;
    grid-template-columns: 1fr 1fr minmax(132px, 168px);
    gap: 12px;
    align-items: end;
}

@media (max-width: 640px) {
    .fd-salary-row {
        grid-template-columns: 1fr;
    }
}

.fd-lang-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

@media (max-width: 640px) {
    .fd-lang-row {
        grid-template-columns: 1fr;
    }

    .fd-lang-row .js-lang-row-remove {
        justify-self: start;
    }
}

/* Посилання в таблицях (Telegram, LinkedIn): колір бренду замість браузерного :visited */
.fd-table a:not(.fd-btn) {
    color: var(--fd-primary);
    text-decoration: none;
    font-weight: 600;
}

.fd-table a:not(.fd-btn):hover {
    color: #5c4bb3;
    text-decoration: underline;
}

.fd-table a:not(.fd-btn):visited,
.fd-table a:not(.fd-btn):active {
    color: var(--fd-primary);
}

.fd-table a:not(.fd-btn):focus-visible {
    outline: 2px solid var(--fd-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.fd-modal-preview {
    border: 1px dashed #d8deea;
    border-radius: 14px;
    padding: 12px;
    background: #fafbff;
}

/* Модальне підтвердження (наприклад, видалення) */
.fd-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(25, 35, 55, 0.48);
    backdrop-filter: blur(4px);
}

.fd-modal-overlay[hidden] {
    display: none !important;
}

.fd-modal-card {
    width: min(440px, 100%);
    background: var(--fd-surface);
    border: 1px solid var(--fd-border);
    border-radius: 18px;
    padding: 22px 24px 20px;
    box-shadow: 0 20px 50px rgba(33, 46, 79, 0.18);
}

.fd-modal-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.fd-modal-card p {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--fd-text-soft);
}

.fd-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

html.theme-dark .fd-modal-overlay {
    background: rgba(0, 0, 0, 0.55);
}

html.theme-dark .fd-modal-card {
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.5);
}

html.theme-dark {
    color-scheme: dark;
    --fd-bg: #0e1624;
    --fd-surface: #152033;
    --fd-surface-muted: #18263b;
    --fd-text: #dce6f6;
    --fd-text-soft: #9bb0cf;
    --fd-border: #273852;
    --fd-primary-soft: #2a2550;
    --fd-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

html.theme-dark .fd-btn:not(.primary),
html.theme-dark .fd-input,
html.theme-dark .fd-select,
html.theme-dark .fd-textarea,
html.theme-dark .fd-tab {
    background: #1b2a40;
    color: #dce6f6;
    border-color: #2c4060;
}

html.theme-dark .fd-checkbox {
    color: var(--fd-text);
}

html.theme-dark .fd-checkbox input[type="checkbox"] {
    background: #1b2a40;
    border-color: #3a4d68;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
}

html.theme-dark .fd-checkbox input[type="checkbox"]:hover {
    border-color: #4a6288;
}

html.theme-dark .fd-checkbox input[type="checkbox"]:checked {
    background-color: #7d6bd4;
    border-color: #9b87e8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5l3 3 6-7' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    box-shadow: none;
}

html.theme-dark .fd-checkbox input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(155, 135, 232, 0.35);
}

html.theme-dark .fd-btn.primary {
    background: linear-gradient(135deg, #7d6bd4 0%, #5f4cb0 100%);
    color: #fff;
    border-color: #4a4080;
}

html.theme-dark .fd-nav-item.active {
    background: #2a2550;
    border-color: #3a3364;
}

/* Для темної теми фон контролюється через зміну змінних теми (theme-dark), окремий градієнт не потрібен. */

html.theme-dark .fd-sidebar-toggle {
    background: var(--fd-primary-soft);
    color: #c4b5f5;
    border-color: #3a3364;
}

html.theme-dark .fd-sidebar-toggle:hover {
    border-color: #4a4480;
}

html.theme-dark .fd-card.soft-purple,
html.theme-dark .fd-card.soft-sand,
html.theme-dark .fd-card.soft-blue,
html.theme-dark .fd-card.soft-green,
html.theme-dark .fd-alert,
html.theme-dark .fd-modal-preview {
    background: #1b2a40;
}

html.theme-dark .fd-form-section {
    background: rgba(27, 42, 64, 0.55);
    border-color: var(--fd-border);
}

html.theme-dark .fd-form-section-title {
    border-bottom-color: var(--fd-border);
}

html.theme-dark .fd-readonly-value {
    background: #1b2a40;
    border-color: #2c4060;
    color: #dce6f6;
}

html.theme-dark .fd-badge.neutral {
    background: #2c3a52;
    color: #c5d0e4;
}

html.theme-dark .fd-fill-stepper-item {
    background: #1b2a40;
    border-color: #2c4060;
    color: #dce6f6;
}

html.theme-dark .fd-fill-stepper-item__num {
    background: #2a2550;
    color: #c4b5f5;
}

html.theme-dark .fd-fill-stepper-item.is-active {
    border-color: #9f8dff;
    background: #2a2550;
}

html.theme-dark .fd-fill-stepper-item.is-completed .fd-fill-stepper-item__num {
    background: #29483b;
    color: #a6ebc1;
}

html.theme-dark .fd-table th {
    background: #1a2940;
    color: #9bb0cf;
}

html.theme-dark .fd-table th,
html.theme-dark .fd-table td {
    border-bottom-color: #1f2937;
}

html.theme-dark .fd-table a:not(.fd-btn),
html.theme-dark .fd-table a:not(.fd-btn):visited,
html.theme-dark .fd-table a:not(.fd-btn):active {
    color: #c4b5f5;
}

html.theme-dark .fd-table a:not(.fd-btn):hover {
    color: #ddd4fb;
    text-decoration: underline;
}

html.theme-dark .fd-table a:not(.fd-btn):focus-visible {
    outline-color: #9b87e8;
}

@media (max-width: 1180px) {
    .fd-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fd-main-grid,
    .fd-ui-grid,
    .fd-stats-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    /* На мобільному «відкритий сайдбар» = лише меню-шторка, не друга колонка сітки */
    body.fd-sidebar-open .fd-shell {
        grid-template-columns: 1fr;
    }

    .fd-shell {
        grid-template-columns: 1fr;
        /* Перший ряд — лише під шапку; решта висоти — контент (не розтягувати сайдбар на півекрана) */
        grid-template-rows: auto minmax(0, 1fr);
        align-content: start;
    }

    .fd-sidebar {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        align-self: start;
        gap: 8px;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--fd-border);
        padding: 8px 12px;
        position: sticky;
        top: 0;
        z-index: 110;
        background: var(--fd-surface);
    }

    /* Лого зліва, ☰ — у правому куті (ряд на всю ширину шапки) */
    .fd-sidebar-top {
        flex-direction: row;
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    /* Шторка на весь екран (insets); у flex-рядку шапки не забирає ширину — лого і ☰ на всю ширину */
    .fd-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        top: 56px;
        bottom: auto;
        height: calc(100dvh - 56px);
        min-height: calc(100dvh - 56px);
        z-index: 100;
        flex: 0 0 0;
        min-width: 0;
        align-self: flex-start;
        max-width: none;
        box-sizing: border-box;
        flex-direction: column;
        gap: 6px;
        padding: 14px 12px 12px;
        margin: 0;
        background: var(--fd-surface);
        border-right: none;
        box-shadow: 0 12px 40px rgba(30, 40, 70, 0.12);
        border-radius: 18px;
        overflow: hidden;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.28s ease, visibility 0.28s ease;
    }

    body.fd-sidebar-open .fd-nav {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .fd-nav .fd-nav-label {
        display: inline;
    }

    .fd-nav-item,
    .fd-nav-bottom .fd-nav-item-button {
        justify-content: flex-start;
        padding: 0 12px;
        min-height: 46px;
    }

    .fd-nav-bottom {
        margin-top: auto;
        padding-top: 12px;
        border-top: 1px solid var(--fd-border);
        background: inherit;
    }

    body.fd-mobile-menu-open {
        overflow: hidden;
        touch-action: none;
    }

    .fd-nav-overlay {
        position: fixed;
        inset: 0;
        z-index: 99;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        background: rgba(14, 22, 36, 0.48);
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
    }

    .fd-nav-overlay[hidden] {
        display: none !important;
    }

    .fd-content {
        padding: 12px 12px 18px;
        min-width: 0;
        min-height: 0;
    }

    .fd-board {
        padding: 14px 14px 18px;
        border-radius: 14px;
        min-width: 0;
    }

    .fd-board.fd-board--wide {
        width: 100%;
        max-width: none;
    }

    .fd-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .fd-topbar h2 {
        font-size: 16px;
        line-height: 1.35;
        word-break: break-word;
    }

    .fd-topbar-right {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .fd-company-switch-form,
    .fd-company-create-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .fd-company-switch-select {
        min-width: 0;
        max-width: none;
        width: 100%;
        flex: 1 1 100%;
    }

    .fd-company-create-input {
        width: 100%;
        flex: 1 1 auto;
        min-width: 0;
    }

    .fd-company-create-form .fd-btn {
        width: 100%;
        justify-content: center;
    }

    .fd-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .fd-table-wrap .fd-table {
        min-width: 720px;
    }

    .fd-board .fd-alert.warning {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .fd-board .fd-alert.warning form {
        align-self: stretch;
    }

    .fd-board .fd-alert.warning .fd-btn {
        width: 100%;
        justify-content: center;
    }

    .fd-hero h1 {
        font-size: 34px;
    }

    .fd-kpi-grid,
    .fd-form-grid {
        grid-template-columns: 1fr;
    }

    .fd-fill-stepper {
        gap: 6px;
    }

    .fd-fill-stepper-item {
        width: 100%;
        justify-content: flex-start;
    }

    .fd-q-field-edit-cell .fd-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 861px) {
    .fd-nav-overlay {
        display: none !important;
    }
}

html.theme-dark .fd-nav-overlay {
    background: rgba(0, 0, 0, 0.55);
}

html.theme-dark body.fd-sidebar-open .fd-nav {
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.fd-auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--fd-bg);
    position: relative;
    overflow: hidden;
}

.fd-auth-shell::before,
.fd-auth-shell::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.fd-auth-shell::before {
    top: -120px;
    left: -120px;
    background: radial-gradient(circle, rgba(109, 89, 200, 0.18) 0%, rgba(109, 89, 200, 0) 72%);
}

.fd-auth-shell::after {
    right: -130px;
    bottom: -130px;
    background: radial-gradient(circle, rgba(102, 167, 222, 0.2) 0%, rgba(102, 167, 222, 0) 74%);
}

.fd-auth-card {
    width: min(620px, 100%);
    background: var(--fd-surface);
    border: 1px solid var(--fd-border);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(33, 46, 79, 0.12);
    padding: 24px;
    animation: fd-auth-card-in 680ms cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    z-index: 1;
}

.fd-auth-card.fd-auth-card--login {
    width: min(560px, 100%);
}

.fd-auth-card--centered {
    text-align: center;
}

.fd-auth-header {
    margin-bottom: 14px;
}

.fd-auth-header h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.fd-auth-header p {
    margin: 6px 0 0;
    color: var(--fd-text-soft);
    font-size: 15px;
}

.fd-auth-logo-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.fd-auth-logo-wrap img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.fd-auth-toggle-row {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 14px;
    padding: 4px;
    background: #f5f7fc;
    border: 1px solid #e2e8f4;
    border-radius: 14px;
}

.fd-auth-toggle-row-wrap {
    display: flex;
    justify-content: center;
}

.fd-auth-panels {
    position: relative;
    overflow: hidden;
    transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.fd-auth-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(10px) scale(0.995);
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.fd-auth-panel.is-visible {
    position: relative;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fd-auth-panel .fd-section-title {
    margin-bottom: 12px;
    font-size: 18px;
    letter-spacing: -0.01em;
    text-align: center;
}

.fd-auth-panel .fd-panel {
    border-radius: 16px;
}

.fd-auth-panel .fd-form-grid {
    gap: 12px;
}

.fd-auth-panel .fd-label {
    font-size: 13px;
    font-weight: 500;
}

.fd-auth-panel .fd-input {
    height: 46px;
    border-radius: 12px;
    border-color: #d9e1ef;
    background: #fcfdff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.fd-auth-panel .fd-input:focus {
    border-color: #8a74e8;
    box-shadow: 0 0 0 3px rgba(138, 116, 232, 0.16);
    outline: none;
    background: #fff;
}

.fd-auth-card .fd-btn {
    min-height: 40px;
}

.fd-auth-card .fd-btn.primary {
    background: linear-gradient(135deg, #8873e8 0%, #6d59c8 100%);
}

.fd-auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.fd-auth-grid .full {
    grid-column: 1 / -1;
}

.fd-auth-card--centered .fd-auth-grid,
.fd-auth-card--centered .fd-form-grid {
    max-width: 520px;
    margin: 0 auto;
}

.fd-auth-card--centered .fd-label {
    text-align: left;
}

.fd-auth-card--centered .fd-input {
    text-align: left;
}

.fd-auth-card--centered .fd-row {
    justify-content: center;
}

.fd-field-error {
    color: #bf3c3c;
    font-size: 12px;
    margin-top: 5px;
}

.fd-form-error-box {
    border: 1px solid #f0c0c0;
    background: #fff1f1;
    color: #9e3636;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.fd-form-success-box {
    border: 1px solid #b8e5c8;
    background: #eefdF4;
    color: #2d7b49;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

html.theme-dark .fd-form-error-box {
    background: #3a2424;
    border-color: #5a3636;
    color: #f0b1b1;
}

html.theme-dark .fd-form-success-box {
    background: #203429;
    border-color: #30543f;
    color: #9ad7af;
}

html.theme-dark .fd-auth-toggle-row {
    background: #1b2a40;
    border-color: #2c4060;
}

html.theme-dark .fd-auth-panel .fd-input {
    background: #1f3049;
    border-color: #324a6c;
}

html.theme-dark .fd-auth-panel .fd-input:focus {
    border-color: #9f8dff;
    box-shadow: 0 0 0 3px rgba(159, 141, 255, 0.2);
}

html.theme-dark .fd-auth-card {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    border-color: var(--fd-border);
}

html.theme-dark .fd-auth-shell::before {
    background: radial-gradient(circle, rgba(109, 89, 200, 0.12) 0%, rgba(109, 89, 200, 0) 72%);
}

html.theme-dark .fd-auth-shell::after {
    background: radial-gradient(circle, rgba(102, 167, 222, 0.1) 0%, rgba(102, 167, 222, 0) 74%);
}

html.theme-dark .fd-auth-header h1 {
    color: var(--fd-text);
}

html.theme-dark .fd-field-error {
    color: #f0a8a8;
}

html.theme-dark .fd-auth-card .fd-btn.primary {
    box-shadow: 0 4px 14px rgba(109, 89, 200, 0.35);
}

@media (max-width: 860px) {
    .fd-auth-card {
        width: min(540px, 100%);
        padding: 18px 16px;
        border-radius: 18px;
    }

    .fd-auth-grid {
        grid-template-columns: 1fr;
    }

    .fd-auth-shell {
        padding: 14px 12px;
        align-items: center;
        justify-content: center;
    }
}

/* Автодоповнення локації (форма кандидата) */
.fd-np-location {
    position: relative;
}

.fd-np-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 6px;
    max-height: 280px;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 40;
    padding: 6px;
    background: var(--fd-surface);
    border: 1px solid var(--fd-border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(30, 40, 70, 0.14);
}

.fd-np-suggestion-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    color: var(--fd-text);
    cursor: pointer;
    border: none;
    border-radius: 10px;
    background: transparent;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.fd-np-suggestion-item:hover {
    background: var(--fd-primary-soft);
}

.fd-np-suggestion-item:focus {
    outline: none;
}

.fd-np-suggestion-item:focus-visible {
    background: var(--fd-primary-soft);
    box-shadow: inset 0 0 0 2px rgba(109, 89, 200, 0.35);
}

.fd-np-suggestion-item + .fd-np-suggestion-item {
    margin-top: 2px;
}

html.theme-dark .fd-np-suggestions {
    background: var(--fd-surface);
    border-color: var(--fd-border);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

html.theme-dark .fd-np-suggestion-item:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(196, 181, 245, 0.45);
}

@keyframes fd-auth-card-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
