:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --line: #d9dde3;
    --text: #1f2937;
    --muted: #6b7280;
    --menu-bg: #eef1f5;
    --primary: #2056a8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
}

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

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

.sidebar {
    background: var(--menu-bg);
    border-right: 1px solid var(--line);
    padding: 20px 14px;
}

.brand {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.menu {
    display: grid;
    gap: 8px;
}

.menu a {
    color: var(--text);
    text-decoration: none;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.menu a:hover {
    border-color: var(--line);
    background: #fff;
}

.main-shell {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.title {
    margin: 0;
    font-size: 18px;
}

.userbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.messages {
    padding: 12px 20px 0;
}

.message {
    background: #ecf2ff;
    border: 1px solid #b8cbf0;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.message-success {
    background: #edf8ef;
    border-color: #b4d9b8;
}

.message-error {
    background: #fff2f2;
    border-color: #efbcbc;
}

.content {
    padding: 20px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
}

.card + .card {
    margin-top: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
}

th,
td {
    border: 1px solid var(--line);
    padding: 8px 10px;
    vertical-align: top;
}

th {
    background: #eef2f7;
    text-align: left;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    max-width: 520px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.field-row {
    max-width: 680px;
    margin-bottom: 14px;
}

.field-row label {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
}

.field-row input[type="checkbox"] {
    width: auto;
}

.required-marker {
    color: #b91c1c;
    margin-left: 3px;
}

.help-text {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.field-error,
.form-errors {
    color: #991b1b;
    background: #fff2f2;
    border: 1px solid #efbcbc;
    border-radius: 6px;
    padding: 7px 9px;
    margin-top: 6px;
}

.field-row-error input,
.field-row-error select,
.field-row-error textarea {
    border-color: #b91c1c;
}

.status-box {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 10px 0 14px;
}

.status-ok {
    background: #edf8ef;
    border-color: #9fcea5;
    color: #14532d;
}

.status-warning {
    background: #fff8e6;
    border-color: #e8c46c;
    color: #7a4b00;
}

.status-error {
    background: #fff2f2;
    border-color: #efbcbc;
    color: #991b1b;
}

.inline-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.inline-fields label {
    display: grid;
    gap: 5px;
}

button,
.btn {
    display: inline-block;
    text-decoration: none;
    border: 1px solid var(--primary);
    border-radius: 6px;
    color: #fff;
    background: var(--primary);
    padding: 8px 12px;
    cursor: pointer;
}

.btn-secondary {
    border-color: var(--line);
    background: #fff;
    color: var(--text);
}

.muted {
    color: var(--muted);
}

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

.calendar-grid td {
    width: calc(100% / 7);
    min-height: 86px;
}

.calendar-day {
    min-height: 86px;
}

.outside-month {
    background: #f3f4f6;
    color: #9ca3af;
}

.day-type-work {
    border-left: 4px solid #1f7a1f;
}

.day-type-weekend {
    border-left: 4px solid #6b7280;
}

.day-type-holiday {
    border-left: 4px solid #b91c1c;
}

.day-type-transferred_workday {
    border-left: 4px solid #7c3aed;
}

.day-type-shortened_workday {
    border-left: 4px solid #d97706;
}

.session-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    background: rgba(17, 24, 39, 0.35);
}

.session-modal[hidden] {
    display: none;
}

.session-modal-panel {
    width: min(460px, calc(100vw - 32px));
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 18px 50px rgba(17, 24, 39, 0.18);
}
