/* Mobile first: designed for 360 px width, tables/two-pane layouts from 768 px up. */
:root {
    --bottom-nav-height: 4rem;
    --tap-size: 44px;
}

body {
    padding-bottom: calc(var(--bottom-nav-height) + 1rem);
}

.narrow {
    max-width: 28rem;
    padding-top: 2rem;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.topbar-title {
    flex: 1;
    font-size: 1.1rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-size);
    padding-right: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.location-switch {
    margin: 0;
}

.location-switch select {
    margin: 0;
    min-height: var(--tap-size);
}

.location-name {
    font-size: 0.9rem;
}

.flash,
.flash-error {
    padding: 0.75rem 1rem;
    border-radius: var(--pico-border-radius);
}

.flash {
    background: var(--pico-ins-color, #d4edda);
    color: #000;
}

.flash-error {
    background: var(--pico-del-color, #f8d7da);
    color: #000;
}

button,
[role="button"],
input[type="submit"] {
    min-height: var(--tap-size);
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottom-nav-height);
    background: var(--pico-background-color);
    border-top: 1px solid var(--pico-muted-border-color);
    z-index: 10;
}

.bottom-nav ul {
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0 1rem;
    height: 100%;
    list-style: none;
}

.bottom-nav li {
    position: relative;
    flex: 1;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bottom-nav a,
.bottom-nav .nav-disabled {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    height: 100%;
    min-height: var(--tap-size);
    padding: 0.25rem 0;
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
    font-size: 0.75rem;
    line-height: 1.1;
}

.nav-icon {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav a[aria-current="page"] {
    font-weight: 700;
    border-top: 3px solid var(--pico-primary);
}

/* Pending-transfer count: a small bubble on the corner of the Transfer icon. */
#pending-badge {
    position: absolute;
    top: 0.2rem;
    left: calc(50% + 0.6rem);
    pointer-events: none;
}

#pending-badge:empty {
    display: none;
}

.nav-disabled {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: var(--tap-size);
    text-decoration: none;
    font-size: 0.85rem;
}

.bottom-nav a[aria-current="page"] {
    font-weight: 700;
    border-top: 3px solid var(--pico-primary);
}

.nav-disabled {
    opacity: 0.45;
}

.menu-list {
    list-style: none;
    padding: 0;
}

.menu-list li {
    padding: 0;
    margin: 0;
}

.menu-list a,
.menu-list .nav-disabled {
    display: flex;
    align-items: center;
    min-height: var(--tap-size);
}

@media (min-width: 768px) {
    .bottom-nav ul {
        max-width: 40rem;
        margin: 0 auto;
    }
}

/* Lists of records (users, locations, articles ...): one card per record, fine on a 360 px phone. */
.records {
    list-style: none;
    padding: 0;
}

.records li {
    margin: 0 0 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    list-style: none;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.actions form {
    margin: 0;
}

.actions a,
.actions button {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-size);
}

.actions button {
    margin: 0;
    width: auto;
}

.badge {
    margin-left: 0.5rem;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    background: var(--pico-muted-border-color);
    font-size: 0.75rem;
}

.field-error {
    color: var(--pico-del-color);
}

.filters {
    display: grid;
    gap: 0.5rem;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 768px) {
    .filters {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

/* M2: stock screens, exits, movement history */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tabs a[aria-current="page"] {
    font-weight: bold;
    text-decoration: underline;
}

.badge-danger {
    background: var(--pico-del-color, #f8d7da);
    color: #000;
}

.exit-line {
    margin-bottom: 1rem;
}

.picker-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
}

.picker-list button {
    width: 100%;
    text-align: left;
    min-height: var(--tap-size);
}

.total {
    text-align: right;
}

/* "+" button that adds another article/quantity row (transfer form). */
.add-row {
    width: auto;
    min-width: var(--tap-size);
    margin-bottom: 1rem;
    font-size: 1.4rem;
    line-height: 1;
}
