:root {
    --bg: #f4f1e8;
    --surface: #fffcf6;
    --ink: #1b1a17;
    --accent: #1f6f5f;
    --accent-2: #c35b32;
    --muted: #6e6759;
    --ok: #1f7a4d;
    --err: #9a2f2f;
    --line: #dfd4bf;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top left, #f7ecd7 0%, var(--bg) 46%, #efe4cf 100%);
}

.wrap {
    width: min(960px, 92%);
    margin: 0 auto;
}

.site-header {
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(3px);
    background: rgba(255, 252, 246, 0.8);
    position: sticky;
    top: 0;
}

.site-header .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.03em;
}

.brand-logo {
    width: 200px;
    max-width: 48vw;
    height: auto;
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.hero,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.25rem;
    margin: 1.25rem 0;
    box-shadow: 0 12px 24px rgba(27, 26, 23, 0.06);
}

.hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    margin-top: 0;
}

.actions,
.inline-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.button,
button {
    border: none;
    border-radius: 10px;
    background: linear-gradient(130deg, var(--accent), #2b8e79);
    color: #fff;
    padding: 0.65rem 1rem;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
}

.button-secondary {
    background: linear-gradient(130deg, var(--accent-2), #d97c45);
}

.stack {
    display: grid;
    gap: 0.85rem;
}

label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

input,
select,
textarea {
    border: 1px solid #ccbfa6;
    border-radius: 8px;
    padding: 0.65rem;
    font: inherit;
    background: #fff;
}

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

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
}

.filters .button {
    height: 42px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 0.7rem;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.82rem;
    text-transform: capitalize;
    border: 1px solid #b9ab90;
}

.badge-accepted,
.badge-settled { background: #e0f4e8; }
.badge-suggested { background: #fff1d6; }
.badge-rejected,
.badge-disputed { background: #ffe2dc; }
.badge-unpaid { background: #f2ebe0; }
.badge-pending { background: #fff1d6; }
.badge-completed { background: #e0f4e8; }

.flash {
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    margin-top: 1rem;
}

.flash-success {
    background: #e2f6ea;
    border: 1px solid #bee7cd;
    color: var(--ok);
}

.flash-error {
    background: #ffe5e5;
    border: 1px solid #f1c4c4;
    color: var(--err);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.6rem;
}

.votes {
    padding-left: 1.1rem;
}

.hint {
    color: var(--muted);
    margin: 0;
}

.group-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0.75rem 0 1rem;
}

.group-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    background: #f8f2e5;
    color: var(--ink);
    font-size: 0.9rem;
}

.log-output {
    margin-top: 0.85rem;
    background: #f7f2e7;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.85rem;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Menlo, Monaco, Consolas, monospace;
    font-size: 0.86rem;
    line-height: 1.35;
}

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

.pagination-links {
    display: flex;
    gap: 1rem;
}

.pagination-links a {
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.inline-form {
    display: inline;
}

.inline-inline-form {
    margin-left: 0.5rem;
}

.link-button {
    background: transparent;
    color: var(--accent);
    padding: 0;
}

.link-danger {
    color: var(--err);
}

@media (max-width: 700px) {
    .brand-logo {
        width: 156px;
        max-width: 70vw;
    }

    nav {
        gap: 0.6rem;
        font-size: 0.95rem;
    }

    .site-header .wrap {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.6rem;
    }
}
