/* Stoneworks inventory — slab listing UI */

:root {
    --bg: #0f1210;
    --bg-elev: #171b18;
    --bg-card: #1e2320;
    --border: #2a312c;
    --text: #e8ebe9;
    --muted: #9aa39b;
    --accent: #c4a574;
    --accent-dim: #8a7350;
    --focus: #d4bc8a;
    --radius: 10px;
    --topbar-h: 56px;
    --sidebar-w: 300px;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}

a {
    color: var(--accent);
    text-decoration: none;
}

.fa,
.fa-brands, .fa-classic, .fa-duotone, .fa-light, .fa-regular,
.fa-sharp, .fa-sharp-duotone, .fa-solid, .fa-thin,
.fab, .fad, .fal, .far, .fas, .fass, .fat,
[class*="fa-"] {
    display: inline !important;
}

.layout {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    background: linear-gradient(180deg, #141816 0%, #0f1210 100%);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
}
.brand:hover {
    color: var(--accent);
    text-decoration: none;
}

.brand__mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3d4540 0%, #252a27 45%, #c4a574 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand__text {
    font-size: 1.05rem;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font: inherit;
    font-size: 0.875rem;
    line-height: 1;
    color: var(--muted);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    text-decoration: none;
}
a.user-pill,
button.user-pill {
    cursor: pointer;
}
a.user-pill:hover,
button.user-pill:hover,
a.user-pill:focus-visible,
button.user-pill:focus-visible {
    color: var(--accent);
    border-color: var(--accent-dim);
    outline: none;
}

.layout__body {
    display: flex;
    min-height: calc(100vh - var(--topbar-h));
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    padding: 1rem 1rem 2rem;
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.sidebar h2 {
    margin: 0 0 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.filter-form label {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
    margin-top: 0.65rem;
}
.filter-form label:first-of-type {
    margin-top: 0;
}

.filter-form input[type="text"],
.filter-form input[type="search"],
.filter-form input[type="number"],
.filter-form select {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
}
.filter-form input:focus,
.filter-form select:focus {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
    border-color: var(--accent-dim);
}

.filter-hint {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--muted);
}

.range-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover {
    border-color: var(--accent-dim);
    text-decoration: none;
}
.btn--primary {
    background: linear-gradient(180deg, #3a342c 0%, #2a2622 100%);
    border-color: var(--accent-dim);
    color: #f5f0e8;
}
.btn--primary:hover {
    border-color: var(--accent);
}

.btn--secondary {
    background: var(--bg-elev);
    border-color: var(--border);
    color: var(--text);
}

.btn--secondary:hover {
    border-color: var(--accent-dim);
    background: var(--bg-card);
}

.btn--sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

.btn--danger {
    background: transparent;
    border-color: rgba(200, 90, 90, 0.55);
    color: #e8a8a8;
}
.btn--danger:hover,
.btn--danger:focus-visible {
    border-color: #e07070;
    color: #fff0f0;
    background: rgba(200, 90, 90, 0.12);
    outline: none;
}

.main {
    flex: 1;
    padding: 1rem 1.25rem 2rem;
    min-width: 0;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.toolbar__meta {
    font-size: 0.9rem;
    color: var(--muted);
}

.toolbar__sort label {
    font-size: 0.8rem;
    color: var(--muted);
    margin-right: 0.35rem;
}

.toolbar__sort select {
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text);
}

.toolbar__right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.view-toggle {
    display: inline-flex;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg-elev);
}

.view-toggle__btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border: none;
    border-right: 1px solid var(--border);
    background: transparent;
}
.view-toggle__btn:last-child {
    border-right: none;
}
.view-toggle__btn:hover {
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
}
.view-toggle__btn.is-active {
    color: var(--accent);
    background: rgba(196, 165, 116, 0.12);
}

.inv-settings__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--muted);
    cursor: pointer;
    flex-shrink: 0;
}
.inv-settings__trigger:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
    background: rgba(196, 165, 116, 0.08);
}
.inv-settings__gear {
    display: block;
}

.inv-dialog {
    border: none;
    padding: 0;
    max-width: min(520px, 94vw);
    background: transparent;
    color: var(--text);
}
.inv-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}
.inv-dialog__inner {
    padding: 1.35rem 1.4rem 1.25rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}
.inv-dialog__title {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
    font-weight: 700;
}
.inv-dialog__hint {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.45;
}
.inv-dialog__hint-admin {
    display: block;
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--accent);
}
.inv-dialog__fieldset {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.85rem 0.85rem;
    margin: 0 0 1rem;
}
.inv-dialog__fieldset legend {
    padding: 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
}
.inv-dialog__checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.4rem 0.75rem;
    margin-top: 0.35rem;
}
.inv-dialog__checks--scroll {
    max-height: min(50vh, 360px);
    overflow-y: auto;
    padding-right: 0.25rem;
}
.inv-dialog__label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--text);
    cursor: pointer;
}
.inv-dialog__label input {
    flex-shrink: 0;
}
.inv-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* List view — condensed inventory table */
.inventory-list-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    margin-bottom: 0.5rem;
}

.inventory-list {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    font-size: 0.78rem;
    line-height: 1.35;
}

.inventory-list th,
.inventory-list td {
    padding: 0.4rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.inventory-list thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-elev);
    color: var(--muted);
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.inventory-list tbody tr:hover {
    background: rgba(196, 165, 116, 0.06);
}

.inventory-list__th-thumb {
    width: 72px;
}

.inventory-list__td-thumb {
    width: 72px;
    padding: 0.35rem 0.45rem !important;
}

.inventory-list__thumb-link {
    display: block;
    line-height: 0;
}

.inventory-list__thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #0a0c0b;
    display: block;
}

.inventory-list__thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.75rem;
}

.inventory-list__truncate {
    max-width: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-list__truncate--wide {
    max-width: 11rem;
}

.inventory-list__num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.inventory-list__td-actions {
    white-space: nowrap;
    padding-left: 0.35rem !important;
}
.inventory-list__td-actions a {
    font-weight: 600;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
}
.image-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.image-card:hover {
    border-color: var(--accent-dim);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.image-card__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    background: #0a0c0b;
    overflow: hidden;
    text-decoration: none;
}
.image-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}
.image-card:hover .image-card__img {
    transform: scale(1.03);
}
.image-card__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.8rem;
}
.image-card__footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-top: 1px solid var(--border);
    background: var(--bg-elev);
}
.image-card__name {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.image-card__name:hover,
.image-card__name:focus-visible {
    color: var(--accent);
    text-decoration: none;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
    border-color: var(--accent-dim);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.card__media {
    aspect-ratio: 4 / 3;
    background: #0a0c0b;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card__placeholder {
    color: var(--muted);
    font-size: 0.8rem;
    padding: 1rem;
    text-align: center;
}

.card__body {
    padding: 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.card__title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    margin: 0;
    color: var(--text);
}

.card__meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0;
}

.card__meta--dims {
    font-size: 0.9rem;
    color: var(--text);
}
.card__meta--dims strong {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.2rem;
}
.card__meta-sep {
    color: var(--muted);
    margin: 0 0.25rem;
}

.card__link {
    padding-top: 0.5rem;
    font-size: 0.85rem;
}

.inventory-list__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.pagination a,
.pagination span {
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.pagination a {
    background: var(--bg-elev);
    color: var(--text);
    text-decoration: none;
}
.pagination a:hover {
    border-color: var(--accent-dim);
}
.pagination .is-current {
    border-color: var(--accent);
    color: var(--accent);
}

.alert {
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--muted);
}

.detail-page {
    max-width: 960px;
}

.detail-page--slab {
    max-width: 1200px;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 720px) {
    .layout__body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .detail-hero {
        grid-template-columns: 1fr;
    }
}

.detail-photo {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    background: #0a0c0b;
}
.detail-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.dl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.65rem 1.25rem;
    margin: 0;
}
.dl-grid dt {
    margin: 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.dl-grid dd {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
}

.back-row {
    margin-bottom: 1rem;
}

/* Slab detail — hero + spec sheet */
.detail-back {
    font-size: 1rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.detail-back:hover {
    text-decoration: underline;
}

.slab-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 1.15fr);
    gap: 1.75rem;
    align-items: stretch;
    margin-bottom: 2rem;
    padding: 1.35rem 1.35rem 1.5rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(145deg, rgba(196, 165, 116, 0.06) 0%, var(--bg-card) 42%, var(--bg-elev) 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.slab-hero__visual {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(196, 165, 116, 0.25);
    background: #0a0c0b;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slab-hero__img {
    width: 100%;
    height: auto;
    max-height: min(52vh, 420px);
    object-fit: contain;
    display: block;
}
.slab-hero__img-trigger {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: zoom-in;
    font: inherit;
    color: inherit;
}
.slab-hero__img-trigger:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}
.slab-hero__zoom-hint {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(10, 12, 11, 0.75);
    color: #fff;
    font-size: 0.95rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.slab-hero__img-trigger:hover .slab-hero__zoom-hint,
.slab-hero__img-trigger:focus-visible .slab-hero__zoom-hint {
    opacity: 1;
}

.image-viewer {
    border: none;
    padding: 0;
    margin: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    background: rgba(0, 0, 0, 0.92);
    color: #fff;
    overflow: hidden;
}
.image-viewer::backdrop {
    background: rgba(0, 0, 0, 0.92);
}
.image-viewer__inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}
.image-viewer__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1rem;
    background: rgba(0, 0, 0, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 2;
}
.image-viewer__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f1ece1;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    min-width: 0;
}
.image-viewer__controls {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.image-viewer__zoom {
    min-width: 3.25rem;
    text-align: center;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: #d8d2c5;
    padding: 0 0.25rem;
}
.image-viewer__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #f1ece1;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.image-viewer__btn:hover,
.image-viewer__btn:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    outline: none;
}
.image-viewer__btn[aria-pressed="true"] {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: #fff;
}
.image-viewer__btn--close {
    margin-left: 0.4rem;
    border-color: rgba(255, 255, 255, 0.25);
}
.image-viewer__stage {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
}
.image-viewer__stage.is-pan-mode {
    cursor: grab;
}
.image-viewer__stage.is-pan-mode.is-grabbing {
    cursor: grabbing;
}
.image-viewer__img {
    max-width: 100%;
    max-height: 100%;
    transform-origin: center center;
    transition: transform 0.05s linear;
    will-change: transform;
    pointer-events: none;
}

.slab-hero__placeholder {
    padding: 3rem 1.5rem;
    color: var(--muted);
    font-size: 1.05rem;
}

.slab-hero__eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}

.slab-hero__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.slab-hero__subtitle {
    margin: 0 0 1rem;
    font-size: 1.2rem;
    color: var(--text);
    opacity: 0.92;
    line-height: 1.35;
}

.slab-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.slab-chip {
    margin: 0;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: rgba(15, 18, 16, 0.65);
    color: var(--text);
}

.slab-chip--accent {
    border-color: var(--accent-dim);
    color: var(--accent);
    background: rgba(196, 165, 116, 0.1);
}

.slab-spec {
    padding: 1.35rem 1.35rem 1.5rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.slab-spec__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.65rem;
    border-bottom: 2px solid rgba(196, 165, 116, 0.35);
}

.slab-spec__heading {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.slab-dl {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2rem;
    row-gap: 0;
    align-items: start;
}

.slab-dl__row {
    display: grid;
    grid-template-columns: minmax(0, 0.48fr) minmax(0, 1fr);
    column-gap: 1.25rem;
    row-gap: 0.35rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    align-items: start;
}

.slab-dl__dt {
    margin: 0;
    min-width: 0;
    padding-right: 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.slab-dl__dd {
    margin: 0;
    min-width: 0;
    font-size: 1.125rem;
    line-height: 1.5;
    color: var(--text);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.slab-dl__dd--media {
    font-size: 1rem;
}

.slab-thumb-link {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    text-decoration: none;
    color: var(--accent);
}

.slab-thumb-link:hover .slab-thumb {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(196, 165, 116, 0.2);
}

.slab-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0a0c0b;
    display: block;
}

.slab-thumb-caption {
    font-size: 0.95rem;
    text-decoration: underline;
}

.slab-dl__link {
    color: var(--accent);
    font-size: 1.05rem;
    word-break: break-all;
}

/* Similar slabs (detail page) */
.slab-similar {
    margin-top: 2rem;
    padding: 1.35rem 1.35rem 1.5rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.slab-similar__heading {
    margin: 0 0 0.45rem;
    padding-bottom: 0.55rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 2px solid rgba(196, 165, 116, 0.35);
}
.slab-similar__hint {
    margin: 0 0 1.1rem;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--muted);
}
.slab-similar__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.slab-similar__card {
    margin: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.slab-similar__card:hover {
    border-color: var(--accent-dim);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.slab-similar__link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.slab-similar__thumb-wrap {
    aspect-ratio: 4 / 3;
    background: #0a0c0b;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.slab-similar__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.slab-similar__thumb--empty {
    font-size: 0.75rem;
    color: var(--muted);
    padding: 0.75rem;
    text-align: center;
}
.slab-similar__body {
    padding: 0.65rem 0.75rem 0.85rem;
}
.slab-similar__title {
    margin: 0 0 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.slab-similar__sub {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.slab-similar__meta {
    margin: 0;
    font-size: 0.68rem;
    color: var(--muted);
    letter-spacing: 0.03em;
}

@media (max-width: 900px) {
    .slab-dl {
        grid-template-columns: 1fr;
        column-gap: 0;
    }
}

@media (max-width: 720px) {
    .slab-hero {
        grid-template-columns: 1fr;
    }
    .slab-dl__row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }
}

/* Top bar account nav */
.topbar__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    font-size: 0.875rem;
}
.topbar__nav a {
    color: var(--muted);
    text-decoration: none;
}
.topbar__nav a:hover {
    color: var(--accent);
}
.topbar__cta {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text) !important;
}
.topbar__cta:hover {
    border-color: var(--accent-dim);
}

.role-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    border: 1px solid var(--accent-dim);
    color: var(--accent);
    background: rgba(196, 165, 116, 0.08);
}
.role-badge--customer,
.role-badge--employee,
.role-badge--admin {
    border-color: var(--accent-dim);
    color: var(--accent);
}

.logout-form {
    display: inline;
    margin: 0;
}
.linkish {
    background: none;
    border: none;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.linkish:hover {
    color: var(--accent);
}

/* Flash */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}
.flash--success {
    border-color: #3d5a45;
    background: rgba(60, 90, 70, 0.25);
    color: #b8d4c4;
}
.flash--error {
    border-color: #6a3d3d;
    background: rgba(90, 50, 50, 0.25);
    color: #e8b8b8;
}
.flash--info {
    border-color: #4a5568;
    background: rgba(70, 85, 110, 0.2);
    color: var(--muted);
}

/* Auth pages */
.layout--auth .layout__body--auth {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem 3rem;
    min-height: calc(100vh - var(--topbar-h));
}
.auth-main {
    width: 100%;
    max-width: 420px;
}
.profile-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem 1.3rem;
    margin: 0 0 1.25rem;
    max-width: 36rem;
}
.profile-section__heading {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 600;
}
.profile-section__hint {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.45;
}
.profile-form button[type="submit"] {
    margin-top: 0.75rem;
}
.profile-actions {
    max-width: 36rem;
    display: flex;
    justify-content: flex-end;
    margin: 0.5rem 0 0;
}
.profile-actions .btn {
    min-width: 8rem;
}
.profile-section--danger {
    border-color: rgba(200, 90, 90, 0.45);
    background: rgba(200, 90, 90, 0.04);
}
.profile-section--danger .profile-section__heading {
    color: #e8a8a8;
}

.admin-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.admin-row-actions .inline-delete {
    margin: 0;
}
.admin-row-actions__self {
    font-size: 0.78rem;
    color: var(--muted);
}
.admin-table__actions {
    white-space: nowrap;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.35rem 1.35rem;
}
.auth-card__title {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    font-weight: 600;
}
.auth-card__hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 1rem;
    line-height: 1.45;
}
.auth-card__links {
    margin: 1rem 0 0;
    font-size: 0.875rem;
    color: var(--muted);
    text-align: center;
}

.form-stack label {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
    margin-top: 0.65rem;
}
.form-stack label:first-of-type {
    margin-top: 0;
}
.form-stack input {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
}
.form-stack input:focus {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}
.btn--block {
    width: 100%;
    margin-top: 1rem;
}

.btn--lg {
    padding: 0.85rem 1.6rem;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.main--landing {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 6rem);
    padding: 2rem 1.5rem;
}
.landing {
    max-width: 36rem;
    text-align: center;
    padding: 2.25rem 2rem 2.5rem;
    background: linear-gradient(145deg, rgba(196, 165, 116, 0.06) 0%, var(--bg-card) 45%, var(--bg-elev) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.landing__eyebrow {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}
.landing__title {
    margin: 0 0 0.9rem;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
}
.landing__lead {
    margin: 0 0 1.75rem;
    color: var(--muted);
    line-height: 1.55;
    font-size: 1rem;
}
.landing__actions {
    display: flex;
    justify-content: center;
}

/* Admin users table */
.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.admin-table th,
.admin-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.admin-table tr:last-child td {
    border-bottom: none;
}
.inline-role {
    display: inline;
    margin: 0;
}
.inline-role select {
    padding: 0.35rem 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.8rem;
    max-width: 10rem;
}

/* Admin — inventory filter config + live sidebar preview */
.admin-config-intro {
    margin: 0 0 1.25rem;
    max-width: none;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}
.admin-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin: 0 0 1.5rem;
}
.admin-dashboard__tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.4rem 1.1rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    transition: border-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}
.admin-dashboard__tile:hover,
.admin-dashboard__tile:focus-visible {
    border-color: var(--accent-dim);
    transform: translateY(-1px);
    outline: none;
}
.admin-dashboard__tile-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.25rem;
    border-radius: 50%;
    background: var(--bg-elev);
    color: var(--accent);
    font-size: 1.4rem;
    line-height: 1;
}
.admin-dashboard__tile:hover .admin-dashboard__tile-icon,
.admin-dashboard__tile:focus-visible .admin-dashboard__tile-icon {
    color: var(--accent);
    background: var(--bg-card);
    border: 1px solid var(--accent-dim);
}
.admin-dashboard__tile-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}
.admin-dashboard__tile-desc {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
}
.admin-config-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, min(360px, 100%));
    gap: 1.5rem 2rem;
    align-items: start;
}
@media (max-width: 960px) {
    .admin-config-layout {
        grid-template-columns: 1fr;
    }
}
.admin-config-fieldset {
    margin: 1.25rem 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}
.admin-config-legend {
    font-weight: 600;
    padding: 0 0.35rem;
}
.admin-config-checks {
    display: grid;
    gap: 0.5rem;
}
.admin-config-label {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    cursor: pointer;
}
.admin-config-label__wrap {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}
.admin-config-label__text {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}
.admin-config-label__example {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--muted);
    word-break: break-word;
}
.admin-config-label__ex-title {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.1rem;
}
.admin-config-bulk {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 0 0 0.65rem;
}
.slab-detail-order-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    max-width: 40rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.slab-detail-order-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    cursor: grab;
    user-select: none;
}
.slab-detail-order-item:active {
    cursor: grabbing;
}
.slab-detail-order-item--dragging {
    opacity: 0.65;
}
.slab-detail-order-item--drop-above::before,
.slab-detail-order-item--drop-below::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 0 1px rgba(196, 165, 116, 0.35);
    pointer-events: none;
}
.slab-detail-order-item--drop-above::before {
    top: -7px;
}
.slab-detail-order-item--drop-below::after {
    bottom: -7px;
}
.slab-detail-order-item__grip {
    flex-shrink: 0;
    width: 0.35rem;
    align-self: stretch;
    min-height: 1.5rem;
    border-radius: 3px;
    background: repeating-linear-gradient(
        180deg,
        var(--muted) 0 2px,
        transparent 2px 5px
    );
    opacity: 0.45;
}
.slab-detail-order-item__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}
.slab-detail-order-item__label {
    font-weight: 600;
    font-size: 0.95rem;
}
.slab-detail-order-item__code {
    font-size: 0.72rem;
    color: var(--muted);
}
.admin-config-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.admin-config-preview-caption {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}
.admin-config-preview-sidebar.sidebar {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    max-height: min(70vh, 720px);
    overflow-y: auto;
}
.admin-config-preview-empty {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.45;
}
@media (min-width: 961px) {
    .admin-config-col--preview {
        position: sticky;
        top: 1rem;
    }
}
