/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html.auth-pending body {
    visibility: hidden;
}

body,
h1,
h2,
h3,
p {
    margin: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Variables */
:root {
    --primary-blue: #182050;
    --primary-blue-soft: #edf0f8;
    --primary-green: #388060;
    --primary-green-soft: #eaf4ef;
    --page-bg: #f5f6f8;
    --surface: #ffffff;
    --surface-muted: #fafbfc;
    --text: #202533;
    --text-muted: #6c7382;
    --border: #e2e5ea;
    --danger: #b04444;
    --shadow-sm: 0 2px 10px rgba(24, 32, 80, 0.06);
    --shadow-md: 0 8px 28px rgba(24, 32, 80, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --header-height: 82px;
    --sidebar-width: 248px;
}

/* Layout */
body {
    min-width: 320px;
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--text);
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
    line-height: 1.6;
}

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

.app-body {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    flex: 1;
}

.main-content {
    min-width: 0;
    padding: 30px;
}

.main-content:focus {
    outline: none;
}

/* Header */
.app-header {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 10px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 2;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand__logo {
    width: 118px;
    height: 62px;
    object-fit: contain;
}

.brand__text {
    display: grid;
    line-height: 1.35;
    padding-inline-start: 14px;
    border-inline-start: 1px solid var(--border);
}

.brand__text strong {
    color: var(--primary-blue);
    font-size: 1.05rem;
}

.brand__text small {
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.header__label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-inline-start: 16px;
    border-inline-start: 1px solid var(--border);
}

.header-user__avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--primary-green);
    border-radius: 50%;
    font-size: 0.76rem;
    font-weight: 700;
}

.header-user__identity {
    display: grid;
    line-height: 1.3;
}

.header-user__identity strong {
    color: var(--primary-blue);
    font-size: 0.76rem;
}

.header-user__identity small {
    color: var(--text-muted);
    font-size: 0.58rem;
}

.logout-button {
    min-height: 34px;
    padding: 6px 11px;
    color: var(--danger);
    background: #fff;
    border: 1px solid #e5caca;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.logout-button:hover,
.logout-button:focus-visible {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.logout-button:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--primary-green-soft);
}

/* Navigation */
.sidebar {
    padding: 28px 16px;
    background: var(--primary-blue);
    color: #fff;
}

.navigation__eyebrow {
    margin: 0 14px 12px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
}

.navigation {
    display: grid;
    gap: 5px;
}

.nav-link {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.nav-link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.nav-link.is-active {
    background: var(--primary-green);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.nav-link__icon {
    width: 24px;
    flex: 0 0 24px;
    text-align: center;
    font-size: 1rem;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.page-title {
    color: var(--primary-blue);
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    line-height: 1.35;
}

.page-title-en {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.page-description {
    max-width: 620px;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.section-title {
    color: var(--primary-blue);
    font-size: 1rem;
}

.section-title small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.67rem;
    font-weight: 400;
    letter-spacing: 0.06em;
}

/* Cards */
.panel,
.kpi-card,
.chart-card,
.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.panel {
    padding: 20px;
}

.panel + .panel,
.filters-panel + .panel {
    margin-top: 20px;
}

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

.panel__meta {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.filter-reset {
    min-height: 34px;
    padding: 6px 13px;
    color: var(--primary-green);
    background: var(--primary-green-soft);
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.filter-reset:hover,
.filter-reset:focus-visible {
    background: #dceee5;
    border-color: var(--primary-green);
}

.filter-reset:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Tables */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    scrollbar-color: #b7bdc8 transparent;
}

.data-table {
    width: 100%;
    min-width: 1060px;
    border-collapse: collapse;
    white-space: nowrap;
    background: var(--surface);
    font-size: 0.84rem;
}

.data-table--wide {
    min-width: 2500px;
}

.data-table th,
.data-table td {
    padding: 13px 15px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--surface-muted);
    color: var(--primary-blue);
    font-size: 0.78rem;
    font-weight: 700;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.empty-table-cell {
    height: 145px;
    color: var(--text-muted);
    text-align: center !important;
}

.empty-table-cell span {
    display: block;
    color: var(--primary-blue);
    font-weight: 700;
}

.empty-table-cell small {
    display: block;
    margin-top: 3px;
}

.job-id {
    color: var(--primary-blue);
    font-size: 0.76rem;
    letter-spacing: 0.02em;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.status-badge--open {
    color: #236647;
    background: #e5f3eb;
    border-color: #c8e6d5;
}

.status-badge--recruiting {
    color: #263f80;
    background: #e8ecf8;
    border-color: #d1d8ef;
}

.status-badge--paused {
    color: #7c5b18;
    background: #fff4d9;
    border-color: #f1dfa9;
}

.status-badge--closed {
    color: #59606d;
    background: #eef0f3;
    border-color: #dde0e5;
}

.status-badge--cancelled {
    color: #914141;
    background: #faeaea;
    border-color: #efcdcd;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-action {
    min-height: 30px;
    padding: 4px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.table-action--edit {
    color: var(--primary-blue);
}

.table-action--edit:hover,
.table-action--edit:focus-visible {
    background: var(--primary-blue-soft);
    border-color: #bfc6e0;
}

.table-action--delete {
    color: var(--danger);
}

.table-action--delete:hover,
.table-action--delete:focus-visible {
    background: #fbeeee;
    border-color: #e7bebe;
}

/* Forms */
.filters-panel {
    margin-bottom: 20px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 14px;
}

.field {
    display: grid;
    gap: 6px;
}

.field label {
    color: var(--primary-blue);
    font-size: 0.76rem;
    font-weight: 700;
}

.control,
.search-input {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
}

.control:focus,
.search-input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px var(--primary-green-soft);
}

.control:hover:not(:disabled) {
    border-color: #b8c0cb;
}

.control:disabled {
    background: var(--surface-muted);
    color: var(--text-muted);
    opacity: 1;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) minmax(260px, 2fr);
    gap: 14px;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
}

.search-box::before {
    content: "⌕";
    position: absolute;
    inset-inline-start: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-input {
    padding-inline-start: 38px;
}

.filters-placeholder {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px dashed #c8cdd6;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.filters-placeholder strong {
    color: var(--primary-blue);
}

/* Jobs */
.jobs-page__header {
    align-items: center;
}

.primary-button,
.secondary-button,
.danger-button {
    min-height: 40px;
    padding: 8px 17px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.primary-button {
    color: #fff;
    background: var(--primary-green);
    box-shadow: 0 4px 12px rgba(56, 128, 96, 0.18);
}

.primary-button:hover,
.primary-button:focus-visible {
    background: #2e6e51;
    transform: translateY(-1px);
}

.secondary-button {
    color: var(--primary-blue);
    background: var(--surface);
    border-color: var(--border);
}

.secondary-button:hover,
.secondary-button:focus-visible {
    background: var(--primary-blue-soft);
    border-color: #bec5dd;
}

.danger-button {
    color: #fff;
    background: var(--danger);
}

.danger-button:hover,
.danger-button:focus-visible {
    background: #933737;
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.danger-button:focus-visible,
.table-action:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.job-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.job-summary-card {
    min-height: 116px;
    display: grid;
    align-content: center;
    padding: 17px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary-blue);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.job-summary-card--green {
    border-top-color: var(--primary-green);
}

.job-summary-card--green-soft {
    border-top-color: #69a68a;
}

.job-summary-card--gray {
    border-top-color: #8c929e;
}

.job-summary-card--red {
    border-top-color: var(--danger);
}

.job-summary-card--amber {
    border-top-color: #c58a2a;
}

.job-summary-card__label {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.job-summary-card__value {
    margin-top: 4px;
    color: var(--primary-blue);
    font-size: 1.8rem;
    line-height: 1.25;
}

.job-summary-card small {
    margin-top: 5px;
    color: var(--primary-green);
    font-size: 0.62rem;
    letter-spacing: 0.05em;
}

.jobs-filter-panel {
    margin-bottom: 20px;
}

.jobs-toolbar {
    display: grid;
    grid-template-columns: minmax(250px, 1.7fr) repeat(3, minmax(150px, 1fr));
    gap: 14px;
}

.jobs-table {
    min-width: 1280px;
}

body.modal-open {
    overflow: hidden;
}

.modal-dialog {
    width: min(720px, calc(100% - 32px));
    max-width: 100%;
    max-height: min(86vh, 760px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    color: var(--text);
    background: var(--surface);
    border: 0;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(12, 18, 52, 0.28);
    direction: rtl;
}

.modal-dialog::backdrop {
    background: rgba(17, 23, 54, 0.55);
    backdrop-filter: blur(2px);
}

.modal-form {
    max-height: min(86vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex: 0 0 auto;
    padding: 18px 22px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    color: var(--primary-blue);
    font-size: 1.15rem;
}

.modal-header small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.62rem;
    letter-spacing: 0.07em;
}

.modal-close {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    padding: 0;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus-visible {
    color: var(--danger);
    border-color: #dfbebe;
}

.modal-body {
    padding: 20px 22px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.modal-field--full {
    grid-column: 1 / -1;
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    padding: 15px 22px;
    background: var(--surface-muted);
    border-top: 1px solid var(--border);
}

.form-message {
    min-height: 22px;
    margin-top: 12px;
    color: var(--danger);
    font-size: 0.76rem;
    font-weight: 700;
}

.confirm-dialog {
    width: min(430px, calc(100% - 32px));
}

.confirm-dialog__content {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 28px 24px 22px;
    text-align: center;
}

.confirm-dialog__content p {
    color: var(--text-muted);
}

.confirm-dialog__content > strong {
    color: var(--primary-blue);
    font-size: 0.82rem;
}

.confirm-dialog__mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    margin-bottom: 4px;
    color: var(--danger);
    background: #fbeeee;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-footer--center {
    justify-content: center;
    width: 100%;
    margin-top: 10px;
    padding: 14px 0 0;
    background: transparent;
}

/* Candidates */
.candidates-page__header {
    align-items: center;
}

.candidates-filter-panel {
    margin-bottom: 20px;
}

.candidates-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.candidates-search-field {
    grid-column: span 2;
}

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

.candidate-notes-cell {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cv-link {
    color: var(--primary-green);
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cv-link:hover,
.cv-link:focus-visible {
    color: var(--primary-blue);
}

.candidate-status--new {
    color: #59606d;
    background: #f2f3f5;
    border-color: #e1e3e7;
}

.candidate-status--review {
    color: #4e586c;
    background: #edf0f4;
    border-color: #d9dee6;
}

.candidate-status--contacted {
    color: #795d18;
    background: #fff4d7;
    border-color: #efdea8;
}

.candidate-status--interview {
    color: #263f80;
    background: #e8ecf8;
    border-color: #d0d8f0;
}

.candidate-status--offer {
    color: #8a541c;
    background: #fff0df;
    border-color: #efd3b4;
}

.candidate-status--hired {
    color: #236647;
    background: #e5f3eb;
    border-color: #c8e6d5;
}

.candidate-status--rejected {
    color: #914141;
    background: #faeaea;
    border-color: #efcdcd;
}

.candidate-status--withdrawn {
    color: #666c77;
    background: #eceef1;
    border-color: #dadde2;
}

.candidate-dialog {
    width: min(980px, calc(100% - 32px));
}

.candidate-fields-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.candidate-field--full {
    grid-column: 1 / -1;
}

.candidate-notes {
    min-height: 84px;
    resize: vertical;
}

.control[readonly] {
    color: var(--text-muted);
    background: var(--surface-muted);
    cursor: not-allowed;
}

.control:disabled {
    color: var(--text-muted);
    background: var(--surface-muted);
    cursor: not-allowed;
    opacity: 1;
}

/* HR Interviews */
.hr-interviews-page__header {
    align-items: center;
}

.hr-filter-panel {
    margin-bottom: 20px;
}

.hr-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1.7fr) repeat(3, minmax(150px, 1fr));
    gap: 14px;
}

.hr-interviews-table {
    min-width: 1250px;
}

.hr-notes-cell {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hr-result--passed {
    color: #236647;
    background: #e5f3eb;
    border-color: #c8e6d5;
}

.hr-result--failed {
    color: #914141;
    background: #faeaea;
    border-color: #efcdcd;
}

.hr-result--postponed {
    color: #795d18;
    background: #fff4d7;
    border-color: #efdea8;
}

.hr-result--absent {
    color: #666c77;
    background: #eceef1;
    border-color: #dadde2;
}

.hr-interview-dialog {
    width: min(760px, calc(100% - 32px));
}

.hr-notes {
    min-height: 104px;
    resize: vertical;
}

/* Technical Interviews */
.technical-interviews-page__header {
    align-items: center;
}

.technical-filter-panel {
    margin-bottom: 20px;
}

.technical-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1.7fr) repeat(3, minmax(150px, 1fr));
    gap: 14px;
}

.technical-interviews-table {
    min-width: 1180px;
}

.technical-interview-dialog {
    width: min(760px, calc(100% - 32px));
}

.technical-average {
    direction: ltr;
    text-align: right;
}

.technical-rating {
    min-width: 72px;
    display: inline-grid;
    gap: 5px;
    color: var(--primary-blue);
    font-size: 0.72rem;
}

.technical-rating strong {
    font-size: 0.76rem;
}

.technical-rating__meter {
    width: 68px;
    height: 4px;
    display: block;
    overflow: hidden;
    background: #e4e7ed;
    border-radius: 999px;
}

.technical-rating__fill {
    height: 100%;
    display: block;
    background: var(--primary-green);
    border-radius: inherit;
}

.technical-rating__fill--1 { width: 20%; }
.technical-rating__fill--2 { width: 40%; }
.technical-rating__fill--3 { width: 60%; }
.technical-rating__fill--4 { width: 80%; }
.technical-rating__fill--5 { width: 100%; }

.technical-result--passed {
    color: #236647;
    background: #e5f3eb;
    border-color: #c8e6d5;
}

.technical-result--failed {
    color: #914141;
    background: #faeaea;
    border-color: #efcdcd;
}

.technical-result--postponed {
    color: #795d18;
    background: #fff4d7;
    border-color: #efdea8;
}

.technical-result--absent {
    color: #666c77;
    background: #eceef1;
    border-color: #dadde2;
}

.field-hint {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.66rem;
}

/* Interview Evaluation */
.interview-evaluation-page__header {
    align-items: center;
}

.evaluation-filter-panel {
    margin-bottom: 20px;
}

.evaluation-toolbar {
    display: grid;
    grid-template-columns: minmax(300px, 1.8fr) repeat(2, minmax(180px, 1fr));
    gap: 14px;
}

.interview-evaluation-table {
    min-width: 1850px;
}

.evaluation-average {
    direction: ltr;
    text-align: right;
}

.evaluation-score {
    display: inline-block;
    min-width: 42px;
    color: var(--primary-blue);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.evaluation-recommendation--high {
    color: #175d3d;
    background: #dff2e7;
    border-color: #b9dfc9;
}

.evaluation-recommendation--recommended {
    color: #357158;
    background: #edf6f1;
    border-color: #d3e9dd;
}

.evaluation-recommendation--review {
    color: #795d18;
    background: #fff4d7;
    border-color: #efdea8;
}

.evaluation-recommendation--not-recommended {
    color: #914141;
    background: #faeaea;
    border-color: #efcdcd;
}

.evaluation-dialog {
    width: min(900px, calc(100% - 32px));
}

.evaluation-scores-fieldset {
    min-width: 0;
    margin: 20px 0 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.evaluation-scores-fieldset legend {
    padding-inline: 8px;
    color: var(--primary-blue);
    font-size: 0.82rem;
    font-weight: 700;
}

.evaluation-scores-fieldset legend small {
    margin-inline-start: 6px;
    color: var(--text-muted);
    font-size: 0.58rem;
    letter-spacing: 0.06em;
}

.evaluation-scores-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.evaluation-score-guide {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 14px;
    padding: 11px 14px;
    color: var(--text-muted);
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
}

.evaluation-score-guide strong {
    color: var(--primary-blue);
}

.evaluation-score-guide b {
    color: var(--primary-green);
}

.evaluation-preview {
    margin-top: 16px;
    padding: 16px;
    background: #f8faf9;
    border: 1px solid #dbe8e1;
    border-radius: var(--radius-md);
}

.evaluation-preview h3 {
    margin-bottom: 12px;
    color: var(--primary-blue);
    font-size: 0.84rem;
}

.evaluation-preview h3 small {
    margin-inline-start: 6px;
    color: var(--text-muted);
    font-size: 0.56rem;
    letter-spacing: 0.06em;
}

.evaluation-preview__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.evaluation-preview__grid > div {
    min-width: 0;
    display: grid;
    gap: 5px;
    padding: 11px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.evaluation-preview__grid span {
    color: var(--text-muted);
    font-size: 0.64rem;
}

.evaluation-preview__grid strong {
    color: var(--primary-blue);
    font-size: 0.82rem;
}

.evaluation-preview__recommendation {
    width: fit-content;
    max-width: 100%;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
}

/* Offers */
.offers-page__header {
    align-items: center;
}

.offer-financial-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: -4px 0 20px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.offer-financial-summary > div {
    min-width: 0;
    display: grid;
    gap: 3px;
    padding-inline: 14px;
    border-inline-start: 2px solid #dbe8e1;
}

.offer-financial-summary span {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.offer-financial-summary strong {
    color: var(--primary-blue);
    font-size: 1.05rem;
}

.offer-financial-summary small {
    color: var(--primary-green);
    font-size: 0.54rem;
    letter-spacing: 0.05em;
}

.offers-filter-panel {
    margin-bottom: 20px;
}

.offers-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1.7fr) repeat(3, minmax(150px, 1fr));
    gap: 14px;
}

.offers-table {
    min-width: 2100px;
}

.offer-status--draft,
.offer-status--withdrawn {
    color: #666c77;
    background: #eceef1;
    border-color: #dadde2;
}

.offer-status--sent {
    color: #263f80;
    background: #e8ecf8;
    border-color: #d0d8f0;
}

.offer-status--awaiting {
    color: #795d18;
    background: #fff4d7;
    border-color: #efdea8;
}

.offer-status--accepted {
    color: #357158;
    background: #edf6f1;
    border-color: #d3e9dd;
}

.offer-status--rejected {
    color: #914141;
    background: #faeaea;
    border-color: #efcdcd;
}

.offer-status--cancelled {
    color: #414650;
    background: #e2e4e8;
    border-color: #cdd0d6;
}

.offer-status--joined {
    color: #175d3d;
    background: #dff2e7;
    border-color: #b9dfc9;
}

.offer-dialog {
    width: min(980px, calc(100% - 32px));
}

.offer-fields-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.offer-total-input {
    color: var(--primary-blue) !important;
    font-weight: 700;
}

/* Dashboard */
.dashboard__header {
    align-items: center;
}

.dashboard__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 7px 12px;
    color: var(--primary-green);
    background: var(--primary-green-soft);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.dashboard__status-dot {
    width: 7px;
    height: 7px;
    background: var(--primary-green);
    border-radius: 50%;
}

.dashboard-filters {
    position: relative;
    overflow: hidden;
}

.dashboard-filters::before {
    content: "";
    width: 4px;
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    background: var(--primary-green);
}

.filter-summary {
    min-height: 20px;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.kpi-card {
    min-height: 126px;
    padding: 18px;
    position: relative;
    overflow: hidden;
    border-top: 3px solid rgba(56, 128, 96, 0.7);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-card--blue {
    border-top-color: var(--primary-blue);
}

.kpi-card--green {
    border-top-color: var(--primary-green);
}

.kpi-card::after {
    content: "";
    width: 54px;
    height: 54px;
    position: absolute;
    inset-inline-end: -20px;
    bottom: -20px;
    background: var(--primary-green-soft);
    border-radius: 50%;
}

.kpi-card__label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.kpi-card__value {
    display: block;
    margin-top: 9px;
    color: var(--primary-blue);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.kpi-card__en {
    display: block;
    margin-top: 10px;
    color: var(--primary-green);
    font-size: 0.64rem;
    letter-spacing: 0.05em;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.chart-card {
    min-height: 340px;
    padding: 18px;
    overflow: hidden;
}

.dashboard-chart {
    min-height: 260px;
    margin-top: 14px;
    padding: 14px;
    color: var(--text);
    background: var(--surface-muted);
    border: 1px solid #eef0f3;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.chart-empty {
    min-height: 230px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    color: var(--text-muted);
    text-align: center;
}

.chart-empty__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 5px;
    color: var(--primary-green);
    background: var(--primary-green-soft);
    border-radius: 50%;
    font-size: 1.15rem;
}

.chart-empty strong {
    color: var(--primary-blue);
}

.horizontal-bars {
    min-height: 230px;
    display: grid;
    align-content: center;
    gap: 11px;
}

.h-bar-row {
    display: grid;
    gap: 5px;
}

.h-bar-row__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.h-bar-row__meta strong {
    color: var(--primary-blue);
    font-size: 0.76rem;
}

.h-bar-track {
    height: 9px;
    overflow: hidden;
    background: #e7e9ee;
    border-radius: 999px;
}

.h-bar-fill {
    width: var(--bar-width);
    height: 100%;
    display: block;
    background: var(--bar-color);
    border-radius: inherit;
    transition: width 260ms ease;
}

.horizontal-bars--funnel .h-bar-track {
    height: 12px;
}

.vertical-bars {
    min-height: 230px;
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding-top: 12px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
}

.v-bar-item {
    min-width: 38px;
    display: grid;
    grid-template-rows: 22px minmax(120px, 1fr) 42px;
    flex: 1 0 38px;
    align-items: end;
    justify-items: center;
    gap: 5px;
}

.v-bar-value {
    color: var(--primary-blue);
    font-size: 0.7rem;
    font-weight: 700;
}

.v-bar {
    width: min(28px, 62%);
    height: max(var(--bar-height), 3px);
    align-self: end;
    background: var(--bar-color);
    border-radius: 5px 5px 0 0;
    transition: height 260ms ease;
}

.v-bar-label {
    max-width: 68px;
    align-self: start;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.62rem;
    line-height: 1.25;
    text-align: center;
    text-overflow: ellipsis;
}

.donut-layout {
    min-height: 230px;
    display: grid;
    grid-template-columns: minmax(130px, 0.8fr) minmax(160px, 1.2fr);
    align-items: center;
    gap: 20px;
}

.donut {
    width: 150px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    justify-self: center;
    background: conic-gradient(var(--donut-segments));
    border-radius: 50%;
    position: relative;
}

.donut::after {
    content: "";
    width: 62%;
    aspect-ratio: 1;
    position: absolute;
    background: var(--surface);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px var(--border);
}

.donut > span {
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
    line-height: 1.25;
}

.donut strong {
    color: var(--primary-blue);
    font-size: 1.45rem;
}

.donut small {
    color: var(--text-muted);
    font-size: 0.62rem;
}

.chart-legend {
    max-height: 220px;
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.chart-legend li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.68rem;
}

.chart-legend li strong {
    color: var(--primary-blue);
}

.chart-legend__key {
    width: 9px;
    height: 9px;
    background: var(--legend-color);
    border-radius: 3px;
}

/* Daily Tasks */
.daily-tasks-page__header {
    align-items: center;
}

.daily-current-date {
    min-width: 190px;
    display: grid;
    gap: 3px;
    padding: 11px 15px;
    color: var(--primary-blue);
    background: var(--surface);
    border: 1px solid var(--border);
    border-inline-start: 3px solid var(--primary-green);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.daily-current-date strong {
    font-size: 0.84rem;
}

.daily-current-date span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.daily-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.daily-summary-card {
    min-width: 0;
    min-height: 112px;
    display: grid;
    align-content: center;
    padding: 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary-blue);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.daily-summary-card--blue { border-top-color: #6571a5; }
.daily-summary-card--amber { border-top-color: #c58a2a; }
.daily-summary-card--green { border-top-color: var(--primary-green); }
.daily-summary-card--red { border-top-color: var(--danger); }

.daily-summary-card > span {
    min-height: 34px;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

.daily-summary-card > strong {
    margin-top: 3px;
    color: var(--primary-blue);
    font-size: 1.65rem;
    line-height: 1;
}

.daily-summary-card > small {
    margin-top: 7px;
    overflow: hidden;
    color: var(--primary-green);
    font-size: 0.5rem;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.task-card {
    min-width: 0;
    min-height: 230px;
    padding: 18px;
}

.daily-task-section--wide {
    grid-column: 1 / -1;
}

.daily-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--border);
}

.daily-section-header p {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.68rem;
}

.daily-section-count {
    min-width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--primary-blue);
    background: var(--primary-green-soft);
    border-radius: 50%;
    font-size: 0.76rem;
    font-weight: 700;
}

.daily-task-list {
    display: grid;
    gap: 9px;
    margin-top: 13px;
}

.daily-task-list--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.daily-task-row {
    min-width: 0;
    display: grid;
    gap: 10px;
    padding: 12px;
    background: var(--surface-muted);
    border: 1px solid #e7e9ed;
    border-radius: var(--radius-sm);
}

.daily-task-identity {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 10px;
}

.daily-task-identity strong {
    overflow: hidden;
    color: var(--primary-blue);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.daily-task-identity > span {
    color: var(--primary-green);
    font-size: 0.64rem;
    font-weight: 700;
}

.daily-task-identity small {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 0.66rem;
}

.daily-task-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 12px;
}

.daily-task-meta {
    display: inline-grid;
    gap: 1px;
}

.daily-task-meta small {
    color: var(--text-muted);
    font-size: 0.56rem;
}

.daily-task-meta strong {
    color: var(--text);
    font-size: 0.66rem;
    font-weight: 600;
}

.daily-task-meta--emphasis strong {
    color: #9a611c;
}

.empty-state {
    min-height: 135px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--primary-green);
    background: var(--primary-green-soft);
    border-radius: 50%;
}

.empty-state strong {
    color: var(--primary-blue);
    font-size: 0.84rem;
}

.daily-empty-state {
    min-height: 148px;
    padding: 12px;
}

.daily-empty-state > span:last-child {
    font-size: 0.66rem;
}

/* Loading and Error States */
.loading-state,
.error-state {
    min-height: 55vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: var(--text-muted);
    text-align: center;
}

.loading-state__spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.error-state__icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: var(--danger);
    background: #fbeeee;
    border-radius: 50%;
    font-weight: 700;
}

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

/* Footer */
.app-footer {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 28px;
    color: var(--text-muted);
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
}

/* Responsive */
@media (max-width: 1120px) {
    .filters-grid,
    .kpi-grid,
    .job-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .jobs-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .candidates-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .candidate-fields-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hr-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .technical-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .evaluation-toolbar,
    .evaluation-scores-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .offers-toolbar,
    .offer-financial-summary,
    .offer-fields-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .daily-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 840px) {
    .app-shell,
    .app-body,
    .main-content,
    .dashboard {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .app-body {
        display: block;
    }

    .sidebar {
        width: 100%;
        max-width: 100vw;
        padding: 10px 14px;
        position: sticky;
        top: 0;
        z-index: 3;
        overflow-x: auto;
    }

    .navigation__eyebrow {
        display: none;
    }

    .navigation {
        width: max-content;
        display: flex;
        gap: 6px;
    }

    .nav-link {
        min-height: 40px;
        padding: 8px 12px;
        white-space: nowrap;
    }

    .nav-link__icon {
        display: none;
    }

    .main-content {
        padding: 24px 18px;
        overflow-x: hidden;
    }

    .toolbar {
        grid-template-columns: 1fr;
    }

    .jobs-page__header {
        align-items: flex-start;
    }

    .candidates-page__header {
        align-items: flex-start;
    }

    .hr-interviews-page__header {
        align-items: flex-start;
    }

    .technical-interviews-page__header {
        align-items: flex-start;
    }

    .interview-evaluation-page__header {
        align-items: flex-start;
    }

    .offers-page__header {
        align-items: flex-start;
    }

    .daily-tasks-page__header {
        align-items: flex-start;
    }

    .daily-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .daily-task-list--wide {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .app-header {
        gap: 10px;
        padding: 8px 12px;
    }

    .brand__logo {
        width: 96px;
        height: 52px;
    }

    .brand {
        gap: 10px;
    }

    .brand__text {
        gap: 1px;
        padding-inline-start: 10px;
    }

    .brand__text strong {
        font-size: 0.92rem;
    }

    .header__label {
        display: none;
    }

    .header-actions {
        gap: 8px;
    }

    .header-user {
        padding-inline-start: 0;
        border-inline-start: 0;
    }

    .header-user__avatar,
    .header-user__identity {
        display: none;
    }

    .logout-button {
        padding-inline: 9px;
        white-space: nowrap;
    }

    .page-header {
        display: block;
    }

    .dashboard__status {
        margin-top: 12px;
    }

    .filters-grid,
    .kpi-grid,
    .charts-grid,
    .job-summary-grid,
    .jobs-toolbar,
    .candidates-toolbar,
    .hr-toolbar,
    .technical-toolbar,
    .evaluation-toolbar,
    .offers-toolbar,
    .offer-financial-summary,
    .daily-summary-grid,
    .tasks-grid {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .panel,
    .field,
    .kpi-card,
    .chart-card,
    .dashboard-chart {
        min-width: 0;
        max-width: 100%;
    }

    .panel__header {
        flex-wrap: wrap;
    }

    .jobs-page__header .primary-button {
        width: 100%;
        margin-top: 14px;
    }

    .candidates-page__header .primary-button {
        width: 100%;
        margin-top: 14px;
    }

    .hr-interviews-page__header .primary-button {
        width: 100%;
        margin-top: 14px;
    }

    .technical-interviews-page__header .primary-button {
        width: 100%;
        margin-top: 14px;
    }

    .interview-evaluation-page__header .primary-button {
        width: 100%;
        margin-top: 14px;
    }

    .offers-page__header .primary-button {
        width: 100%;
        margin-top: 14px;
    }

    .modal-dialog,
    .confirm-dialog {
        width: calc(100% - 24px);
        max-height: 88vh;
    }

    .modal-form {
        max-height: 88vh;
    }

    .modal-fields-grid {
        grid-template-columns: 1fr;
    }

    .candidate-fields-grid {
        grid-template-columns: 1fr;
    }

    .modal-field--full {
        grid-column: auto;
    }

    .candidate-field--full,
    .candidates-search-field {
        grid-column: auto;
    }

    .evaluation-scores-grid,
    .evaluation-preview__grid,
    .offer-fields-grid {
        grid-template-columns: 1fr;
    }

    .offer-financial-summary > div {
        padding-block: 6px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-inline: 16px;
    }

    .daily-task-section--wide {
        grid-column: auto;
    }

    .daily-current-date {
        width: 100%;
        margin-top: 14px;
    }

    .donut-layout {
        grid-template-columns: 1fr;
    }

    .donut {
        width: 132px;
    }

    .app-footer {
        display: grid;
        justify-content: center;
        padding-inline: 16px;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
