/* Bare, functional styling — per the milestone's own scope boundary this is not a design pass. */

:root {
    color-scheme: light dark;
    --border: #888;
    --bg-alt: rgba(127, 127, 127, 0.08);
    --accent: #2b6cb0;
    --danger: #b02b2b;
}

* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    margin: 0;
    line-height: 1.4;
}

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 1.25rem 3rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.brand {
    font-weight: 600;
    text-decoration: none;
    color: inherit;
}

.logout-form { display: flex; align-items: center; gap: 0.5rem; }
.whoami { opacity: 0.7; font-size: 0.9em; }

.flash {
    max-width: 960px;
    margin: 0 auto 1rem;
    padding: 0.5rem 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.error {
    padding: 0.5rem 1rem;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 4px;
    margin-bottom: 1rem;
}

h1 { margin-top: 0; }

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

th, td {
    text-align: left;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border);
}

section.catalog, section.singletons {
    margin-bottom: 2rem;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.type-grid a {
    display: block;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
}

.type-grid a:hover { background: var(--bg-alt); }

fieldset {
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem 1rem;
}

legend { font-weight: 600; padding: 0 0.4rem; }

.field-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.6rem;
}

.field-row label { font-size: 0.92em; }
.field-row .tooltip { font-size: 0.8em; opacity: 0.7; }

.field-row input[type="text"],
.field-row input[type="number"],
.field-row select,
.field-row textarea {
    font-family: inherit;
    font-size: 1em;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: transparent;
    color: inherit;
    max-width: 480px;
}

.field-row textarea { max-width: 100%; min-height: 4.5em; font-family: ui-monospace, monospace; }

.checkbox-row { flex-direction: row; align-items: center; }
.checkbox-row input { width: auto; }

.actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; align-items: center; }

button, .button {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-alt);
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button.primary { border-color: var(--accent); }
button.danger, .button.danger { border-color: var(--danger); color: var(--danger); }

nav.breadcrumb { margin-bottom: 1rem; font-size: 0.9em; opacity: 0.8; }
nav.breadcrumb a { color: inherit; }

form.login-form {
    max-width: 320px;
    margin: 3rem auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

form.inline-delete { display: inline; }
