* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 24px 16px;
    background-color: #f8fafc;
    color: #1f2933;
}

.history-app {
    max-width: 960px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
    padding: 20px 24px 28px;
}

.app-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.app-header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #0f172a;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
}

.filter-form .field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}

.filter-form .field span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.filter-form input {
    padding: 8px 10px;
    border: 1px solid #cbd5f5;
    border-radius: 6px;
    font-size: 0.95rem;
}

.filter-form button {
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    background-color: #2563eb;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.filter-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.filter-form button:hover:not(:disabled) {
    background-color: #1d4ed8;
}

.message {
    min-height: 20px;
    margin-bottom: 12px;
    font-size: 0.92rem;
    color: #0f172a;
}

.history-section {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.history-table th,
.history-table td {
    padding: 10px 12px;
    font-size: 0.95rem;
    border-bottom: 1px solid #e2e8f0;
}

.history-table th {
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background-color: #f1f5f9;
    color: #475569;
}

.history-table td:last-child,
.history-table th:last-child {
    text-align: right;
}

.history-table code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.history-table tbody tr:hover {
    background-color: #f8fafc;
}

.history-table td.locked {
    font-weight: 600;
    color: #dc2626;
}

.history-table td.unlocked {
    color: #059669;
}

.history-table td.empty {
    text-align: center;
    color: #64748b;
    font-style: italic;
}

.history-table a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.history-table a:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

.page-info {
    font-size: 0.95rem;
    color: #1e293b;
}

.page-actions {
    display: flex;
    gap: 8px;
}

.page-actions button {
    padding: 8px 16px;
    border: 1px solid #cbd5f5;
    border-radius: 6px;
    background-color: #f1f5f9;
    font-weight: 600;
    cursor: pointer;
}

.page-actions button:hover:not(:disabled) {
    background-color: #e2e8f0;
}

.page-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .history-app {
        padding: 16px;
    }

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

    .filter-form button {
        width: 100%;
    }

    .page-actions {
        width: 100%;
        justify-content: space-between;
    }
}
