:root {
    --green: #1d4a32;
    --green-dark: #143626;
    --line: #d7e0d8;
    --paper: #eef2ef;
    --card: #ffffff;
    --text: #1c241e;
    --muted: #5c6b60;
    --danger: #8d2b2b;
}

* { box-sizing: border-box; }

html,
body {
    height: 100%;
}

body {
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--text);
    background: var(--paper);
}

.top {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--green);
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 650;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.top nav {
    display: flex;
    gap: 0.9rem;
}

.top a {
    color: #fff;
    text-decoration: none;
}

.top a:hover { text-decoration: underline; }

main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
}

.flash {
    flex: 0 0 auto;
    margin: 0;
    background: #e7f3ea;
    padding: 0.55rem 1rem;
}

.screen,
.split {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

.screen {
    overflow: auto;
    padding: 1rem 1.1rem 1.5rem;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem);
    overflow: hidden;
}

.split.groups-layout {
    grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
}

.pane {
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.1rem 1.5rem;
    background: var(--card);
}

.pane + .pane {
    border-left: 1px solid var(--line);
}

h1 {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
}

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

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    align-content: start;
}

.tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 9rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    background: var(--card);
    color: inherit;
    text-decoration: none;
}

.tile strong {
    font-size: 1.15rem;
}

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

.tile:hover {
    background: #f7faf8;
}

.rights {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1.25rem 1.5rem;
    margin-top: 1.2rem;
    align-content: start;
}

.rights h2 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.rights .check {
    margin-top: 0.35rem;
    font-weight: 500;
}

label {
    display: block;
    margin: 0.85rem 0 0.3rem;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    display: block;
    width: 32ch;
    max-width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid #b7c4ba;
    border-radius: 0;
    font: inherit;
}

input[name="display_name"],
input[name="name"],
input[type="email"] {
    width: 48ch;
    max-width: 100%;
}

.pane h2 {
    margin: 1rem 0 0.3rem;
    font-size: 1rem;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.9rem;
    font-weight: 600;
}

button,
.button {
    display: inline-block;
    margin-top: 1rem;
    margin-right: 0.4rem;
    background: var(--green);
    color: #fff;
    border: 0;
    border-radius: 0;
    padding: 0.55rem 0.95rem;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover { background: var(--green-dark); }

.error {
    background: #fdecec;
    color: var(--danger);
    padding: 0.6rem 0.75rem;
}

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

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

th { font-size: 0.85rem; color: var(--muted); }

.actions { white-space: nowrap; }

@media (max-width: 800px) {
    .split { grid-template-columns: 1fr; }
    .pane + .pane { border-left: 0; border-top: 1px solid var(--line); }
}
