:root {
    --bg: #f7f7f5;
    --fg: #1c1b19;
    --muted: #6b6b66;
    --accent: #2f6f4f;
    --accent-fg: #ffffff;
    --border: #dcdcd5;
    --card: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    color: var(--fg);
    background: var(--bg);
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
}

.site-header nav a {
    margin-left: 1rem;
}

.brand {
    font-weight: 700;
    text-decoration: none;
    color: var(--fg);
}

a {
    color: var(--accent);
}

main {
    padding: 1.5rem 1rem 3rem;
}

.muted {
    color: var(--muted);
}

.error {
    color: #b3261e;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 24rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.field span {
    font-weight: 600;
}

input[type="password"],
input[type="text"],
textarea {
    font: inherit;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--fg);
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

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

.actions form {
    display: inline;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table .actions-col {
    width: 1%;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: #eee;
    color: var(--muted);
}

.badge-visible {
    background: #e2f0e7;
    color: var(--accent);
}

.photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.photo-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.photo-item img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.photo-delete {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

button.danger {
    border-color: #b3261e;
    color: #b3261e;
}

.item-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.item-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.item-link {
    text-decoration: none;
    color: var(--fg);
    display: flex;
    flex-direction: column;
}

.item-link h2 {
    font-size: 1.05rem;
    margin: 0.6rem 0.75rem 0;
}

.item-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: #f0f0ec;
}

.item-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.item-description {
    margin: 0.4rem 0.75rem 0.75rem;
    font-size: 0.9rem;
}

.detail-photo {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.item-action {
    margin: 0.5rem 0.75rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    background: #eee;
    color: var(--muted);
}

.pill-requested {
    background: #e2f0e7;
    color: var(--accent);
}

.pill-received {
    background: #e6e6f5;
    color: #3a3a7a;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
}

/* The modal container is always in the DOM; hide it while empty. */
.modal:empty {
    display: none;
}

.modal-card {
    width: 100%;
    max-width: 26rem;
    background: var(--card);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.modal-card h2 {
    margin-top: 0;
}

.modal-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.small {
    font-size: 0.85rem;
}

.request-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.request-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.request-main a {
    font-weight: 600;
}

.pill-pending {
    background: #fdf0d5;
    color: #8a6100;
}

.pill-accepted {
    background: #e2f0e7;
    color: var(--accent);
}

.pill-done {
    background: #e6e6f5;
    color: #3a3a7a;
}

.pill-cancelled {
    background: #eee;
    color: var(--muted);
}

.status-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

select {
    font: inherit;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--fg);
}





button,
.btn {
    font: inherit;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--fg);
    cursor: pointer;
}

button.primary,
.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-fg);
}
