body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    color: #222;
}

.login-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(1200px 420px at 15% 5%, rgba(47, 64, 80, 0.2), transparent 65%),
        radial-gradient(900px 320px at 90% 100%, rgba(0, 86, 140, 0.12), transparent 60%),
        #eef2f6;
}

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

.login-brand {
    text-align: center;
    margin-bottom: 14px;
}

.login-brand-kicker {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #35516d;
    margin-bottom: 4px;
}

.login-brand h1 {
    margin: 0;
    font-size: 24px;
    color: #1f2f40;
}

.login-card {
    background: #fff;
    border: 1px solid #d7dee6;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(26, 47, 69, 0.16);
    padding: 18px 18px 16px;
}

.login-card h2 {
    margin: 0 0 12px;
    font-size: 18px;
    color: #1f2f40;
}

.login-error {
    margin-bottom: 12px;
}

.login-form {
    display: grid;
    gap: 11px;
}

.login-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    color: #2a3a4c;
}

.login-field input {
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    border: 1px solid #c2cfdb;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 14px;
    background: #f8fafc;
}

.login-field input:focus {
    outline: none;
    border-color: #2f6ea8;
    box-shadow: 0 0 0 3px rgba(47, 110, 168, 0.2);
    background: #fff;
}

.login-actions {
    margin-top: 2px;
}

.login-submit {
    width: 100%;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(180deg, #2f6ea8 0%, #245a8a 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.login-submit:hover {
    filter: brightness(1.04);
}

.login-footer {
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    color: #5a6b7d;
}

.page-chrome {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.topbar {
    background: #2f4050;
    color: #fff;
    padding: 12px 18px 10px 18px;
}

.topbar h1 {
    margin: 0;
    font-size: 20px;
}

.topbar .meta {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.35;
}

.topbar-extra {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.monthly-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 13px;
    line-height: 1.35;
}

.monthly-header-meta span {
    white-space: nowrap;
}

.nav {
    background: #e9ecef;
    border-bottom: 1px solid #ccc;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
}

.nav a {
    margin-right: 18px;
    text-decoration: none;
    color: #003366;
    font-weight: bold;
}

.nav-right a {
    margin-right: 0;
}

.container {
    padding: 18px;
}

.message-success {
    background: #dff0d8;
    border: 1px solid #b2d8a7;
    color: #2e6b2e;
    padding: 10px;
    margin-bottom: 15px;
}

.message-error {
    background: #f2dede;
    border: 1px solid #e0b1b8;
    color: #8a1f2d;
    padding: 10px;
    margin-bottom: 15px;
}

.message-info {
    background: #e7f3fe;
    border: 1px solid #b7d7f7;
    color: #1f4e79;
    padding: 10px;
    margin-bottom: 15px;
}

.message-warning {
    background: #fff4d6;
    border: 1px solid #e6c97a;
    color: #7a5a00;
    padding: 10px;
    margin-bottom: 15px;
}

.card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 18px;
}

.filters-row {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.filters-row label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}

.filters-row select,
.filters-row button,
.filters-row input,
.filters-row textarea {
    font-size: 14px;
    padding: 6px;
}

.monthly-sheet-meta {
    font-size: 14px;
    line-height: 1.45;
}

.work-code-legend {
    margin-bottom: 8px;
}

.work-code-legend.card {
    padding: 8px 10px;
}

.work-code-legend-title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 12px;
}

.work-code-legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 4px 8px;
}

.work-code-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
    background: #fafafa;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1.2;
    min-height: 22px;
}

.work-code-legend-swatch {
    width: 10px;
    height: 10px;
    border: 1px solid #b8b8b8;
    border-radius: 2px;
    background: #fff;
    display: inline-block;
    flex: 0 0 auto;
}

.work-code-legend-code {
    font-weight: 700;
}

.work-code-legend-hours {
    opacity: 0.9;
}

.day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.05;
}

.day-header-weekday {
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 2px;
}

.day-header-date {
    font-size: 12px;
}

.month-table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    padding: 0;
    position: relative;
}

.month-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    background: #fff;
    table-layout: fixed;
}

.month-table th,
.month-table td {
    border-right: 1px solid #cfcfcf;
    border-bottom: 1px solid #cfcfcf;
    text-align: center;
    vertical-align: top;
    white-space: nowrap;
    position: relative;
    background: #fff;
}

.month-table tr > *:first-child {
    border-left: 1px solid #cfcfcf;
}

.month-table thead tr:first-child > * {
    border-top: 1px solid #cfcfcf;
}

.month-table th {
    background: #f3f5f7;
    padding: 6px 4px;
    font-size: 12px;
    z-index: 1;
}

.month-table td {
    padding: 4px;
    font-size: 12px;
    z-index: 1;
}

.month-table .employee-col {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    text-align: left;
    vertical-align: middle;
    background: #fff;
}

.month-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 50;
    background: #fff !important;
    background-clip: padding-box;
    box-shadow: 3px 0 0 #cfcfcf;
}

.month-table tbody .sticky-col {
    overflow: hidden;
}

.month-table thead .sticky-col {
    z-index: 60;
    background: #f3f5f7 !important;
    box-shadow: 3px 0 0 #cfcfcf;
}

.month-table .summary-col {
    width: 62px;
    min-width: 62px;
    max-width: 62px;
    font-weight: bold;
    vertical-align: middle;
}

.month-table th.weekend,
.month-table td.weekend {
    background: #ececec;
}

.month-table.month-table-vertical .entry-cell {
    width: 68px;
    min-width: 68px;
    max-width: 68px;
    padding: 3px 2px;
    transition: background-color 0.15s ease-in-out;
    overflow: hidden;
}

.month-table.month-table-vertical .entry-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.month-table.month-table-vertical .hhmm-input,
.month-table.month-table-vertical .work-code-select {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    box-sizing: border-box;
    height: 22px;
    margin: 0;
    padding: 1px 3px;
    font-size: 12px;
    text-align: center;
}

.month-table.month-table-vertical .hhmm-input::placeholder {
    color: #777;
    font-style: italic;
}

.month-table.month-table-vertical .work-code-select {
    font-weight: 600;
}

.month-table.month-table-vertical .day-hours {
    min-height: 16px;
    margin-top: 1px;
    font-size: 11px;
    line-height: 1.1;
    font-weight: 600;
    color: #333;
}

.month-table.month-table-vertical .entry-cell.has-work-code {
    font-weight: 600;
}

.input-invalid {
    border: 1px solid #c62828 !important;
    background: #fff1f1 !important;
}

.form-actions {
    margin-top: 12px;
}

.has-sticky-savebar {
    padding-bottom: 88px;
}

.sticky-savebar {
    position: sticky;
    bottom: 0;
    z-index: 950;
    margin-top: 12px;
}

.sticky-savebar-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #d6d6d6;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(2px);
}

.sticky-save-button {
    min-width: 160px;
    font-size: 14px;
    font-weight: bold;
    padding: 9px 16px;
    cursor: pointer;
}

.summary-diff.positive {
    color: #0a7a22;
}

.summary-diff.negative {
    color: #b42318;
}

.report-sheet {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
}

.report-header {
    text-align: center;
    margin-bottom: 18px;
}

.report-unit-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 6px;
}

.report-period {
    font-size: 16px;
    font-weight: bold;
}

.report-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.report-table th,
.report-table td {
    border: 1px solid #000;
    padding: 3px;
    text-align: center;
    font-size: 11px;
}

.report-table .employee-col {
    width: 180px;
    text-align: left;
    font-weight: bold;
}

.report-table .summary-col {
    width: 60px;
    font-weight: bold;
}

.report-day-cell.weekend {
    background: #efefef;
}

.report-notes {
    margin-top: 20px;
    font-size: 13px;
}

.report-signature {
    margin-top: 35px;
    width: 260px;
    margin-left: auto;
    text-align: center;
}

.report-signature-name {
    margin-bottom: 30px;
}

.report-signature-line {
    border-top: 1px solid #000;
    margin-bottom: 6px;
}

.report-signature-label {
    font-size: 12px;
}

.audit-table-wrap {
    overflow-x: auto;
    border: 1px solid #ddd;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.audit-table th,
.audit-table td {
    border: 1px solid #d7d7d7;
    padding: 6px 8px;
    font-size: 12px;
    text-align: left;
    vertical-align: top;
}

.audit-table th {
    background: #f3f5f7;
    font-weight: 700;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
    width: 110px;
}

.audit-table th:nth-child(2),
.audit-table td:nth-child(2) {
    width: 200px;
}

.audit-table th:nth-child(4),
.audit-table td:nth-child(4) {
    width: 220px;
}

.audit-table th:nth-child(5),
.audit-table td:nth-child(5) {
    width: 160px;
}

#notes {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    .no-print,
    .page-chrome,
    .topbar,
    .nav,
    .sticky-savebar {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .container,
    .report-sheet {
        margin: 0;
        padding: 0;
        border: 0;
    }

    .has-sticky-savebar {
        padding-bottom: 0 !important;
    }
}

@media (max-width: 1600px) {
    .month-table .employee-col {
        width: 165px;
        min-width: 165px;
        max-width: 165px;
    }

    .month-table.month-table-vertical .entry-cell {
        width: 64px;
        min-width: 64px;
        max-width: 64px;
    }

    .month-table.month-table-vertical .hhmm-input,
    .month-table.month-table-vertical .work-code-select {
        width: 54px;
        min-width: 54px;
        max-width: 54px;
        font-size: 11px;
    }

    .month-table .summary-col {
        width: 58px;
        min-width: 58px;
        max-width: 58px;
    }
}

@media (max-width: 640px) {
    .login-page {
        padding: 14px;
    }

    .login-brand h1 {
        font-size: 22px;
    }

    .login-card {
        border-radius: 10px;
        padding: 14px 14px 13px;
    }
}
