*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
}

.page {
    max-width: 860px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
}

h1 {
    font-size: 1.5rem;
    word-break: break-word;
}

form label {
    display: block;
    margin-bottom: 1rem;
}

form input,
form select,
form textarea {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.6rem;
    font-size: 1rem;
    font-family: inherit;
}

button {
    padding: 0.6rem 1.1rem;
    font-size: 1rem;
    cursor: pointer;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fdecea;
    color: #611a15;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #e9f7ef;
    color: #1e4620;
    border: 1px solid #c3e6cb;
}

/* Fejléc / globális navigáció */

.site-header {
    background: #1f2937;
}

.site-header__inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.site-header__brand {
    margin-right: auto;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

.site-nav a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
}

.site-nav a:hover {
    text-decoration: underline;
}

.site-header__logout button {
    background: transparent;
    border: 1px solid #6b7280;
    color: #e5e7eb;
    padding: 0.35rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.site-header__logout button:hover {
    background: #374151;
}

/* Táblázatok */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table th,
table td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

table td.wrap,
table th.wrap {
    white-space: normal;
}

td.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

td.actions form {
    display: inline;
}

fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.filters label {
    flex: 1 1 200px;
}

.location-chain {
    padding-left: 1.5rem;
}

.location-chain li {
    margin-bottom: 0.4rem;
}

.pin-input {
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    text-align: center;
    max-width: 150px;
}

.category-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.4rem;
}

.category-row form {
    display: inline;
}

@media (max-width: 600px) {
    .page {
        padding: 1rem 0.75rem 1.5rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    table th,
    table td {
        padding: 0.4rem;
        font-size: 0.92rem;
    }

    td.actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
}
