:root {
    --green: #77b122;
    --green-dark: #5e8d19;
    --ink: #1f2a1a;
    --muted: #66705f;
    --line: #e2e6dc;
    --bg: #f6f7f3;
    --card: #ffffff;
    --danger: #c0392b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: var(--ink);
    background: var(--bg);
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 12px 20px;
    background: var(--ink);
}
.brand { color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; }
.brand span { color: var(--green); }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.topbar nav a, .topbar nav .link { color: #dfe6d6; text-decoration: none; font-size: 14px; }
.topbar nav a:hover, .topbar nav .link:hover { color: #fff; }
.topbar form { margin: 0; }

main { max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }
h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 20px; }

.flash { padding: 12px 14px; border-radius: 6px; margin-bottom: 18px; background: #e9f5d8; border: 1px solid #c9e3a3; }
.flash.error { background: #fbe9e7; border-color: #f0bdb6; color: #7d2318; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }

.btn, button.btn {
    display: inline-block;
    padding: 9px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--green);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--green-dark); }
.btn.secondary { background: #e7eadf; color: var(--ink); }
.btn.secondary:hover { background: #d9ddcf; }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 13px; }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

label { display: block; font-weight: 600; margin: 16px 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=number], input[type=password], textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #cfd5c6;
    border-radius: 6px;
    font: inherit;
    background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-top: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; align-items: center; }

/* Product list */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 16px; }
.products { display: grid; gap: 10px; }
.product {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 14px;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 14px;
}
.product.hidden { opacity: .6; }
.product img { width: 64px; height: 64px; object-fit: contain; background: #fafbf8; border-radius: 6px; }
.product .name { font-weight: 600; }
.product .meta { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: #eceee8; color: var(--muted); margin-left: 6px; vertical-align: middle; }
.price-form { display: flex; align-items: center; gap: 6px; }
.price-form .naira { color: var(--muted); font-weight: 600; }
.price-form input { width: 110px; }

.current-image { display: flex; gap: 14px; align-items: center; margin-top: 6px; }
.current-image img { width: 120px; height: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fafbf8; }

.login { max-width: 380px; margin: 60px auto 0; }

@media (max-width: 640px) {
    .product { grid-template-columns: 56px 1fr; }
    .product img { width: 56px; height: 56px; }
    .product .controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
}

/* Team admin */
.group-title { font-size: 18px; margin: 30px 0 12px; }
.group-title .hint { font-size: 14px; font-weight: 400; }
.empty { color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 8px; padding: 16px; }
.avatar, .product img.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #fafbf8; }
.avatar.initials { display: grid; place-items: center; background: linear-gradient(160deg, #5b8a35, #114f35); color: #fff; font-weight: 800; font-size: 20px; }
.tag.on { background: #e9f5d8; color: var(--green-dark); }
.type-choice { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.type-choice legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 14px; border: 1px solid #cfd5c6; border-radius: 8px; cursor: pointer; font-weight: 400; }
.radio-card:has(input:checked) { border-color: var(--green); background: #f3f9ea; }
.radio-card input { margin-top: 4px; accent-color: var(--green); }
.radio-card .hint { display: block; }
@media (max-width: 640px) { .type-choice { grid-template-columns: 1fr; } .avatar { width: 56px; height: 56px; } }
