/* ── ViewSwitcher widget ─────────────────────────────── */
.view-switcher {
    display: inline-flex;
    gap: 2px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 3px;
}

.vs-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 1rem;
}

.vs-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.vs-btn.vs-active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* ── Grid layout ─────────────────────────────────────── */
.vs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* ── List layout ─────────────────────────────────────── */
.vs-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vs-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 16px;
    transition: background 0.15s;
}

.vs-list-row:hover {
    background: #f9fafb;
}

.vs-list-name {
    flex: 1;
    font-weight: 500;
    color: #111827;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vs-list-meta {
    color: #6b7280;
    font-size: 0.875rem;
    white-space: nowrap;
}

.vs-list-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Table layout ────────────────────────────────────── */
.vs-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.vs-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 0.875rem;
}

.vs-table thead th {
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.vs-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    vertical-align: middle;
}

.vs-table tbody tr:last-child td {
    border-bottom: none;
}

.vs-table tbody tr:hover td {
    background: #f9fafb;
}

.vs-table .vs-actions-cell {
    white-space: nowrap;
}

/* ── Mobile: List view ───────────────────────────────── */
@media (max-width: 640px) {

    /* Two-column layout: [info block] [actions] */
    .vs-list-row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        gap: 4px 10px;
        padding: 10px 12px;
    }

    /* Name spans full left column, first row */
    .vs-list-name {
        grid-column: 1;
        grid-row: 1;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        font-size: 0.9rem;
        font-weight: 600;
    }

    /* Meta (price, badges) sits below the name */
    .vs-list-meta {
        grid-column: 1;
        grid-row: 2;
        font-size: 0.8rem;
        white-space: normal;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
    }

    /* Actions span both rows on the right */
    .vs-list-actions {
        grid-column: 2;
        grid-row: 1 / span 2;
        display: flex;
        flex-direction: column;
        gap: 4px;
        align-items: flex-end;
        justify-content: center;
    }

    /* Compact action buttons */
    .vs-list-actions .btn,
    .vs-list-actions button {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        line-height: 1.2;
    }
}

/* ── Mobile: Table view ──────────────────────────────── */
@media (max-width: 640px) {

    /* Keep horizontal scroll, just tighten spacing */
    .vs-table {
        font-size: 0.78rem;
        min-width: 480px; /* forces scroll rather than squishing */
    }

    .vs-table thead th,
    .vs-table tbody td {
        padding: 8px 8px;
    }

    .vs-table .vs-actions-cell .btn,
    .vs-table .vs-actions-cell button {
        padding: 0.2rem 0.4rem;
        font-size: 0.72rem;
    }
}

/* ── Priority-based list row (shared across admin pages) ─ */
.order-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
}

.order-list-left {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.order-list-primary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.88rem;
    margin-bottom: 3px;
}

.order-list-secondary {
    font-size: 0.76rem;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}

.order-list-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Table text alignment ─────────────────────────────── */
.vs-table tbody td {
    text-align: left;
}

.vs-table thead th {
    text-align: left;
}

/* ── Header actions — wrap on mobile ─────────────────── */
@media (max-width: 640px) {
    .header-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 8px;
    }

    .clean-add-btn,
    .modern-add-btn {
        font-size: 0.82rem;
        padding: 0.4rem 0.8rem;
    }
}

/* ── Priority list row — desktop ─────────────────────── */
.order-list-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    min-width: 0;
}

.order-list-left {
    min-width: 0;
    text-align: left;
}

.order-list-primary {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.88rem;
    margin-bottom: 4px;
    line-height: 1.3;
}

.order-list-secondary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 0.76rem;
    color: #6b7280;
    line-height: 1.4;
}

.order-list-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    align-self: center;
}

/* ── Mobile: tighten further ─────────────────────────── */
@media (max-width: 480px) {
    .order-list-row {
        padding: 8px 10px;
        gap: 6px;
    }

    .order-list-primary {
        font-size: 0.83rem;
        gap: 4px;
        margin-bottom: 3px;
    }

    .order-list-secondary {
        font-size: 0.72rem;
        gap: 3px;
    }

    .order-list-right .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.72rem;
    }
}
