:root {
    color-scheme: light;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: #24302b;
    background: #f4f6f5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 32px;
    background: linear-gradient(135deg, #edf2ef, #f7f4ed);
}

.login-card,
.welcome-panel {
    width: min(100%, 430px);
    padding: 42px;
    border: 1px solid #dfe5e1;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgb(44 61 53 / 10%);
}

.brand-mark {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    margin-bottom: 24px;
    border-radius: 12px;
    background: #315c4a;
    color: #ffffff;
    font-weight: 700;
}

h1 {
    margin: 0 0 10px;
    font-size: 26px;
}

.subtitle,
.muted {
    color: #718078;
}

.login-form {
    display: grid;
    gap: 10px;
    margin-top: 30px;
}

.login-form label {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
}

.login-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cfd8d3;
    border-radius: 8px;
    font: inherit;
}

.login-form input:focus {
    border-color: #315c4a;
    outline: 3px solid rgb(49 92 74 / 12%);
}

.login-form button,
.logout-button {
    border: 0;
    border-radius: 8px;
    background: #315c4a;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
}

.login-form button {
    margin-top: 18px;
    padding: 13px;
    font-weight: 700;
}

.error-message {
    margin-top: 22px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff0ee;
    color: #a33b31;
    font-size: 14px;
}

.system-page {
    background: #f4f6f5;
}

.system-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    background: #243f34;
    color: #ffffff;
}

.system-header span {
    margin-left: 12px;
    color: #b8c9c1;
    font-size: 13px;
}

.logout-button {
    padding: 9px 14px;
    border: 1px solid #789387;
    background: transparent;
}

.welcome-panel {
    width: min(calc(100% - 48px), 760px);
    margin: 72px auto;
}

.eyebrow {
    margin: 0 0 12px;
    color: #567566;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
}

.system-brand {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.user-area,
.heading-actions,
.form-actions,
.filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-area {
    font-size: 14px;
}

.system-shell {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    min-height: calc(100vh - 65px);
}

.side-nav {
    padding: 24px 14px;
    border-right: 1px solid #dfe5e1;
    background: #ffffff;
}

.side-nav a {
    display: block;
    padding: 11px 14px;
    border-radius: 7px;
    color: #405149;
    text-decoration: none;
}

.side-nav a:hover {
    background: #edf3f0;
    color: #244c3b;
}

.nav-section {
    margin: 22px 14px 7px;
    color: #849189;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
}

.content-area {
    min-width: 0;
    padding: 34px;
}

.content-panel,
.filter-panel,
.table-panel,
.detail-panel,
.form-panel {
    border: 1px solid #dfe5e1;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 28px rgb(44 61 53 / 6%);
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-heading h1,
.page-heading p {
    margin-top: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}

.button.primary {
    background: #315c4a;
    color: #ffffff;
}

.button.secondary {
    border-color: #cbd5d0;
    background: #ffffff;
    color: #405149;
}

.filter-panel,
.form-panel,
.detail-panel {
    padding: 24px;
    margin-bottom: 22px;
}

.filter-grid,
.form-grid,
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px;
}

.filter-grid {
    grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.filter-grid label,
.form-field > label {
    display: grid;
    gap: 7px;
    color: #53645c;
    font-size: 13px;
    font-weight: 600;
}

.filter-grid input,
.filter-grid select,
.form-field input:not([type="checkbox"]),
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #cfd8d3;
    border-radius: 7px;
    background: #ffffff;
    font: inherit;
}

.filter-actions,
.form-actions {
    margin-top: 20px;
}

.table-panel {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid #e7ece9;
    text-align: left;
    white-space: nowrap;
}

th {
    background: #f7f9f8;
    color: #64736c;
    font-size: 13px;
}

.monthly-notes-cell {
    min-width: 150px;
    max-width: 280px;
    white-space: normal;
    overflow-wrap: anywhere;
}

td a {
    color: #2c6650;
}

.status-tag {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e9f3ee;
    color: #2d634c;
    font-size: 12px;
}

.empty-state {
    padding: 38px;
    color: #7b8982;
    text-align: center;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 22px;
}

.pagination a {
    color: #2c6650;
}

.detail-grid {
    margin: 0;
}

.detail-grid div {
    padding: 14px 0;
    border-bottom: 1px solid #edf0ee;
}

.detail-grid dt {
    margin-bottom: 7px;
    color: #78867f;
    font-size: 13px;
}

.detail-grid dd {
    margin: 0;
}

.full-width {
    grid-column: 1 / -1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}

.required,
.field-error {
    color: #b54337;
}

.field-error {
    margin: 6px 0 0;
    font-size: 13px;
}

.message {
    margin-bottom: 18px;
    padding: 12px 16px;
    border-radius: 8px;
}

.message.success {
    background: #e7f3ed;
    color: #275e48;
}

.message.error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.table-actions {
    display: flex;
    gap: 14px;
}

.danger-link,
.field-error {
    color: #a33b31;
}

.button.danger {
    background: #a33b31;
    color: #ffffff;
}

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.availability-selector {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.availability-panel {
    padding: 24px;
    border: 1px solid #dfe5e1;
    border-radius: 12px;
    background: #ffffff;
}

.availability-table td {
    text-align: center;
}

.availability-cell {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.compact-operation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.compact-operation p {
    margin: 7px 0 0;
}

.operation-notice,
.result-success {
    margin-bottom: 22px;
    padding: 18px 22px;
}

.result-success {
    color: #275e48;
}

.confirmation-panel {
    max-width: 720px;
}

.large-number {
    margin-left: 8px;
    color: #315c4a;
    font-size: 24px;
}

.warning-box {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid #e7c2bd;
    border-radius: 9px;
    background: #fff7f5;
    color: #744139;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.analysis-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card {
    padding: 18px;
    border: 1px solid #dfe5e1;
    border-radius: 10px;
    background: #ffffff;
}

.summary-card span {
    display: block;
    margin-bottom: 7px;
    color: #78867f;
    font-size: 13px;
}

.summary-card strong {
    font-size: 21px;
}

.amount-negative,
.voided {
    color: #a33b31;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 30px 0 12px;
}

.section-heading h2 {
    margin: 0;
    font-size: 19px;
}

.bill-line-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr 1fr;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid #e7ece9;
}

.bill-line-grid.bill-line-edit {
    grid-template-columns: 1.1fr 1.7fr .9fr .7fr;
}

.bill-line-grid:last-child {
    border-bottom: 0;
}

.bill-line-grid .form-field {
    min-width: 0;
}

.form-help {
    display: block;
    margin-top: 6px;
    color: #78867f;
    font-size: 12px;
}

.timetable-selector {
    display: flex;
    align-items: end;
    gap: 14px;
}

.timetable-selector label {
    align-self: center;
    font-weight: 600;
}

.timetable-selector select {
    min-width: 240px;
}

.timetable-panel {
    overflow-x: auto;
}

.timetable-grid {
    min-width: 1120px;
    table-layout: fixed;
}

.timetable-grid th,
.timetable-grid td {
    width: 140px;
    padding: 10px;
    text-align: center;
    vertical-align: middle;
}

.timetable-grid .period-column {
    width: 180px;
    background: #f4f7f5;
}

.lesson-card {
    margin: 4px 0;
    padding: 8px;
    border-left: 3px solid #567566;
    border-radius: 6px;
    background: #edf3f0;
}

.lesson-card strong,
.lesson-card span {
    display: block;
}

.lesson-card span,
.slot-empty {
    margin-top: 3px;
    color: #78867f;
    font-size: 13px;
}

.inspection-pass,
.inspection-warning {
    margin-bottom: 20px;
    padding: 20px 22px;
}

.inspection-pass {
    border-color: #bed8ca;
    background: #f1f8f4;
    color: #275e48;
}

.inspection-warning {
    border-color: #e2c995;
    background: #fffaf0;
    color: #705621;
}

.inspection-pass p,
.inspection-warning p {
    margin: 7px 0 0;
}

.inline-form {
    display: inline;
    margin-left: 10px;
}

.check-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-list li + li {
    margin-top: 10px;
}

.check-mark {
    margin-right: 8px;
    color: #275e48;
    font-weight: 700;
}

.warning-symbol {
    color: #9a6a12;
    font-weight: 700;
}

.evaluation-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 1100px) {
    .evaluation-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
