/* ---------------------------------------------------------------------------
   Tokens
   ------------------------------------------------------------------------ */
:root {
    --app-bg: #f6f7f9;
    --app-surface: #fff;
    --app-border: #e4e7eb;
    --app-text: #1d2939;
    --app-muted: #667085;
    --app-heading-bg: #344054;

    --status-green: #3fa66b;
    --status-green-bg: #e8f5ec;
    --status-green-border: #c6e6d1;
    --status-green-text: #1e6b43;
    --status-amber: #e0a030;
    --status-amber-bg: #fdf4e3;
    --status-amber-border: #f3dfb6;
    --status-amber-text: #8a5a00;
    --status-red: #d9534f;
    --status-red-bg: #fcebea;
    --status-red-border: #f4cdca;
    --status-red-text: #a12a26;
    --status-grey: #9aa3ad;
    --status-grey-bg: #f2f4f7;
    --status-grey-text: #475467;
}

body {
    background-color: var(--app-bg);
    color: var(--app-text);
}

.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1000;
    padding: 0.5rem 0.75rem;
    background: var(--app-surface);
    border-radius: 0.375rem;
}

/* ---------------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------------ */
.navbar-app {
    background-color: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
}

.navbar-app .navbar-brand {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.navbar-app .nav-link.active {
    font-weight: 600;
    color: var(--bs-primary);
}

/* ---------------------------------------------------------------------------
   Page layout
   ------------------------------------------------------------------------ */
.page-header {
    margin-bottom: 1.25rem;
}

.page-header .breadcrumb {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.page-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.page-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.page-subtitle {
    margin: 0.25rem 0 0;
    color: var(--app-muted);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-actions:empty {
    display: none;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.form-narrow {
    max-width: 28rem;
}

.auth-card {
    max-width: 22rem;
    margin: 3rem auto 0;
}

/* ---------------------------------------------------------------------------
   Cards, tables, empty states
   ------------------------------------------------------------------------ */
.card {
    border: 1px solid var(--app-border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

.card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.filter-bar {
    margin-bottom: 1rem;
}

.filter-bar .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: var(--app-muted);
}

.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state p {
    margin: 0;
    color: var(--app-muted);
}

.empty-state .btn {
    margin-top: 1rem;
}

.table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-muted);
    white-space: nowrap;
}

.table-compact {
    font-size: 0.875rem;
}

.table-compact > :not(caption) > * > * {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.row-actions {
    width: 1%;
    white-space: nowrap;
}

.text-code {
    font-family: var(--bs-font-monospace);
    font-size: 0.85em;
}

.settings-card {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.settings-card .card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-card:hover,
.settings-card:focus-visible {
    border-color: #c9cfd8;
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.07);
}

/* ---------------------------------------------------------------------------
   Status: muted colours, always paired with words
   ------------------------------------------------------------------------ */
.badge-muted,
.badge-open,
.badge-done {
    font-size: 0.7rem;
    font-weight: 600;
    vertical-align: middle;
}

.badge-muted {
    background-color: var(--status-grey-bg);
    color: var(--status-grey-text);
    border: 1px solid var(--app-border);
}

.badge-open {
    background-color: var(--status-amber-bg);
    color: var(--status-amber-text);
    border: 1px solid var(--status-amber-border);
}

.badge-done {
    background-color: var(--status-green-bg);
    color: var(--status-green-text);
    border: 1px solid var(--status-green-border);
}

.page-title .badge {
    margin-left: 0.5rem;
}

.notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--app-border);
    border-left-width: 4px;
    border-radius: 0.5rem;
    background-color: var(--app-surface);
}

.notice-amber {
    background-color: var(--status-amber-bg);
    border-color: var(--status-amber-border);
    border-left-color: var(--status-amber);
    color: var(--status-amber-text);
}

.notice-red {
    background-color: var(--status-red-bg);
    border-color: var(--status-red-border);
    border-left-color: var(--status-red);
    color: var(--status-red-text);
}

.notice-muted {
    background-color: var(--status-grey-bg);
    border-left-color: var(--status-grey);
    color: var(--status-grey-text);
}

/* ---------------------------------------------------------------------------
   Count sheet
   ------------------------------------------------------------------------ */
.count-sheet thead th {
    background-color: var(--app-heading-bg);
    color: #fff;
    font-weight: 700;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 0;
}

.count-sheet .row-location th {
    background-color: var(--status-grey-bg);
    color: var(--status-grey-text);
    font-size: 0.8rem;
    font-weight: 600;
    border-top: 1px solid var(--app-border);
}

.count-sheet tr.row-uncounted > td {
    background-color: var(--status-amber-bg);
}

.count-sheet tr.row-uncounted > td:first-child {
    box-shadow: inset 3px 0 0 var(--status-amber);
}

.uncounted-label {
    margin-left: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--status-amber-text);
}

.count-input {
    width: 5rem;
    margin-left: auto;
    text-align: right;
    font-size: 0.95rem;
}

.order-qty {
    display: inline-block;
    min-width: 1.75rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background-color: var(--status-amber-bg);
    color: var(--status-amber-text);
    font-weight: 600;
    text-align: center;
}

/* ---------------------------------------------------------------------------
   Print: a count prints as a clean sheet
   ------------------------------------------------------------------------ */
@media print {
    .navbar-app,
    .alert,
    .page-actions,
    .form-actions,
    .skip-link {
        display: none !important;
    }

    body {
        background-color: #fff;
    }

    .card {
        border: none;
        box-shadow: none;
    }

    a {
        text-decoration: none;
        color: inherit;
    }
}
