body {
    margin: 0;
    background: #f4f6f8;
    color: #1f2933;
    font-family: Arial, "Microsoft YaHei", sans-serif;
    font-size: 14px;
}

.page {
    box-sizing: border-box;
    width: 1280px;
    max-width: calc(100% - 36px);
    margin: 0 auto;
    padding: 28px 0 48px;
}

.wide-page {
    width: 1280px;
}

.login-page {
    min-height: 100vh;
    padding-top: 12vh;
}

.login-box {
    width: 360px;
    max-width: 86%;
    margin: 0 auto;
    padding: 22px;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
    background: #ffffff;
    text-align: left;
}

.login-box h1 {
    margin-bottom: 18px;
}

.login-box label,
.login-box input,
.login-box button {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin-left: 0;
}

.login-box input {
    margin-top: 8px;
    margin-bottom: 12px;
}

.login-error {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #f59e0b;
    border-radius: 4px;
    background: #fffbeb;
    color: #92400e;
}

.topbar {
    display: block;
    margin-bottom: 14px;
}

h1 {
    margin: 0 0 16px;
    font-size: 26px;
    font-weight: 700;
}

.filters {
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
}

.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-sizing: border-box;
    width: 100%;
}

.filter-controls,
.download-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-controls {
    flex: 1 1 auto;
    min-width: 0;
}

.download-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    min-width: 300px;
    white-space: nowrap;
}

.calendar-form {
    margin-top: 10px;
}

.date-title {
    margin-right: 14px;
    color: #1f2933;
    font-size: 16px;
}

.filters label {
    display: inline-block;
    margin-right: 14px;
    color: #52606d;
}

.filters input[type="checkbox"] {
    width: auto;
    height: auto;
    margin-left: 0;
    vertical-align: middle;
}

input,
select,
button {
    height: 34px;
    margin-left: 6px;
    padding: 0 9px;
    border: 1px solid #bcccdc;
    border-radius: 4px;
    background: #ffffff;
    color: #1f2933;
    font-size: 14px;
}

button {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
}

.button-link,
.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    box-sizing: border-box;
    margin-left: 0;
    padding: 0 13px;
    border: 1px solid #2563eb;
    border-radius: 4px;
    background: #ffffff;
    color: #2563eb;
    line-height: 34px;
    text-decoration: none;
    font-weight: 700;
}

.download-button {
    border-color: #0f766e;
    background: #0f766e;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 118, 110, 0.18);
}

.download-button.secondary {
    border-color: #b45309;
    background: #b45309;
    box-shadow: 0 1px 2px rgba(180, 83, 9, 0.18);
}

.download-button:hover {
    border-color: #115e59;
    background: #115e59;
}

.download-button.secondary:hover {
    border-color: #92400e;
    background: #92400e;
}

.hint,
.empty {
    margin: 14px 0;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
    color: #52606d;
}

.panel {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
    background: #ffffff;
}

.panel h2 {
    margin-bottom: 12px;
}

.panel input[type="text"],
.panel input[type="time"],
.panel select {
    box-sizing: border-box;
    min-width: 180px;
}

.panel input[type="checkbox"] {
    width: auto;
    height: auto;
    margin-left: 0;
}

.inline-fields label {
    display: inline-block;
    margin-right: 12px;
    color: #52606d;
}

.inline-fields button {
    vertical-align: bottom;
}

.form-actions {
    margin-top: 12px;
    text-align: right;
}

code {
    padding: 2px 5px;
    background: #eef2f7;
    border-radius: 4px;
}

a {
    color: #2563eb;
}

.nav {
    margin-bottom: 14px;
}

.nav a {
    display: inline-block;
    margin-right: 8px;
    padding: 7px 10px;
    border: 1px solid #bcccdc;
    border-radius: 4px;
    background: #ffffff;
    color: #334e68;
    text-decoration: none;
}

.nav a.active {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.user-block {
    margin-top: 20px;
}

h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

h2 span {
    margin-left: 8px;
    color: #7b8794;
    font-size: 13px;
    font-weight: normal;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #d9e2ec;
}

th,
td {
    padding: 9px 10px;
    border: 1px solid #d9e2ec;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eef2f7;
    color: #334e68;
    font-weight: 700;
}

tbody tr:nth-child(even) td {
    background: #fbfdff;
}

.date-col {
    width: 110px;
    white-space: nowrap;
}

.employee-col {
    width: 170px;
    min-width: 170px;
    white-space: nowrap;
}

.employee-col strong,
.employee-col span {
    display: block;
}

.employee-col span {
    margin-top: 3px;
    color: #7b8794;
    font-size: 12px;
    font-weight: normal;
}

.table-scroll {
    overflow-x: auto;
    border: 1px solid #d9e2ec;
    background: #ffffff;
}

.table-scroll table {
    border: 0;
}

.monthly-table th,
.monthly-table td {
    padding: 8px 7px;
    text-align: center;
}

.monthly-table th {
    min-width: 58px;
}

.monthly-table td {
    min-width: 88px;
    line-height: 1.35;
    white-space: normal;
}

.monthly-table .employee-col {
    text-align: left;
}

.sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
}

th.sticky-col {
    z-index: 3;
}

td.sticky-col {
    background: #ffffff;
}

tbody tr:nth-child(even) td.sticky-col {
    background: #fbfdff;
}

.ok-day {
    background: #ecfdf5;
    color: #047857;
}

.bad-day {
    background: #fef3c7;
    color: #92400e;
}

.future-day {
    background: #f8fafc;
    color: #94a3b8;
}

.rest-day {
    background: #eef2ff;
    color: #475569;
}

.id-col {
    width: 60px;
    white-space: nowrap;
}

.raw-table td {
    max-width: 520px;
}

.raw-json {
    max-height: 180px;
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 760px) {
    .page,
    .wide-page {
        width: auto;
        max-width: none;
        padding-right: 12px;
        padding-left: 12px;
    }

    .filter-row {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-controls,
    .download-actions {
        width: 100%;
    }

    .download-actions {
        min-width: 0;
    }

    .download-button,
    .download-actions button {
        flex: 1 1 0;
    }
}
