:root {
    color-scheme: light;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: #182628;
    background: #f3f6f5;
}

* { box-sizing: border-box; }

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

.login-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.15fr);
    min-height: 100vh;
}

.brand-panel {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: clamp(36px, 6vw, 88px);
    color: #ffffff;
    background: #153f46;
}

.brand-mark {
    display: grid;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    place-items: center;
    border: 2px solid #7dd2c4;
    border-radius: 8px;
    color: #b8eee4;
    font-size: 32px;
    font-weight: 700;
}

.company, .store-label {
    margin: 0 0 10px;
    color: #72c9bb;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1, h2, p { letter-spacing: 0; }

h1 {
    margin: 0;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.05;
}

.subtitle {
    margin: 16px 0 0;
    color: #d4e7e4;
    font-size: 18px;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 32px;
    background: #f3f6f5;
}

.login-content { width: min(100%, 420px); }
.store-label { color: #176b61; }

h2 {
    margin: 0 0 32px;
    font-size: 30px;
    line-height: 1.2;
}

.field { margin-bottom: 20px; }

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #a9b8b6;
    border-radius: 6px;
    color: #182628;
    background: #ffffff;
    font: inherit;
}

input,
select {
    height: 48px;
    padding: 0 14px;
}

textarea {
    min-height: 112px;
    padding: 12px 14px;
    resize: vertical;
}

input[type="file"] {
    height: auto;
    min-height: 48px;
    padding: 10px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #176b61;
    outline: 3px solid #c8e8e2;
}

button {
    width: 100%;
    height: 48px;
    margin-top: 4px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: #176b61;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover { background: #12584f; }

button:focus-visible {
    outline: 3px solid #94d7cc;
    outline-offset: 2px;
}

.form-error {
    margin: 0 0 20px;
    padding: 12px 14px;
    border-left: 4px solid #b64235;
    border-radius: 4px;
    color: #7d2921;
    background: #fbe9e6;
    font-size: 14px;
}

.field-error {
    margin: 6px 0 0;
    color: #9f3126;
    font-size: 13px;
}

.support {
    margin: 24px 0 0;
    color: #5b6968;
    font-size: 13px;
    text-align: center;
}

a { color: #176b61; }
a:hover { color: #12584f; }

@media (max-width: 760px) {
    .login-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .brand-panel {
        align-items: flex-start;
        padding: 28px 24px;
    }

    .brand-mark {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    h1 { font-size: 34px; }

    .subtitle {
        margin-top: 8px;
        font-size: 15px;
    }

    .login-panel {
        align-items: start;
        padding: 40px 24px;
    }
}

.app-body { background: #f3f6f5; }

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 24px;
    color: #ffffff;
    background: #153f46;
}

.app-header form { margin: 0; }

.app-brand {
    color: #ffffff;
    font-weight: 750;
    text-decoration: none;
}

.logout-button {
    width: auto;
    height: 38px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #7dd2c4;
    background: transparent;
}

.logout-button:hover { background: #0f343a; }

.app-main {
    width: min(100% - 48px, 760px);
    margin: 72px auto;
}

.app-main.wide-main { width: min(100% - 48px, 1180px); }

.app-title {
    margin: 0;
    color: #182628;
    font-size: 36px;
}

.user-code {
    margin: 16px 0 0;
    color: #5b6968;
    font-size: 18px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 32px 0;
    border: 1px solid #cbd6d4;
    border-radius: 6px;
    overflow: hidden;
    background: #cbd6d4;
}

.profile-grid div {
    min-width: 0;
    padding: 18px;
    background: #ffffff;
}

.profile-grid dt {
    margin-bottom: 7px;
    color: #5b6968;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 650;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.action-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid #176b61;
    border-radius: 6px;
    color: #ffffff;
    background: #176b61;
    font-weight: 700;
    text-decoration: none;
}

.action-link.secondary {
    color: #176b61;
    background: #ffffff;
}

.table-wrap {
    margin-top: 32px;
    overflow-x: auto;
    border: 1px solid #cbd6d4;
    border-radius: 6px;
    background: #ffffff;
}

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

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

th {
    color: #41504e;
    background: #e8efed;
    font-size: 13px;
}

tbody tr:last-child td { border-bottom: 0; }

.reset-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background: #f3f6f5;
}

.reset-main { width: min(100%, 440px); }

.reset-title {
    margin: 0 0 28px;
    font-size: 32px;
}

.reset-copy {
    color: #41504e;
    line-height: 1.6;
}

.reset-main form p { margin: 0 0 18px; }
.reset-main form ul { padding-left: 20px; color: #5b6968; font-size: 13px; }

.identity-line {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.employee-code {
    padding-bottom: 5px;
    color: #5b6968;
    font-size: 15px;
    font-weight: 700;
}

.attendance-section {
    margin-top: 36px;
    padding: 32px 0;
    border-top: 1px solid #cbd6d4;
    border-bottom: 1px solid #cbd6d4;
}

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

.section-kicker {
    margin: 0 0 8px;
    color: #5b6968;
    font-size: 14px;
    font-weight: 650;
}

.status-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.status-marker {
    flex: 0 0 7px;
    width: 7px;
    height: 48px;
    border-radius: 3px;
    background: #869391;
}

.status-working_segment_1,
.status-working_segment_2 { background: #176b61; }
.status-between_segments { background: #bd7a18; }
.status-completed { background: #3170a5; }
.status-data_conflict { background: #b64235; }

.today-records {
    min-height: 70px;
    margin-top: 26px;
    border-top: 1px solid #dce4e2;
}

.record-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: center;
    min-height: 52px;
    border-bottom: 1px solid #dce4e2;
}

.record-row span { color: #5b6968; }
.record-row time { font-variant-numeric: tabular-nums; }

.empty-records {
    margin: 24px 0;
    color: #687573;
}

.attendance-feedback {
    display: flex;
    min-height: 64px;
    align-items: center;
    margin-top: 18px;
    padding: 10px 0;
    overflow-wrap: anywhere;
    color: #41504e;
    font-size: 14px;
    line-height: 1.5;
}

.attendance-feedback.is-success { color: #145e55; font-weight: 650; }
.attendance-feedback.is-error { color: #942f25; font-weight: 650; }
.attendance-feedback.is-pending { color: #41504e; }

.attendance-action { min-height: 64px; }

.attendance-button {
    height: 64px;
    margin: 0;
    font-size: 19px;
}

.attendance-button.clock-out { background: #a33a31; }
.attendance-button.clock-out:hover { background: #852e27; }
.attendance-button:disabled { cursor: wait; opacity: 0.72; }

.completed-action {
    display: grid;
    place-items: center;
    border: 1px solid #9db9d0;
    border-radius: 6px;
    color: #285d87;
    background: #edf5fa;
    font-weight: 700;
}

.page-actions { margin-top: 24px; }

.history-owner {
    margin: 12px 0 0;
    color: #5b6968;
}

.record-id {
    max-width: 230px;
    overflow-wrap: anywhere;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 12px;
}

.history-record-id {
    display: block;
    margin-top: 6px;
    color: #687573;
}

.data-form {
    margin-top: 32px;
    padding: 28px 0;
    border-top: 1px solid #cbd6d4;
    border-bottom: 1px solid #cbd6d4;
}

.data-form .errorlist {
    margin: 0;
    padding-left: 18px;
}

.form-actions,
.decision-actions {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.form-actions button,
.form-actions .action-link,
.decision-actions button {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    margin: 0;
}

.return-button { background: #a33a31; }
.return-button:hover { background: #852e27; }

.section-title-row,
.detail-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
}

.compact-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.3;
}

.text-link {
    font-size: 14px;
    font-weight: 700;
}

.request-title-row { margin-top: 52px; }

.record-origin,
.status-pill {
    display: inline-block;
    padding: 4px 7px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.record-origin.original {
    color: #41504e;
    background: #e8efed;
}

.record-origin.correction,
.status-approved {
    color: #145e55;
    background: #dff1ed;
}

.status-pending {
    color: #7b5012;
    background: #f8ead1;
}

.status-returned {
    color: #8c2c23;
    background: #f8e1de;
}

.subvalue {
    display: block;
    margin-top: 4px;
    color: #5b6968;
    font-size: 12px;
}

.detail-heading { margin-top: 0; }

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 32px 0 0;
    border: 1px solid #cbd6d4;
    border-radius: 6px;
    overflow: hidden;
    background: #cbd6d4;
}

.detail-list > div {
    min-width: 0;
    padding: 16px;
    background: #ffffff;
}

.detail-list .detail-wide { grid-column: 1 / -1; }

.detail-list dt {
    margin-bottom: 7px;
    color: #5b6968;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.detail-section {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid #cbd6d4;
}

.detail-section .data-form {
    margin-top: 20px;
    padding: 0;
    border: 0;
}

.attachment-list { margin-top: 16px; }

.attachment-link {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #dce4e2;
    font-weight: 700;
    text-decoration: none;
}

.attachment-link small {
    color: #5b6968;
    font-weight: 400;
    text-align: right;
}

.audit-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    padding: 16px 0;
    border-bottom: 1px solid #dce4e2;
}

.audit-row span {
    color: #5b6968;
    font-size: 13px;
    text-align: right;
}

.audit-row p {
    grid-column: 1 / -1;
    margin: 0;
    line-height: 1.5;
}

.filter-form {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(220px, 1.5fr) 130px;
    gap: 14px;
    align-items: end;
    margin-top: 32px;
    padding: 24px 0;
    border-top: 1px solid #cbd6d4;
    border-bottom: 1px solid #cbd6d4;
}

.filter-form .field { margin: 0; }
.filter-form button { margin: 0; }
.filter-error { grid-column: 1 / -1; }

.report-actions,
.month-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.report-table { margin-top: 24px; }

.month-heading { align-items: center; }

.report-status {
    padding: 8px 10px;
    border-left: 4px solid #bd7a18;
    color: #6f480f;
    background: #f8ead1;
    font-size: 13px;
    font-weight: 750;
}

.month-table { margin-top: 24px; }
.month-table th, .month-table td { min-width: 108px; }
.month-table th:first-child, .month-table td:first-child { min-width: 104px; }

.month-status {
    display: inline-block;
    padding-left: 8px;
    border-left: 4px solid #869391;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.status-complete { border-color: #176b61; color: #145e55; }
.status-pending_review { border-color: #bd7a18; color: #7b5012; }
.status-data_conflict { border-color: #b64235; color: #8c2c23; }
.status-no_data { border-color: #6d8799; color: #415a69; }

@media (max-width: 620px) {
    .app-header { padding: 0 16px; }
    .app-main { width: min(100% - 32px, 760px); margin: 48px auto; }
    .app-main.wide-main { width: min(100% - 32px, 1180px); }
    .app-title { font-size: 30px; }
    .profile-grid { grid-template-columns: 1fr; }
    .action-row { display: grid; }
    .identity-line { align-items: start; }
    .employee-code { padding-top: 7px; }
    .attendance-section { margin-top: 28px; padding: 26px 0; }
    .status-title { font-size: 24px; }
    .record-row { grid-template-columns: 1fr auto; gap: 8px 14px; padding: 10px 0; }
    .record-row span { grid-column: 1 / -1; }

    .history-table { border: 0; background: transparent; }
    .history-table table,
    .history-table tbody,
    .history-table tr,
    .history-table td { display: block; width: 100%; }
    .history-table thead { display: none; }
    .history-table tr {
        padding: 10px 0;
        border-bottom: 1px solid #cbd6d4;
    }
    .history-table td {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
        padding: 6px 0;
        border: 0;
        text-align: right;
    }
    .history-table td::before {
        content: attr(data-label);
        color: #5b6968;
        font-size: 12px;
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
    }
    .history-table td[colspan] { display: block; text-align: left; }
    .history-table td[colspan]::before { content: none; }
    .record-id { max-width: none; }
    .history-record-id { display: none; }

    .section-title-row,
    .detail-heading {
        align-items: flex-start;
    }

    .detail-heading { flex-direction: column; }
    .detail-list { grid-template-columns: 1fr; }
    .detail-list .detail-wide { grid-column: auto; }
    .attachment-link { flex-direction: column; gap: 6px; }
    .attachment-link small { text-align: left; }
    .form-actions,
    .decision-actions { display: grid; }

    .filter-form { grid-template-columns: 1fr; }
    .filter-error { grid-column: auto; }
    .report-actions,
    .month-navigation { display: grid; }
}
