/* Scanner+ — hand-rolled, no framework. Echoes the old dark-navbar look. */

:root {
    --bar: #222;
    --bar-text: #9d9d9d;
    --accent: #2c7be5;
    --border: #ddd;
    --muted: #777;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #222;
    background: #fafafa;
}

.navbar {
    background: var(--bar);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0 1rem;
    min-height: 50px;
}

.navbar .brand {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    margin-right: .5rem;
}

.navbar a {
    color: var(--bar-text);
    text-decoration: none;
    padding: .9rem 0;
}

.navbar a:hover,
.navbar a.active { color: #fff; }

.nav-logout { margin-left: auto; }
.nav-logout .link-button { color: var(--bar-text); }
.nav-logout .link-button:hover { color: #fff; }

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 22rem;
}

.login-form label { display: flex; flex-direction: column; gap: .25rem; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

h1 { font-weight: 500; }
.current-product { color: var(--accent); }

.flash {
    background: #fff3cd;
    border: 1px solid #ffe69c;
    padding: .6rem .9rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.flash.error { background: #f8d7da; border-color: #f1aeb5; }

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

#scannerinput {
    font-size: 1.6rem;
    padding: .5rem .75rem;
    width: min(28rem, 100%);
    border: 2px solid var(--accent);
    border-radius: 8px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .75rem 1rem;
}

.product-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

.product-card h4 {
    margin: 0 0 .5rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
}

.product-card h4 a { color: inherit; text-decoration: none; }
.product-card h4 a:hover { color: var(--accent); }

.count {
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: .8rem;
    padding: .1rem .55rem;
}

.card-actions { margin: .25rem 0; }

.scan-list {
    margin: .5rem 0;
    padding-left: 1.5rem;
    font-family: ui-monospace, monospace;
    font-size: .8rem;
    max-height: 16rem;
    overflow-y: auto;
}

.link-button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    font-size: .85rem;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: 1.5rem;
}

.filter-bar label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; }

table {
    border-collapse: collapse;
    width: 100%;
    background: #fff;
}

th, td {
    text-align: left;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
}

td.num, th.num { text-align: right; }

tr.inactive td { color: var(--muted); }

.history-day { margin-bottom: 1.75rem; }
.history-day h3 { margin-bottom: .5rem; }

/* Every day renders its own table; fixed column widths keep the Scans
   figures and Download links lined up from one day to the next. */
.history-day table { table-layout: fixed; }
.history-day th.num, .history-day td.num { width: 7rem; }
.history-day th:last-child, .history-day td:last-child { width: 11rem; }

input[type="text"], input[type="date"], input[type="number"], select {
    padding: .4rem .5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .95rem;
}

.sort-input { width: 4rem; }

button, .button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: .45rem .9rem;
    font-size: .95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover, .button:hover { filter: brightness(1.1); }

.add-product { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.add-product label { display: flex; flex-direction: column; gap: .25rem; }
