#attendance-history-section {
    width: 100%;
    min-width: 0;
    grid-column: 1 / -1;
    margin: 0 0 22px;
    overflow: hidden;
    border: 1px solid #dce6f1;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(32, 80, 137, .07);
    text-align: left;
}

.attendance-history-toggle {
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 19px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    box-shadow: none;
}

.attendance-history-toggle h2 {
    margin: 3px 0 0;
    font-size: 21px;
}

.attendance-history-toggle-label {
    flex: 0 0 auto;
    color: #205089;
    font-size: 14px;
    font-weight: 800;
}

.attendance-history-content {
    padding: 0 20px 20px;
    border-top: 1px solid #e5ebf2;
}

.attendance-history-controls {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
}

.attendance-history-controls button {
    width: 42px;
    min-height: 42px;
    margin: 0;
    padding: 0;
    border: 1px solid #dce5ef;
    border-radius: 12px;
    background: #f5f8fb;
    color: #205089;
    font-size: 23px;
}

.attendance-history-controls button:disabled {
    opacity: .35;
}

.attendance-history-month {
    text-align: center;
    color: #193a5c;
    font-size: 15px;
    font-weight: 800;
    text-transform: capitalize;
}

.attendance-history-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.attendance-history-summary article {
    min-width: 0;
    padding: 11px 9px;
    border-radius: 12px;
    background: #f4f7fb;
    text-align: center;
}

.attendance-history-summary span {
    display: block;
    margin-bottom: 5px;
    color: #7c8997;
    font-size: 10px;
}

.attendance-history-summary strong {
    display: block;
    color: #193a5c;
    font-size: 16px;
    overflow-wrap: anywhere;
}

.attendance-history-list {
    display: grid;
    gap: 9px;
}

.attendance-history-row {
    padding: 13px;
    border: 1px solid #e2e9f1;
    border-radius: 14px;
    background: #fbfcfe;
}

.attendance-history-row-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.attendance-history-date strong,
.attendance-history-date span {
    display: block;
}

.attendance-history-date strong {
    color: #193a5c;
    font-size: 15px;
}

.attendance-history-date span {
    margin-top: 3px;
    color: #84909d;
    font-size: 11px;
}

.attendance-history-time {
    color: #193a5c;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.attendance-history-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.attendance-history-worked {
    color: #647486;
    font-size: 13px;
}

.attendance-history-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.attendance-history-badge {
    padding: 4px 7px;
    border-radius: 999px;
    background: #fff4d8;
    color: #805e00;
    font-size: 10px;
    font-weight: 800;
}

.attendance-history-badge.ok {
    background: #e9f5ef;
    color: #176b57;
}

.attendance-history-loading,
.attendance-history-empty,
.attendance-history-error {
    margin: 15px 0 0;
    color: #788594;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.attendance-history-error {
    color: #a33b32;
}

@media (max-width: 380px) {
    .attendance-history-summary {
        grid-template-columns: 1fr;
    }
}
