:root {
    color-scheme: light;
    font-family: system-ui, sans-serif;
    background: #f2f6f3;
    color: #19251f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

.auth-page {
    min-height: 100vh;
    padding: 1rem;
    display: grid;
    place-items: center;
}

.panel {
    width: min(100%, 27rem);
    padding: clamp(1.25rem, 5vw, 2rem);
    border: 1px solid #cddad1;
    border-top: 0.3rem solid #17643e;
    border-radius: 1rem;
    background: #fff;
}

.wordmark {
    margin: 0 0 1rem;
    font-weight: 700;
    color: #17643e;
}

h1 {
    margin: 0;
    font-size: 2rem;
}

.intro {
    margin: 0.5rem 0 1.5rem;
    color: #45564c;
    line-height: 1.5;
}

form {
    display: grid;
    gap: 0.5rem;
}

label {
    font-weight: 600;
}

input, select, button {
    min-height: 3rem;
    border-radius: 0.5rem;
    font: inherit;
}

input, select {
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.65rem;
    border: 1px solid #74837a;
}

button {
    padding: 0.65rem 1rem;
    border: 0;
    background: #17643e;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: #104c2f;
}

:focus-visible {
    outline: 3px solid #17643e;
    outline-offset: 2px;
}

.error {
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #fce8e7;
    color: #8c201d;
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 4rem;
    padding: 0.75rem clamp(1rem, 4vw, 2rem);
    border-bottom: 1px solid #cddad1;
    background: #fff;
}

.topbar .wordmark {
    margin: 0;
    text-decoration: none;
}

.account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    overflow-wrap: anywhere;
}

.account small {
    color: #45564c;
}

.dashboard {
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
    gap: 1.25rem;
    max-width: 86rem;
    margin: 0 auto;
    padding: 1.25rem clamp(1rem, 4vw, 2rem);
}

.sidebar, .workspace {
    align-self: start;
    padding: 1rem;
    border: 1px solid #cddad1;
    border-radius: 0.75rem;
    background: #fff;
}

.workspace {
    padding: clamp(1rem, 4vw, 2rem);
}

.sidebar a {
    display: block;
    padding: 0.65rem;
    border-radius: 0.5rem;
    color: #19251f;
    text-decoration: none;
}

.sidebar a:hover, .sidebar a[aria-current="page"] {
    background: #e5f2e9;
    color: #104c2f;
}

.sidebar a[aria-current="page"] {
    font-weight: 700;
}

.nav-group {
    margin: 0.9rem 0 0.15rem;
    padding-left: 0.65rem;
    color: #45564c;
    font-size: 0.85rem;
    font-weight: 700;
}

.nav-group:first-child {
    margin-top: 0;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: 0.75rem;
}

.quick-links a {
    padding: 1rem;
    border: 1px solid #cddad1;
    border-radius: 0.5rem;
    color: #104c2f;
    font-weight: 700;
}

.quick-links a:hover {
    background: #e5f2e9;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.65rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: #17643e;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.button:hover {
    background: #104c2f;
}

.button.secondary {
    border-color: #74837a;
    background: #fff;
    color: #19251f;
}

.button.secondary:hover {
    background: #e5f2e9;
}

.button.compact {
    min-height: 2.5rem;
    padding: 0.4rem 0.75rem;
}

.workspace-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.workspace-heading .intro {
    margin-bottom: 0;
}

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

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

th, td {
    padding: 0.8rem;
    border-bottom: 1px solid #cddad1;
    text-align: left;
}

th {
    background: #f2f6f3;
}

td a {
    color: #104c2f;
}

.account-form {
    max-width: 30rem;
}

.account-form small {
    margin: -0.5rem 0 0.5rem;
    color: #45564c;
}

.account-role {
    margin: 0 0 0.5rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.notice {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: #f2f6f3;
    color: #45564c;
}

.notice.success {
    margin-top: 0;
    background: #e5f2e9;
    color: #104c2f;
}

.error-list {
    padding-left: 2rem;
}

.catalog-navigation {
    margin: 1rem 0 1.5rem;
}

.barcode-form {
    min-width: 12rem;
    margin-top: 0.75rem;
}

.barcode-form label {
    font-size: 0.85rem;
}

.brand-autocomplete {
    position: relative;
}

.brand-suggestions {
    position: absolute;
    z-index: 2;
    top: calc(100% - 0.5rem);
    left: 0;
    right: 0;
    max-height: 15rem;
    margin: 0;
    padding: 0.25rem;
    overflow-y: auto;
    list-style: none;
    border: 1px solid #74837a;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 0.3rem 0.8rem #19251f26;
}

.brand-suggestions button {
    width: 100%;
    text-align: left;
    background: #fff;
    color: #19251f;
}

.brand-suggestions button:hover,
.brand-suggestions button[aria-selected="true"] {
    background: #e5f2e9;
}

.brand-status {
    margin: 0 0 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #f2f6f3;
    line-height: 1.5;
}

.brand-status[data-state="existing"] {
    background: #e5f2e9;
    color: #104c2f;
}

.brand-status[data-state="new"] {
    background: #fff4d6;
    color: #634600;
}

code {
    overflow-wrap: anywhere;
}

@media (max-width: 45rem) {
    .dashboard {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.2rem;
    }

    .nav-group {
        grid-column: 1 / -1;
    }
}
