:root {
    color-scheme: light;
    font-family: Arial, Helvetica, sans-serif;
    color: #172033;
    background: #eef1f5;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 760px;
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
}

.active-employer {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 8px 16px;
    color: #fff;
    background: #173f73;
    font-size: 0.9rem;
}

.active-employer a { color: #fff; font-weight: 700; }
.site-page, body:has(.operation-shell), body:has(.menu-shell) { padding-top: 34px; }

select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #9aa6b6;
    border-radius: 4px;
    font: inherit;
}

.login-shell {
    width: min(920px, calc(100% - 32px));
}

.login-layout { display: grid; grid-template-columns: minmax(0, 430px) minmax(16rem, 1fr); gap: 24px; align-items: start; }
.login-news { padding: 26px; border: 1px solid #d3d9e2; border-radius: 8px; background: #fff; box-shadow: 0 12px 32px rgba(23, 32, 51, 0.08); }
.login-news h2 { margin: 0 0 18px; color: #173f73; font-size: 1.25rem; }
.login-news article { padding-top: 14px; border-top: 1px solid #dfe4eb; }
.login-news time { color: #526075; font-size: 0.85rem; }
.login-news h3 { margin: 6px 0 0; font-size: 1rem; line-height: 1.4; }
.login-news a { color: #173f73; }
.news-deadline { padding: 16px 18px; border-left: 4px solid #245b9e; background: #eaf2fb; color: #173f73; font-weight: 700; }

@media (max-width: 760px) {
    body.login-page { min-width: 0; display: block; padding: 24px 0; }
    .login-layout { grid-template-columns: 1fr; }
    .login-news { grid-row: 2; }
}

.brand {
    margin: 0 0 18px;
    color: #173f73;
    font-size: 2rem;
    letter-spacing: 0.06em;
    text-align: center;
}

.login-panel {
    padding: 34px 38px 38px;
    border: 1px solid #d3d9e2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(23, 32, 51, 0.12);
}

.login-panel h1 {
    margin: 0 0 8px;
    font-size: 1.45rem;
}

.intro {
    margin: 0 0 26px;
    color: #526075;
}

.login-help {
    margin: 24px 0 0;
    color: #526075;
    font-size: 0.9rem;
    line-height: 1.45;
}

.guide-page {
    min-width: 0;
    display: block;
}

.guide-shell {
    width: min(900px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 64px;
}

.guide-content,
.guide-toc {
    padding: 28px 34px;
    border: 1px solid #d3d9e2;
    border-radius: 8px;
    background: #fff;
}

.guide-toc {
    margin-bottom: 24px;
}

.guide-toc ul {
    columns: 2;
    margin: 0;
    padding-left: 20px;
}

.guide-content section + section {
    margin-top: 38px;
    padding-top: 10px;
    border-top: 1px solid #dfe4eb;
}

.guide-content h2 {
    color: #173f73;
}

.guide-content p,
.guide-content li {
    line-height: 1.55;
}

.guide-warning {
    padding: 14px 16px;
    border-left: 4px solid #b67a00;
    background: #fff7df;
}

.screenshot-placeholder {
    margin: 22px 0;
    padding: 30px 22px;
    border: 2px dashed #9aa6b6;
    border-radius: 6px;
    color: #526075;
    background: #f6f8fa;
    text-align: center;
}

.guide-back {
    display: inline-block;
    color: #173f73;
    font-weight: 700;
}

@media (max-width: 640px) {
    .guide-toc ul { columns: 1; }
    .guide-content, .guide-toc { padding: 22px; }
}

label {
    display: block;
    margin: 18px 0 7px;
    font-weight: 700;
}

input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #9aa6b6;
    border-radius: 4px;
    font: inherit;
}

input:focus {
    border-color: #245b9e;
    outline: 3px solid rgba(36, 91, 158, 0.18);
}

button {
    width: 100%;
    margin-top: 26px;
    padding: 12px 18px;
    border: 0;
    border-radius: 4px;
    color: #fff;
    background: #173f73;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover,
button:focus {
    background: #0f315d;
}

.notice {
    margin: 20px 0 0;
    padding: 12px;
    border-left: 4px solid #b67a00;
    background: #fff7df;
}

.menu-shell {
    width: 880px;
    padding: 36px 0;
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.menu-header h1 {
    margin: 4px 0 0;
    font-size: 1.7rem;
}

.brand-left {
    margin: 0;
    text-align: left;
}

.logout-button {
    width: auto;
    margin: 0;
    padding: 10px 18px;
}

.menu-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.menu-group {
    padding: 28px;
    border: 1px solid #d3d9e2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(23, 32, 51, 0.09);
}

.menu-group h2 {
    margin: 0 0 18px;
    color: #173f73;
    font-size: 1.25rem;
}

.menu-group ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu-group li + li {
    margin-top: 10px;
}

.menu-option {
    margin: 0;
    color: #536071;
    background: #edf0f4;
    opacity: 1;
}

.menu-option:disabled {
    cursor: not-allowed;
}

.menu-option-link {
    display: block;
    padding: 12px 18px;
    border-radius: 4px;
    color: #fff;
    background: #173f73;
    text-decoration: none;
    cursor: pointer;
}

.menu-news-date { display: block; margin: 0 0 6px; color: #526075; font-size: 0.85rem; }

.operation-shell {
    width: 760px;
    padding: 36px 0;
}

.operation-shell-wide {
    width: min(1180px, calc(100vw - 48px));
}

.operation-shell nav a {
    color: #173f73;
    font-weight: 700;
}

.operation-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.operation-nav button {
    width: auto;
    margin: 0;
    padding: 9px 14px;
}

.employee-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 22px;
    padding: 28px;
    border: 1px solid #d3d9e2;
    border-radius: 8px;
    background: #fff;
}

.employee-form label {
    margin: 0;
}

.employee-form input,
.employee-form select {
    width: 100%;
    margin-top: 7px;
    padding: 11px 12px;
    border: 1px solid #9aa6b6;
    border-radius: 4px;
    background: #fff;
    font: inherit;
}

.employee-form input[readonly] {
    background: #edf0f4;
}

.monetary-value,
.monetary-input,
.percentage-value,
.percentage-input {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.code-value,
.date-value {
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.text-value {
    text-align: left;
}

.monetary-input {
    min-width: 24ch;
}

.employee-form button {
    grid-column: 1 / -1;
}

.employee-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
}

.employee-details p {
    margin: 0;
}

.ui-dialog {
    max-width: 520px;
    padding: 24px;
    border: 1px solid #9aa6b6;
    border-radius: 8px;
}

.ui-dialog::backdrop {
    background: rgba(23, 32, 51, 0.45);
}

.notice-error {
    border-left-color: #a82828;
    background: #fff0f0;
}

.operation-panel {
    padding: 28px;
    border: 1px solid #d3d9e2;
    border-radius: 8px;
    background: #fff;
    overflow-x: auto;
}

.operation-panel form > label:first-child {
    margin-top: 0;
}

.check-field {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
}

.check-field input {
    width: auto;
}

.action-link {
    display: inline-block;
    margin-top: 18px;
    padding: 10px 18px;
    border-radius: 4px;
    color: #fff;
    background: #173f73;
    font-weight: 700;
    text-decoration: none;
}

.full-field,
.employee-name {
    grid-column: 1 / -1;
}

.secondary-button {
    width: auto;
    background: #526075;
}

.review-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 20px;
}

.review-row .secondary-button,
.review-row .notice {
    margin-top: 0;
}

.review-row .notice {
    flex: 1 1 320px;
}

.ddjj-bottom-actions {
    align-items: stretch;
    width: 100%;
}

.ddjj-bottom-actions .secondary-button,
.ddjj-bottom-actions .primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 0;
    padding: 9px 16px;
}

.ddjj-bottom-actions #review-message {
    flex: 1 1 auto;
    min-width: 180px;
    margin: 0;
    padding: 9px 12px;
}

.ddjj-bottom-actions .primary-action {
    margin-left: auto;
}

.data-table {
    width: max-content;
    min-width: 100%;
    margin-top: 24px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 9px;
    border: 1px solid #d3d9e2;
    text-align: left;
}

.data-table .monetary-value,
.data-table .percentage-value {
    text-align: right;
}

.data-table .code-value,
.data-table .date-value {
    text-align: center;
}

.data-table .action-value {
    text-align: center;
    vertical-align: top;
}

#employee-rows td {
    padding-top: 6px;
    padding-bottom: 6px;
    line-height: 1.35;
    vertical-align: top;
}

.ddjj-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    line-height: 1;
    vertical-align: top;
}

.ddjj-modal .modal-content {
    color: #172033;
}

.ddjj-modal .modal-header,
.ddjj-modal .modal-footer {
    align-items: center;
}

.ddjj-modal .modal-employee-identity {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 24px;
}

.ddjj-modal .modal-employee-identity p {
    margin: 0;
}

.ddjj-modal .employee-form {
    padding: 0;
    border: 0;
}

.ddjj-modal .btn {
    width: auto;
    margin: 0;
    padding: 9px 16px;
}

.ddjj-modal .btn-primary {
    border-color: #173f73;
    background: #173f73;
}

.ddjj-modal .btn-primary:hover,
.ddjj-modal .btn-primary:focus {
    border-color: #0f315d;
    background: #0f315d;
}

.ddjj-modal .modal-action-button {
    width: 130px;
}

.ddjj-modal .btn-close,
.ddjj-modal .btn-close:hover,
.ddjj-modal .btn-close:focus {
    width: 1em;
    margin: 0;
    padding: 0.5em;
    background: transparent var(--bs-btn-close-bg) center/1em auto no-repeat;
}

.report-shell {
    width: 940px;
    padding: 36px 0;
}

.print-document {
    padding: 42px;
    border: 1px solid #c7cdd6;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 32, 51, 0.1);
    overflow-x: auto;
}

.document-header {
    padding-bottom: 20px;
    border-bottom: 2px solid #173f73;
}

.document-header > p,
.document-header h2 {
    margin: 0 0 8px;
    text-align: center;
}

.document-header dl,
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.document-header dl div,
.summary-grid div {
    padding: 12px;
    background: #f1f3f6;
}

dt {
    color: #526075;
    font-size: 0.85rem;
    font-weight: 700;
}

dd {
    margin: 4px 0 0;
    font-weight: 700;
}

.draft-employee {
    margin-top: 28px;
}

.draft-employee h3 {
    margin-bottom: 4px;
}

.document-totals {
    margin-top: 30px;
    padding-top: 16px;
    border-top: 2px solid #173f73;
    text-align: right;
}

.flow-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 20px;
}

.flow-actions a,
.primary-action {
    padding: 11px 16px;
    border-radius: 4px;
    color: #173f73;
    font-weight: 700;
}

.flow-actions .primary-action {
    color: #fff;
    background: #173f73;
    text-decoration: none;
}

.warning-text {
    margin-top: 24px;
    font-weight: 700;
}

.period-form {
    display: flex;
    align-items: end;
    gap: 14px;
}

.period-form label {
    max-width: 220px;
}

.report-summary,
.declaration-text {
    margin-top: 30px;
}

.declaration-text {
    padding-top: 18px;
    border-top: 1px solid #c7cdd6;
    line-height: 1.5;
}

body.site-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.site-page > main {
    margin-top: auto;
    margin-bottom: auto;
}

.site-footer {
    flex: 0 0 auto;
    align-self: stretch;
    padding: 12px 24px 16px;
    color: #526075;
    font-size: 0.85rem;
    font-weight: 400;
    text-align: left;
}

.site-footer a {
    color: inherit;
    font-weight: 400;
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
    color: #173f73;
    text-decoration: underline;
}

.about-panel {
    overflow-x: visible;
}

.about-details {
    margin: 0;
}

.about-details div + div {
    margin-top: 18px;
}

.about-details a {
    color: #173f73;
}

@media print {
    body { display: block; min-width: 0; background: #fff; }
    .report-shell { width: auto; padding: 0; }
    .print-document { padding: 0; border: 0; box-shadow: none; }
    .no-print { display: none; }
    .guide-shell { width: auto; padding: 0; }
    .guide-content, .guide-toc { padding: 0; border: 0; }
    .screenshot-placeholder { break-inside: avoid; }
}

.responsible-shell { max-width: 980px; }
.responsible-form { display: grid; grid-template-columns: 1fr; gap: 24px; }
.responsible-form fieldset, .responsible-summary { padding: 24px; border: 1px solid #d3d9e2; border-radius: 8px; background: #fff; }
.responsible-form legend { color: #173f73; font-size: 1.15rem; font-weight: 700; }
.responsible-form-actions { display: flex; justify-content: flex-end; }
.responsible-review-button { width: 13rem; }
.responsible-shell .modal-close-button { width: auto; margin: 0 0 0 auto; padding: 0.25rem 0.6rem; color: #172033; background: transparent; font-size: 1.6rem; line-height: 1; }
.field-help { margin: 6px 0 0; color: #526075; font-size: .88rem; line-height: 1.4; }
.responsible-shell .modal button, .responsible-form fieldset > button, .employer-table button { width: auto; }
.additional-employer-entry { display: grid; gap: 16px; }
.additional-employer-entry label { margin: 0; }
.additional-employer-entry input { width: 100%; }
.employer-table { min-width: 620px; margin: 16px 0; }
.employer-table th:last-child, .employer-table td:last-child { width: 7rem; text-align: center; }
.employer-table button { margin: 0; padding: 7px 12px; }
.responsible-shell .invalid-feedback { text-align: left; }
.success-notice { border-color: #237a3b; background: #e9f7ed; }

@media (max-width: 640px) {
    .responsible-shell { width: min(100% - 24px, 980px); }
    .responsible-form fieldset { padding: 18px; }
}
