:root {
    --bg: #f5f5f7;
    --panel: #fff;
    --text: #1a1a1a;
    --muted: #6b7280;
    --border: #e5e7eb;
    --brand: #c8102e;
    /* Colruyt red */
    --brand-dark: #8f0a20;
    --green: #059669;
    --red: #dc2626;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

/* --- Login --- */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #fff;
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 360px;
    max-width: 90%;
}

.login-card h1 {
    margin: 0 0 4px;
    font-size: 24px;
}

.login-card .sub {
    margin: 0 0 24px;
    color: var(--muted);
}

.login-card label {
    display: block;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--muted);
}

.login-card input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
}

.login-card input:focus {
    outline: 2px solid var(--brand);
    outline-offset: -1px;
    border-color: var(--brand);
}

.login-card button {
    width: 100%;
    padding: 11px;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.login-card button:hover {
    background: var(--brand-dark);
}

.error {
    background: #fee;
    color: #c00;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* --- Topbar --- */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    font-weight: 700;
    font-size: 18px;
}

.brand span {
    color: var(--brand);
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.stat {
    font-size: 13px;
    color: var(--muted);
}

.stat strong {
    color: var(--text);
}

.logout {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.logout:hover {
    color: var(--brand);
    border-color: var(--brand);
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.panel {
    background: var(--panel);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.panel h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    background: var(--bg);
    border-radius: 8px;
    font-size: 14px;
}

/* --- Forms --- */
.inline-form {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.inline-form input[type=text] {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.inline-form input:focus {
    outline: 2px solid var(--brand);
    outline-offset: -1px;
    border-color: var(--brand);
}

button,
.btn {
    padding: 9px 16px;
    border: 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: var(--brand);
    color: #fff;
}

button:hover {
    background: var(--brand-dark);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: #fee;
    color: var(--red);
    border: 1px solid #fcc;
}

.btn-danger:hover {
    background: var(--red);
    color: #fff;
}

/* --- Tables --- */
.tbl {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.tbl th,
.tbl td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.tbl th {
    font-weight: 600;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tbl code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.actions {
    text-align: right;
}

.actions form {
    margin-left: 4px;
}

/* --- Product grid --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.card-img {
    background: #fafafa;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.card-img img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.promo-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 3px;
    letter-spacing: 0.05em;
}

.card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.card-brand {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card h3 {
    margin: 2px 0;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 500;
}

.card-meta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
}

.price {
    font-size: 20px;
    font-weight: 700;
}

.price-old {
    text-decoration: line-through;
    color: var(--muted);
    font-size: 13px;
}

.unit {
    font-size: 12px;
    color: var(--muted);
}

.delta {
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}

.delta.up {
    color: var(--red);
}

.delta.down {
    color: var(--green);
}

.delta.neutral {
    color: var(--muted);
}

.detail-link {
    margin-top: 8px;
    font-size: 12px;
    color: var(--brand);
    text-decoration: none;
}

.detail-link:hover {
    text-decoration: underline;
}

/* --- Product detail --- */
.product-detail h1 {
    margin: 4px 0 8px;
    font-size: 22px;
}

.detail-head {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.detail-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    background: #fafafa;
    border-radius: 8px;
    padding: 12px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stats>div {
    background: var(--bg);
    padding: 12px;
    border-radius: 6px;
}

.stats span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stats strong {
    display: block;
    font-size: 17px;
    margin-top: 4px;
}

.chart-wrap {
    height: 320px;
    margin: 16px 0 32px;
}