/* Category cards grid */
.category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (min-width: 600px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.category-card {
    text-decoration: none;
    color: inherit;
}

.category-card article {
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    height: 100%;
}

.category-card article:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

/* Logout button styled as link */
.logout-form {
    margin: 0;
    display: inline;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--pico-primary);
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    min-height: auto;
}

.logout-btn:hover {
    text-decoration: underline;
    background: none;
}

/* Login card */
.login-card {
    max-width: 400px;
    margin: 2rem auto;
}

/* Larger touch targets for mobile */
button,
[role="button"],
input[type="file"]::file-selector-button {
    min-height: 48px;
    font-size: 1.1rem;
}

input, select, textarea {
    font-size: 1rem;
}

/* Success / error messages */
.success-msg {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
}

.error-msg {
    color: #dc3545;
}

article.error-msg {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
}

/* Upload list */
.upload-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

@media (min-width: 600px) {
    .upload-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.upload-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.download-btn {
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
}

@media (min-width: 600px) {
    .download-btn {
        width: auto;
        white-space: nowrap;
    }
}

/* Upload action buttons (download + done) */
.upload-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

@media (min-width: 600px) {
    .upload-actions {
        flex-direction: row;
        width: auto;
        align-items: center;
    }
}

.done-form {
    margin: 0;
}

.done-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    min-height: 40px;
    color: #28a745;
    border-color: #28a745;
    width: 100%;
}

.done-btn:hover {
    background-color: #28a745;
    color: #fff;
    border-color: #28a745;
}

@media (min-width: 600px) {
    .done-btn {
        width: auto;
        white-space: nowrap;
    }
}

/* Done section */
.done-section {
    margin-top: 2rem;
    opacity: 0.7;
}

.done-section summary {
    cursor: pointer;
    list-style: none;
}

.done-section summary h2 {
    display: inline;
}

.done-item {
    background-color: #f8f9fa;
}

/* Section header with sort toggle */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.sort-toggle {
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Status badges */
.badge {
    font-size: 0.8rem;
    background-color: var(--pico-muted-border-color);
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    margin-left: 0.5rem;
}

.badge-category {
    font-size: 0.85rem;
}

.badge-open {
    font-size: 0.75rem;
    background-color: #fff3cd;
    color: #856404;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
}

.badge-done {
    font-size: 0.75rem;
    background-color: #d4edda;
    color: #155724;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
}

/* Admin user groups */
.user-group {
    margin-bottom: 1rem;
}

.user-group summary {
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem 0;
}

/* Back link larger tap target */
.back-link {
    display: inline-block;
    padding: 0.5rem 0;
    font-size: 1.1rem;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1rem 0;
    opacity: 0.6;
}
