:root {
    --brand-red: #D10000;
    --brand-grey: #757575;
    --brand-white: #ffffff;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f5f5f5;
    color: #222;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
}

header.brand {
    background: var(--brand-red);
    color: var(--brand-white);
    padding: 12px 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

header.brand img {
    height: 48px;
    width: 48px;
    border-radius: 50%;
    background: #fff;
}

header.brand h1 {
    margin: 0;
    font-size: 1.3rem;
}

.card {
    background: var(--brand-white);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    padding: 16px;
    margin-bottom: 16px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    gap: 8px;
    flex-wrap: wrap;
}

.item-row:last-child { border-bottom: none; }

.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.btn {
    display: inline-block;
    background: var(--brand-red);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-grey {
    background: var(--brand-grey);
}

.btn-small {
    padding: 4px 10px;
    font-size: 0.8rem;
}

input, select, textarea {
    width: 100%;
    padding: 8px;
    margin: 4px 0 12px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.notice {
    background: #fff3cd;
    border: 1px solid #ffe69c;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

a { color: var(--brand-red); }

.top-nav {
    background: #222;
    padding: 10px 16px;
}
.top-nav a {
    color: #fff;
    margin-right: 16px;
    text-decoration: none;
    font-size: 0.9rem;
}

/* Compact customer-facing item table — name wraps, everything else stays on one line */
.items-table-wrap {
    overflow-x: auto;
}
.items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.items-table th, .items-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}
.items-table td.item-name-cell {
    max-width: 200px;
    white-space: normal;
    word-break: break-word;
}
.items-table .status-pill {
    font-size: 0.72rem;
    padding: 2px 8px;
    white-space: nowrap;
}
.items-table .item-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.items-table .item-actions .btn {
    padding: 3px 8px;
    font-size: 0.72rem;
}
.items-table .sub-note {
    font-size: 0.72rem;
    color: var(--brand-grey);
    margin-top: 2px;
}

/* Below this width, each table row becomes its own labeled card instead
   of a cramped horizontal-scroll table — no sideways scrolling, and
   buttons get full width so they're easy to tap. */
@media (max-width: 600px) {
    .items-table thead { display: none; }
    .items-table, .items-table tbody, .items-table tr, .items-table td {
        display: block;
        width: 100%;
    }
    .items-table tr {
        margin-bottom: 12px;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 10px;
    }
    .items-table tr:last-child { margin-bottom: 0; }
    .items-table td {
        border-bottom: none;
        padding: 4px 2px;
        text-align: left;
        max-width: none;
    }
    .items-table td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        font-size: 0.7rem;
        color: var(--brand-grey);
        text-transform: uppercase;
        letter-spacing: 0.02em;
        margin-bottom: 2px;
    }
    .items-table .item-actions {
        flex-direction: column;
        gap: 6px;
    }
    .items-table .item-actions .btn {
        width: 100%;
        text-align: center;
        padding: 10px;
        font-size: 0.85rem;
    }
}
