:root {
    --bg: #f3ecdd;
    --bg-card: #fbf6ec;
    --ink: #1d1810;
    --ink-muted: #6e5f4e;
    --line: #e0d4bc;
    --accent: #5b7a45;
    --accent-ink: #fbf6ec;
    --good: #4f7a4a;
    --bad: #a8392b;
    --warn: #c89344;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(60, 40, 15, 0.06), 0 14px 32px -18px rgba(60, 40, 15, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 18px/1.5 'Newsreader', Georgia, serif;
}

h1,
h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: var(--accent);
}

.muted {
    color: var(--ink-muted);
}

/* Header */
.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-card);
}

.brand {
    font: 600 22px 'Fraunces', Georgia, serif;
    color: var(--ink);
    text-decoration: none;
}

.menu,
.account,
.languages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.languages {
    gap: 4px;
}

.account {
    margin-left: auto;
}

.account form {
    margin: 0;
}

.languages .active {
    font-weight: 600;
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.card.narrow {
    max-width: 480px;
    margin: 32px auto;
}

.card h1 {
    margin-top: 0;
}

.heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 16px;
}

.details dt {
    font-weight: 500;
}

.details dd {
    margin: 0;
}

.details .message {
    white-space: pre-line;
}

/* Forms */
form label {
    display: block;
    margin-top: 12px;
    font-weight: 500;
}

form label.inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}

input:not([type='checkbox']),
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    font: inherit;
}

.checkboxes {
    margin: 16px 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 16px 12px;
}

.checkboxes label {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-weight: 400;
}

.button {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 18px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary {
    background: transparent;
    color: var(--accent);
}

.link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.link.danger {
    color: var(--bad);
}

.validation {
    display: block;
    color: var(--bad);
    font-size: 15px;
}

.validation ul {
    margin: 0;
    padding-left: 20px;
}

.external-logins {
    margin-top: 24px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.external-logins .button {
    margin: 4px 8px 0 0;
}

/* Messages */
.alert {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid;
}

.alert.success {
    border-color: var(--good);
    color: var(--good);
}

.alert.error {
    border-color: var(--bad);
    color: var(--bad);
}

.badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 14px;
    white-space: nowrap;
}

.badge.ok {
    background: #e3ecd9;
    color: var(--good);
}

.badge.pending {
    background: #f6e6c8;
    color: #8a5d1a;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.table th,
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.row-actions {
    display: flex;
    gap: 12px;
    white-space: nowrap;
}

.row-actions form {
    margin: 0;
}

/* Resources */
.resource-group {
    margin-bottom: 32px;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--ink);
    text-decoration: none;
    transition: transform 0.15s;
}

.tile:hover {
    transform: translateY(-2px);
}

@media (max-width: 700px) {
    .table thead {
        display: none;
    }

    .table tr {
        display: block;
        border-bottom: 1px solid var(--line);
    }

    .table td {
        display: block;
        border: 0;
        padding: 4px 12px;
    }
}
