.input-error {
    border-color: var(--danger) !important;
    background: var(--danger-tint) !important;
}

/* TABS */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 14px;
}

.tab-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: -2px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 2px solid transparent;
}

.tab-link:hover {
    color: var(--text);
}

.tab-link.active {
    color: var(--primary);
    border-color: var(--primary);
}

.tab-link .nav-badge {
    background: var(--muted);
}

.tab-link.active .nav-badge {
    background: var(--primary);
}

/* CATEGORY SECTIONS */
.category-section-title {
    margin: 18px 0 6px;
    font-size: 13.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text);
}

.category-section-title:first-of-type {
    margin-top: 8px;
}

@media (min-width: 768px) {
    .category-table {
        table-layout: fixed;
    }

    .category-table td,
    .category-table th {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .category-table .cell-actions-td,
    .category-table .cell-wrap {
        white-space: normal;
    }

    .category-table .cell-actions {
        flex-wrap: wrap;
        white-space: normal;
    }
}

.cell-location-line {
    display: block;
}

.cell-location-line + .cell-location-line {
    margin-top: 2px;
}

/* CATEGORY STAT ROW */
.stat-row-categories {
    margin-top: -4px;
}

.stat-tile-category {
    text-decoration: none;
    color: inherit;
    display: block;
}

.stat-tile-link:hover {
    background: var(--primary-tint);
    cursor: pointer;
}

.stat-tile-active {
    background: var(--primary-tint);
    box-shadow: inset 0 -2px 0 var(--primary);
}

/* SEARCH BAR */
.search-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 0;
}

.search-bar form {
    display: flex;
    flex: 1;
}

.search-bar input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 12.5px;
}

.search-bar button {
    margin-left: 4px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    cursor: pointer;
    padding: 0 10px;
}

/* FORMS */
.stock-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stock-form label {
    font-weight: 700;
    color: var(--text);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.stock-form input,
.stock-form select {
    padding: 6px 8px;
    border: 1px solid var(--border);
    font-size: 13px;
    background: var(--surface);
}
.stock-form-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
	margin-right: 8px;
	margin-left: 2px;
}
.stock-form-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}
.stock-form button {
    padding: 7px 14px;
    border: 1px solid var(--primary-hover);
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    align-self: flex-start;
}

.stock-form button:hover {
    background: var(--primary-hover);
}

.quantity-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.quantity-row input {
    flex: 1;
}

/* Petit bouton dense des tableaux et des barres d'actions.
   Anciennement .btn-max : ce nom laissait croire à une sémantique
   "mettre au maximum", et remove.js s'accrochait dessus — donc aussi
   sur les boutons d'envoi, qu'il rendait inopérants. */
.btn-compact {
    padding: 3px 10px;
    cursor: pointer;
    border: 1px solid var(--primary-hover);
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
}

.btn-compact:hover {
    background: var(--primary-hover);
}

.loc-actions {
    display: flex;
    gap: 3px;
    justify-content: flex-end;
}

.btn-icon {
    padding: 2px 6px;
    min-width: 22px;
    cursor: pointer;
    border: 1px solid var(--primary-hover);
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 10.5px;
    line-height: 1.4;
}

.btn-icon:hover {
    background: var(--primary-hover);
}

.btn-icon:disabled {
    opacity: 0.35;
    cursor: default;
}

a.btn-icon {
    text-decoration: none;
    display: inline-block;
}

/* FREEZER VIEW (tab-selected: one header row per shelf, one row per product) */
.freezer-select {
    display: block;
    margin: 10px 0;
    padding: 6px 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    font-size: 13px;
    max-width: 260px;
}

.freezer-view-table .lot-row td {
    background: var(--bg);
    font-size: 11.5px;
    padding-left: 22px;
}

.freezer-view-table .shelf-row td {
    background: var(--toolbar-bg);
    color: var(--muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 4px 10px;
}

/* AUTH PAGES (login / register) */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 360px;
    border-top: 3px solid var(--primary);
}

.auth-title {
    text-align: center;
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.auth-switch {
    text-align: center;
    margin: 14px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.auth-switch a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

/* SETTINGS */
.invite-code {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--primary);
    text-align: center;
    margin: 6px 0 0;
    font-family: "SFMono-Regular", Consolas, monospace;
    border: 1px solid var(--border);
    background: var(--bg);
    padding: 6px;
}

.member-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.member-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

.member-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.logout-link {
    display: block;
    text-align: center;
    color: var(--danger);
    font-weight: 700;
    text-decoration: none;
    border-color: var(--danger);
}
