:root {
    --primary: #1f4e8c;
    --primary-dark: #163a69;
    --text: #222;
    --muted: #6b7280;
    --border: #d9dee5;
    --bg: #f5f6f8;
    --white: #fff;
    --green: #2e7d32;
    --yellow: #f9a825;
    --red: #c62828;
    --radius: 6px;
}

body, body * { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', 'Noto Sans Armenian', 'Sylfaen', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: break-word;
}

h1, h2, h3 { margin: 0 0 12px; line-height: 1.3; }
h1 { font-size: 25px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
ul { margin: 0 0 12px; padding-left: 20px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 24px; }
main.container { flex: 1; }

.site-header { background: var(--white); border-bottom: 1px solid var(--border); }
.nav { max-width: 1140px; min-height: 60px; margin: 0 auto; padding: 8px 24px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; }
.nav-logo { font-size: 18px; font-weight: 700; margin-right: 8px; }
.nav-logo:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; flex: 1; }
.nav-link { color: var(--text); padding: 4px 0; border-bottom: 2px solid transparent; font-size: 14px; }
.nav-link:hover { color: var(--primary); text-decoration: none; }
.nav-link.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.nav-user { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.nav form { margin: 0; }
.counter { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: var(--white); font-size: 12px; line-height: 18px; text-align: center; }
.site-footer { background: var(--white); border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; text-align: center; padding: 18px 24px; }

.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-header h1, .page-header h2 { margin: 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.actions form { margin: 0; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.pre-line { white-space: pre-line; }
.mb { margin-bottom: 20px; }

.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card > :last-child { margin-bottom: 0; }
.card-narrow { max-width: 440px; margin: 24px auto; }
.card-link { display: block; color: var(--text); }
.card-link:hover { border-color: var(--primary); text-decoration: none; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 20px; margin-bottom: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 > .card, .grid-3 > .card, .grid-4 > .card { margin-bottom: 0; }
.stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat-label { color: var(--muted); font-size: 14px; }
.intro { padding: 32px 28px; }
.intro p { max-width: 780px; }
.step-number { display: inline-block; width: 32px; height: 32px; margin-bottom: 10px; border-radius: 50%; background: var(--primary); color: var(--white); font-weight: 700; line-height: 32px; text-align: center; }

.btn { display: inline-block; padding: 8px 16px; border: 1px solid transparent; border-radius: var(--radius); font: inherit; font-size: 14px; font-weight: 600; line-height: 1.4; text-align: center; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--white); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--white); border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: var(--white); }
.btn-success { background: var(--green); color: var(--white); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-link { padding: 4px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.btn-link:hover { color: var(--primary); }
.btn:focus-visible, .btn-link:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.form-group { margin-bottom: 16px; min-width: 0; }
label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; margin: 0 6px 0 0; }
.check { display: flex; align-items: center; margin-bottom: 8px; font-weight: 400; }
.radio-row { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-inline { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.form-inline .form-group { flex: 1 1 180px; margin-bottom: 0; }
.form-compact { display: flex; align-items: center; gap: 8px; margin: 0; }
.form-compact select { width: auto; min-width: 130px; padding: 4px 8px; font-size: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; align-items: end; }
.filters .form-actions { margin: 0 0 16px; }
.field-error { margin-top: 4px; color: var(--red); font-size: 13px; }
.hint { margin-top: 4px; color: var(--muted); font-size: 13px; }
fieldset { margin: 0 0 20px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
legend { padding: 0 8px; font-weight: 600; }
.file-input { padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg); }
.file-input input { padding: 0; border: 0; background: none; }
.photo-row { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.photo-row-fields { flex: 1 1 260px; min-width: 0; }

.table-wrap { overflow-x: auto; margin-bottom: 20px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); }
.card .table-wrap { margin-bottom: 0; }
.card .table-wrap.mb { margin-bottom: 20px; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--border); font-size: 13px; text-align: left; white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfc; }
.table tfoot td { background: var(--bg); font-weight: 700; border-bottom: 0; }
.table .btn { white-space: nowrap; }
.table-compact .table { font-size: 13px; }
.table-compact .table th, .table-compact .table td { padding: 8px 6px; }
.table-compact .table th { font-size: 12px; white-space: normal; }
.table-compact .badge { font-size: 12px; white-space: normal; }
.table-compact .tag { font-size: 12px; }
.table-compact .btn { font-size: 12px; }
.table-compact .form-compact { flex-direction: column; align-items: flex-start; gap: 4px; }
.table-compact details { max-width: 180px; }
.table-keys td:first-child { width: 40%; color: var(--muted); }
summary { cursor: pointer; }

.match { display: inline-block; padding: 2px 10px; border: 1px solid; border-radius: 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.match-high { background: #e8f5e9; color: var(--green); border-color: var(--green); }
.match-medium { background: #fff8e1; color: #8a6d00; border-color: var(--yellow); }
.match-low { background: #ffebee; color: var(--red); border-color: var(--red); }
.row-high { border-left: 4px solid var(--green); }
.row-medium { border-left: 4px solid var(--yellow); }
.row-low { border-left: 4px solid var(--red); }
tr.row-high, tr.row-medium, tr.row-low { border-left: 0; }
tr.row-high td:first-child { border-left: 4px solid var(--green); }
tr.row-medium td:first-child { border-left: 4px solid var(--yellow); }
tr.row-low td:first-child { border-left: 4px solid var(--red); }
.progress { min-width: 90px; height: 8px; margin: 6px 0; border-radius: 4px; background: #e5e7eb; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); }
.bar-high { background: var(--green); }
.bar-medium { background: var(--yellow); }
.bar-low { background: var(--red); }
.match-total { font-size: 36px; font-weight: 700; line-height: 1.1; }
.total-high { color: var(--green); }
.total-medium { color: #8a6d00; }
.total-low { color: var(--red); }
.match-head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.legend-high::before, .legend-medium::before, .legend-low::before { content: '●'; margin-right: 6px; }
.legend-high::before { color: var(--green); }
.legend-medium::before { color: var(--yellow); }
.legend-low::before { color: var(--red); }

.badge { display: inline-block; padding: 1px 9px; border-radius: 10px; background: #e5e7eb; color: #374151; font-size: 13px; white-space: nowrap; }
.badge-status-pending { background: #fff8e1; color: #8a6d00; }
.badge-status-viewed { background: #e3edf9; color: var(--primary); }
.badge-status-sent { background: #e3edf9; color: var(--primary); }
.badge-status-accepted, .badge-status-active { background: #e8f5e9; color: var(--green); }
.badge-status-rejected, .badge-status-declined { background: #ffebee; color: var(--red); }
.badge-course { white-space: normal; }
.tag { display: inline-block; margin: 0 4px 4px 0; padding: 1px 8px; border-radius: 4px; background: #eef0f3; color: #374151; font-size: 13px; }

.alert { padding: 12px 16px; margin-bottom: 20px; border: 1px solid; border-radius: var(--radius); }
.alert ul { margin: 0; }
.alert-success { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.alert-error { background: #ffebee; border-color: #ef9a9a; color: #8e1c1c; }
.alert-info { background: #e8f0fa; border-color: #b4cbe8; color: var(--primary-dark); }
.alert-warning { background: #fff8e1; border-color: #ffe082; color: #6d5600; }

.avatar { display: inline-block; flex: none; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; line-height: 32px; }
.avatar-md { width: 64px; height: 64px; font-size: 22px; line-height: 64px; }
.avatar-lg { width: 120px; height: 120px; font-size: 40px; line-height: 120px; }
.avatar-placeholder { background: var(--primary); color: var(--white); font-weight: 600; text-align: center; }
.with-avatar { display: flex; align-items: center; gap: 10px; }

.vacancy-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
.vacancy-head h3 { margin: 0; font-size: 17px; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; color: var(--muted); font-size: 14px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.item:first-of-type { padding-top: 0; }
.item:last-child { padding-bottom: 0; border-bottom: 0; }
.item > :last-child { margin-bottom: 0; }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }

.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.gallery-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.gallery-preview { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 1px solid var(--border); }
.gallery-empty { display: flex; align-items: center; justify-content: center; background: #e9ecf0; color: var(--muted); font-size: 14px; text-align: center; }
.gallery-caption { padding: 12px; font-size: 14px; }
.gallery-caption .actions { margin-top: 10px; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; }
.pagination li > a, .pagination li > span { display: block; min-width: 36px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); text-align: center; }
.pagination li.active > span { background: var(--primary); border-color: var(--primary); color: var(--white); }
.pagination li.disabled > span { color: var(--muted); }
.empty-state { padding: 36px 20px; color: var(--muted); text-align: center; }
.error-page { padding: 60px 20px; text-align: center; }
.error-code { color: var(--primary); font-size: 60px; font-weight: 700; line-height: 1.1; }

@media (max-width: 768px) {
    .container { padding: 16px; }
    .nav { padding: 8px 16px; }
    .nav-logo { font-size: 16px; margin-right: 0; }
    .nav-user { font-size: 13px; }
    .nav-links { gap: 2px 14px; }
    .nav-links { flex-basis: 100%; order: 3; }
    .nav-user { margin-left: auto; }
    .grid-2, .grid-3, .grid-4, .form-row, .filters { grid-template-columns: minmax(0, 1fr); }
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-caption { padding: 8px; }
    .card, .intro { padding: 16px; }
    fieldset { padding: 12px; }
    h1 { font-size: 21px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stats.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stats .stat { padding: 12px; }
    .stats .stat-label { font-size: 13px; overflow-wrap: anywhere; }
}
