/* =============================================================
   Pro-SMV — Master Data pages (Customer, Style, Machine, etc.)
   Drop into wwwroot/css/master.css and reference once in App.razor.
   Namespaced under .psm-* so it sits cleanly next to other styles.
   ============================================================= */

.psm-page,
.psm-page * {
    box-sizing: border-box;
}

.psm-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0a0a0a;
    padding: 0;
}

/* =============================================================
   TOOLBAR — Add New + Search + View Toggle + Export
   ============================================================= */
.psm-toolbar {
    background: #ffffff;
    border-radius: 12px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 14px 18px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.psm-toolbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.psm-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.psm-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(180deg, #1a2454, #0a0e1a);
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
    text-decoration: none;
}

    .psm-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(139, 92, 246, 0.35);
        color: #ffffff;
    }

    .psm-btn-primary i {
        font-size: 16px;
        color: #ffffff;
    }

.psm-count-chip {
    font-size: 11.5px;
    color: rgba(0, 0, 0, 0.55);
}

    .psm-count-chip strong {
        color: #0a0a0a;
        font-weight: 600;
    }

/* Search box */
.psm-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.03);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    width: 260px;
    transition: background 0.15s, border-color 0.15s;
}

    .psm-search:focus-within {
        background: #ffffff;
        border-color: rgba(139, 92, 246, 0.4);
        box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    }

    .psm-search i.psm-search-icon {
        font-size: 14px;
        color: rgba(0, 0, 0, 0.4);
    }

    .psm-search input {
        border: none;
        outline: none;
        background: transparent;
        flex: 1;
        font-size: 12.5px;
        min-width: 0;
        font-family: inherit;
        color: #0a0a0a;
    }

        .psm-search input::placeholder {
            color: rgba(0, 0, 0, 0.4);
        }

.psm-search-clear {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

    .psm-search-clear:hover {
        color: rgba(0, 0, 0, 0.5);
    }

/* View toggle (Grid / Table) */
.psm-view-toggle {
    display: inline-flex;
    padding: 3px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    gap: 2px;
}

.psm-view-btn {
    background: transparent;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.15s;
    font-family: inherit;
}

    .psm-view-btn i {
        font-size: 14px;
        color: rgba(0, 0, 0, 0.45);
    }

    .psm-view-btn:hover {
        background: rgba(0, 0, 0, 0.04);
    }

    .psm-view-btn.is-active {
        background: #ffffff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    }

        .psm-view-btn.is-active i {
            color: #8b5cf6;
        }

/* Secondary button (Export, etc) */
.psm-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

    .psm-btn-ghost:hover {
        background: rgba(139, 92, 246, 0.06);
        color: #8b5cf6;
        border-color: rgba(139, 92, 246, 0.3);
    }

    .psm-btn-ghost i {
        font-size: 14px;
    }

/* =============================================================
   GRID OF CARDS
   ============================================================= */
.psm-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.psm-card {
    background: #ffffff;
    border-radius: 14px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .psm-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }

/* Gradient header strip */
.psm-card-head {
    height: 6px;
    position: relative;
    border-radius: 14px 14px 0 0;
}

    .psm-card-head.g-1 {
        background: #1a2454;
    }

    .psm-card-head.g-2 {
        background: #F5BB16;
    }

    .psm-card-head.g-3 {
        background: #6366f1;
    }

    .psm-card-head.g-4 {
        background: #10b981;
    }

    .psm-card-head.g-5 {
        background: #0a0e1a;
    }

    .psm-card-head.g-6 {
        background: #d99c00;
    }

.psm-card-avatar {
    position: absolute;
    bottom: -22px;
    left: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    object-fit: cover;
}

    .psm-card-avatar.c-1 {
        color: #F5BB16;
    }

    .psm-card-avatar.c-2 {
        color: #F5BB16;
    }

    .psm-card-avatar.c-3 {
        color: #F5BB16;
    }

    .psm-card-avatar.c-4 {
        color: #F5BB16;
    }

    .psm-card-avatar.c-5 {
        color: #F5BB16;
    }

    .psm-card-avatar.c-6 {
        color: #F5BB16;
    }

img.psm-card-avatar {
    padding: 0;
}

.psm-card-body {
    padding: 28px 16px 14px;
}

.psm-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #0a0a0a;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.psm-card-sub {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.psm-card-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 10px;
    font-size: 11px;
    padding: 10px 0;
    border-top: 0.5px solid rgba(0, 0, 0, 0.05);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
}

.psm-card-info-label {
    color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 5px;
}

    .psm-card-info-label i {
        font-size: 12px;
        color: rgba(0, 0, 0, 0.4);
    }

.psm-card-info-value {
    color: #0a0a0a;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.psm-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}

.psm-card-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(236, 72, 153, 0.08));
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
}

    .psm-card-pill i {
        font-size: 11px;
    }

    .psm-card-pill.c-1 {
        color: #1a2454;
        background: rgba(26,36,84,0.07);
        border-color: rgba(26,36,84,0.15);
    }

    .psm-card-pill.c-2 {
        color: #b07800;
        background: rgba(245,187,22,0.10);
        border-color: rgba(245,187,22,0.25);
    }

    .psm-card-pill.c-3 {
        color: #ec4899;
    }

    .psm-card-pill.c-4 {
        color: #f59e0b;
    }

    .psm-card-pill.c-5 {
        color: #ef4444;
    }

    .psm-card-pill.c-6 {
        color: #10b981;
    }

.psm-card-date {
    font-size: 9.5px;
    color: rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}

.psm-card-actions {
    display: flex;
    gap: 6px;
    padding-top: 10px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.05);
}

.psm-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px;
    border: none;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
    text-decoration: none;
}

    .psm-action-btn:active {
        transform: scale(0.97);
    }

    .psm-action-btn i {
        font-size: 13px;
    }

.psm-action-primary {
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
}

    .psm-action-primary:hover {
        background: rgba(139, 92, 246, 0.15);
        color: #8b5cf6;
    }

.psm-action-secondary {
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.7);
}

    .psm-action-secondary:hover {
        background: rgba(0, 0, 0, 0.08);
    }

.psm-action-danger {
    width: 32px;
    flex: 0 0 auto;
    padding: 7px;
    background: rgba(239, 68, 68, 0.06);
    color: #ef4444;
}

    .psm-action-danger:hover {
        background: rgba(239, 68, 68, 0.15);
        color: #ef4444;
    }

/* =============================================================
   TABLE VIEW
   ============================================================= */
.psm-table-card {
    background: #ffffff;
    border-radius: 12px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.psm-table-wrap {
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    background: #ffffff;
    border-radius: 12px;
    border: 0.5px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
    overflow-y: auto;
}

.psm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

    .psm-table thead {
        background: linear-gradient(135deg, #1a2454, #0a0e1a);
        position: sticky;
        top: 0;
        z-index: 2;
    }

        .psm-table thead tr {
            border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
        }

    .psm-table th {
        text-align: left;
        padding: 11px 14px;
        font-size: 10px;
        color: #ffffff;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        font-weight: 600;
        white-space: nowrap;
    }

        .psm-table th.is-right,
        .psm-table td.is-right {
            text-align: right;
            padding-right: 16px;
        }

        .psm-table th.is-center,
        .psm-table td.is-center {
            text-align: center;
        }

    .psm-table tbody tr {
        border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
        transition: background 0.12s;
    }

        .psm-table tbody tr:hover {
            background: rgba(139, 92, 246, 0.03);
        }

        .psm-table tbody tr:last-child {
            border-bottom: none;
        }

    .psm-table td {
        padding: 11px 14px;
        vertical-align: middle;
        color: #000000;
    }

.psm-table-row-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.psm-table-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 600;
    flex-shrink: 0;
}

    .psm-table-avatar.g-1 {
        background: #1a2454;
    }

    .psm-table-avatar.g-2 {
        background: #F5BB16;
    }

    .psm-table-avatar.g-3 {
        background: #6366f1;
    }

    .psm-table-avatar.g-4 {
        background: #10b981;
    }

    .psm-table-avatar.g-5 {
        background: #0a0e1a;
    }

    .psm-table-avatar.g-6 {
        background: #d99c00;
    }

.psm-table-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.psm-table-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 0.5px solid rgba(10,14,26,0.10);
    background: rgba(10,14,26,0.03);
    color: #1a2454;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    font-family: inherit;
}

    .psm-table-icon-btn i {
        font-size: 14px;
    }

    .psm-table-icon-btn:hover {
        background: rgba(139, 92, 246, 0.1);
        color: #8b5cf6;
    }

    .psm-table-icon-btn:active {
        transform: scale(0.92);
    }

    .psm-table-icon-btn.is-danger:hover {
        background: rgba(239, 68, 68, 0.1);
        color: #ef4444;
    }

/* =============================================================
   EMPTY STATE
   ============================================================= */
.psm-empty {
    background: #ffffff;
    border-radius: 12px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    padding: 48px 24px;
    text-align: center;
}

.psm-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(236, 72, 153, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
}

    .psm-empty-icon i {
        font-size: 26px;
        color: #8b5cf6;
    }

.psm-empty-title {
    font-size: 15px;
    font-weight: 600;
    color: #0a0a0a;
    margin: 0 0 4px;
}

.psm-empty-sub {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.55);
}

/* =============================================================
   MODAL — overrides Bootstrap modal styles for brand consistency
   ============================================================= */
.psm-modal-dialog {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

    .psm-modal-dialog.is-wide {
        max-width: 720px;
    }

.psm-modal-content {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: none;
}

.psm-modal-header {
    background: linear-gradient(135deg, #1a2454 0%, #0a0e1a 100%);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    color: #ffffff;
    border: none;
}

.psm-modal-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.psm-modal-header-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .psm-modal-header-icon i {
        font-size: 16px;
        color: #ffffff;
    }

.psm-modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.psm-modal-subtitle {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
}

.psm-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 0.5px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

    .psm-modal-close:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .psm-modal-close i {
        font-size: 16px;
        color: #ffffff;
    }

.psm-modal-body {
    padding: 20px;
    max-height: calc(100vh - 240px);
    overflow-y: auto;
}

.psm-modal-footer {
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 0.5px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Form fields inside modal */
.psm-field {
    margin-bottom: 14px;
}

.psm-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.psm-label {
    font-size: 10.5px;
    color: rgba(0, 0, 0, 0.55);
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .psm-label .psm-req {
        color: #ef4444;
        margin-left: 2px;
    }

.psm-input,
.psm-select {
    width: 100%;
    padding: 6px 28px 6px 10px;
    height: 36px;
    line-height: 1.4;
    border-radius: 8px;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    font-size: 13px;
    outline: none;
    background: #ffffff;
    color: #0a0a0a;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: auto;
    -webkit-appearance: auto;
    box-sizing: border-box;
    overflow: visible;
}
/* Small variant used for compact rows */
.psm-select-sm {
    width: 100%;
    padding: 4px 24px 4px 8px;
    height: 30px;
    min-height: 30px;
    line-height: 20px;
    border-radius: 6px;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    font-size: 12px;
    outline: none;
    background: #ffffff;
    color: #0a0a0a;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: auto;
    -webkit-appearance: auto;
    box-sizing: border-box;
    overflow: visible;
}

    .psm-select-sm:focus {
        border-color: #8b5cf6;
        box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
    }

.psm-input:focus,
.psm-select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.psm-input::placeholder {
    color: rgba(0, 0, 0, 0.35);
}

.psm-validation {
    color: #ef4444;
    font-size: 10.5px;
    margin-top: 4px;
    display: block;
}

.psm-btn-secondary {
    padding: 8px 16px;
    border-radius: 8px;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    font-size: 12px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

    .psm-btn-secondary:hover {
        background: rgba(0, 0, 0, 0.04);
    }

.psm-btn-save {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(180deg, #1a2454, #0a0e1a);
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

    .psm-btn-save:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(139, 92, 246, 0.35);
    }

    .psm-btn-save i {
        font-size: 13px;
    }

    .psm-btn-save:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* =============================================================
   LOADING SPINNER (brand-themed, replaces #ffcc00 yellow)
   ============================================================= */
.psm-spinner-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.psm-spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid rgba(139, 92, 246, 0.15);
    border-top-color: #8b5cf6;
    border-right-color: #ec4899;
    animation: psm-spin 0.8s linear infinite;
}

@keyframes psm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================================
   BRAND MODAL — inline-edit table
   ============================================================= */
.psm-brand-add-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}

.psm-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 14px 0;
    border: none;
}

.psm-brand-list {
    margin-top: 6px;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1199px) {
    .psm-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .psm-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .psm-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .psm-toolbar-left, .psm-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .psm-search {
        width: 100%;
    }
}

@media (max-width: 575px) {
    .psm-grid {
        grid-template-columns: 1fr;
    }

    .psm-modal-dialog {
        padding: 12px;
    }

    .psm-field-row {
        grid-template-columns: 1fr;
    }
}


/* =============================================================
   STYLE PAGE — additions for Style/Order index
   ============================================================= */

/* Master-data shortcut pill row (Category / Range / SizeGrid / Season) */
.psm-shortcut-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.psm-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    color: rgba(0, 0, 0, 0.65);
    text-decoration: none;
}

    .psm-shortcut:hover {
        transform: translateY(-1px);
    }

    .psm-shortcut i {
        font-size: 13px;
    }

    .psm-shortcut.s-1 {
        border-color: rgba(99, 102, 241, 0.2);
        background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(139,92,246,0.06));
        color: #6366f1;
    }

        .psm-shortcut.s-1:hover {
            background: linear-gradient(135deg, rgba(99,102,241,0.14), rgba(139,92,246,0.14));
            color: #6366f1;
        }

    .psm-shortcut.s-2 {
        border-color: rgba(139, 92, 246, 0.2);
        background: linear-gradient(135deg, rgba(139,92,246,0.06), rgba(236,72,153,0.06));
        color: #8b5cf6;
    }

        .psm-shortcut.s-2:hover {
            background: linear-gradient(135deg, rgba(139,92,246,0.14), rgba(236,72,153,0.14));
            color: #8b5cf6;
        }

    .psm-shortcut.s-3 {
        border-color: rgba(236, 72, 153, 0.2);
        background: linear-gradient(135deg, rgba(236,72,153,0.06), rgba(245,158,11,0.06));
        color: #ec4899;
    }

        .psm-shortcut.s-3:hover {
            background: linear-gradient(135deg, rgba(236,72,153,0.14), rgba(245,158,11,0.14));
            color: #ec4899;
        }

    .psm-shortcut.s-4 {
        border-color: rgba(245, 158, 11, 0.2);
        background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(239,68,68,0.06));
        color: #f59e0b;
    }

        .psm-shortcut.s-4:hover {
            background: linear-gradient(135deg, rgba(245,158,11,0.14), rgba(239,68,68,0.14));
            color: #f59e0b;
        }

/* Sort dropdown (pill style) */
.psm-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
}

    .psm-sort i {
        font-size: 13px;
        color: rgba(0, 0, 0, 0.5);
    }

.psm-sort-label {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.psm-sort select {
    border: none;
    background: transparent;
    font-size: 12px;
    outline: none;
    color: #0a0a0a;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

/* Style card (4×2 grid, page size 8) */
.psm-style-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.psm-style-card {
    background: #ffffff;
    border-radius: 14px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .psm-style-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }

.psm-style-head {
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .psm-style-head.g-1 {
        background: #1a2454;
    }

    .psm-style-head.g-2 {
        background: #F5BB16;
    }

    .psm-style-head.g-3 {
        background: #6366f1;
    }

    .psm-style-head.g-4 {
        background: #10b981;
    }

    .psm-style-head.g-5 {
        background: #0a0e1a;
    }

    .psm-style-head.g-6 {
        background: #d99c00;
    }

.psm-style-photo-frame {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #ffffff;
    padding: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.psm-style-photo-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .psm-style-photo-inner img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.psm-style-photo-initials {
    font-size: 18px;
    font-weight: 700;
}

    .psm-style-photo-initials.c-1 {
        color: #6366f1;
    }

    .psm-style-photo-initials.c-2 {
        color: #8b5cf6;
    }

    .psm-style-photo-initials.c-3 {
        color: #ec4899;
    }

    .psm-style-photo-initials.c-4 {
        color: #f59e0b;
    }

    .psm-style-photo-initials.c-5 {
        color: #ef4444;
    }

    .psm-style-photo-initials.c-6 {
        color: #10b981;
    }

.psm-style-order-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    font-size: 9px;
    color: #fff;
    font-weight: 600;
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    text-decoration: none;
    display: inline-block;
}

    .psm-style-order-badge:hover {
        background: rgba(255, 255, 255, 0.4);
        color: #fff;
    }

.psm-style-body {
    padding: 12px 14px 12px;
}

.psm-style-name {
    font-size: 13px;
    font-weight: 600;
    color: #0a0a0a;
    margin: 0 0 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.psm-style-sub {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.psm-style-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    font-size: 10px;
    padding: 8px 0;
    border-top: 0.5px solid rgba(0, 0, 0, 0.05);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 8px;
}

.psm-style-info-key {
    color: rgba(0, 0, 0, 0.5);
}

.psm-style-info-val {
    color: #0a0a0a;
    font-weight: 600;
}

    .psm-style-info-val.is-smv-cost {
        color: #8b5cf6;
    }

    .psm-style-info-val.is-smv-prod {
        color: #ec4899;
    }

    .psm-style-info-val.is-zero {
        color: rgba(0, 0, 0, 0.4);
    }

.psm-style-actions {
    display: flex;
    gap: 4px;
}

.psm-style-action {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, background 0.15s;
    text-decoration: none;
    font-family: inherit;
}

    .psm-style-action:active {
        transform: scale(0.92);
    }

    .psm-style-action i {
        font-size: 13px;
    }

    .psm-style-action.a-edit {
        background: rgba(139, 92, 246, 0.08);
        color: #8b5cf6;
    }

    .psm-style-action.a-copy {
        background: rgba(99, 102, 241, 0.08);
        color: #6366f1;
    }

    .psm-style-action.a-thread {
        background: rgba(245, 158, 11, 0.08);
        color: #f59e0b;
    }

    .psm-style-action.a-image {
        background: rgba(16, 185, 129, 0.08);
        color: #10b981;
    }

    .psm-style-action.a-orders {
        background: rgba(236, 72, 153, 0.08);
        color: #ec4899;
    }

    .psm-style-action.a-delete {
        background: rgba(239, 68, 68, 0.08);
        color: #ef4444;
    }

    .psm-style-action.a-edit:hover {
        background: rgba(139, 92, 246, 0.18);
        color: #8b5cf6;
    }

    .psm-style-action.a-copy:hover {
        background: rgba(99, 102, 241, 0.18);
        color: #6366f1;
    }

    .psm-style-action.a-thread:hover {
        background: rgba(245, 158, 11, 0.18);
        color: #f59e0b;
    }

    .psm-style-action.a-image:hover {
        background: rgba(16, 185, 129, 0.18);
        color: #10b981;
    }

    .psm-style-action.a-orders:hover {
        background: rgba(236, 72, 153, 0.18);
        color: #ec4899;
    }

    .psm-style-action.a-delete:hover {
        background: rgba(239, 68, 68, 0.18);
        color: #ef4444;
    }

/* =============================================================
   PAGINATION
   ============================================================= */
.psm-pagination {
    background: #ffffff;
    border-radius: 12px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.psm-pagination-info {
    font-size: 11.5px;
    color: rgba(0, 0, 0, 0.55);
}

    .psm-pagination-info strong {
        color: #0a0a0a;
        font-weight: 600;
    }

.psm-pagination-nav {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.psm-page-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 7px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    color: rgba(0, 0, 0, 0.7);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
}

    .psm-page-btn:hover:not(:disabled):not(.is-active) {
        background: rgba(139, 92, 246, 0.06);
        border-color: rgba(139, 92, 246, 0.3);
        color: #8b5cf6;
    }

    .psm-page-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    .psm-page-btn i {
        font-size: 14px;
    }

    .psm-page-btn.is-active {
        background: linear-gradient(135deg, #6366f1, #8b5cf6);
        color: #ffffff;
        border-color: transparent;
        box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
    }

.psm-page-dots {
    padding: 0 4px;
    color: rgba(0, 0, 0, 0.3);
    font-size: 12px;
}

/* =============================================================
   STYLE MODAL — fullscreen modal additions
   ============================================================= */
.psm-modal-dialog.is-fullscreen {
    max-width: calc(100vw - 40px);
    width: calc(100vw - 40px);
    margin: 20px auto;
    height: calc(100vh - 40px);
}

    .psm-modal-dialog.is-fullscreen .psm-modal-content {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .psm-modal-dialog.is-fullscreen .psm-modal-body {
        flex: 1;
        max-height: none;
        overflow-y: auto;
    }

/* Field with overlay "+" button */
.psm-field-with-add {
    position: relative;
}

.psm-field-add-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(139, 92, 246, 0.25);
    z-index: 5;
    font-family: inherit;
}

    .psm-field-add-btn:hover {
        transform: scale(1.05);
    }

/* Image upload area + gallery */
.psm-upload-zone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
    font-family: inherit;
}

    .psm-upload-zone:hover {
        transform: translateY(-1px);
    }

    .psm-upload-zone i {
        font-size: 14px;
    }

    .psm-upload-zone input[type="file"] {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        opacity: 0;
    }

.psm-image-gallery {
    background: linear-gradient(135deg, rgba(99,102,241,0.02), rgba(236,72,153,0.02));
    border: 1.5px dashed rgba(139, 92, 246, 0.25);
    border-radius: 10px;
    padding: 12px;
    min-height: 130px;
}

.psm-image-gallery-title {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.55);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}

.psm-image-gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 90px;
    color: rgba(0, 0, 0, 0.4);
    font-size: 11.5px;
    gap: 4px;
}

    .psm-image-gallery-empty i {
        font-size: 22px;
        color: rgba(139, 92, 246, 0.35);
    }

.psm-image-thumb {
    position: relative;
    display: inline-block;
    margin: 6px;
}

    .psm-image-thumb img {
        width: 90px;
        height: 90px;
        object-fit: cover;
        border-radius: 8px;
        border: 0.5px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        cursor: pointer;
        transition: transform 0.2s;
    }

        .psm-image-thumb img:hover {
            transform: scale(1.03);
        }

.psm-image-thumb-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    border: 2px solid #ffffff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 2;
    font-family: inherit;
    padding: 0;
    line-height: 1;
}

    .psm-image-thumb-delete:hover {
        transform: scale(1.1);
    }

/* =============================================================
   PHOTO MODAL & ZOOM
   ============================================================= */
.psm-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

    .psm-photo-grid img {
        width: 100%;
        aspect-ratio: 1;
        object-fit: cover;
        border-radius: 8px;
        cursor: pointer;
        transition: transform 0.2s;
        border: 0.5px solid rgba(0, 0, 0, 0.08);
    }

        .psm-photo-grid img:hover {
            transform: scale(1.03);
        }

.psm-zoom-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.psm-zoom-panel {
    width: 480px;
    max-width: 92vw;
    height: calc(100vh - 80px);
    background: #ffffff;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.psm-zoom-controls {
    display: flex;
    gap: 6px;
    padding: 12px;
    justify-content: center;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

.psm-zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
    font-family: inherit;
}

    .psm-zoom-btn:hover {
        transform: scale(1.05);
    }

.psm-zoom-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #fafafa, #f4f4f7);
    padding: 12px;
}

    .psm-zoom-stage img {
        max-width: 100%;
        max-height: 100%;
        transition: transform 0.2s;
    }

/* =============================================================
   ORDER MODAL — color/size qty matrix
   ============================================================= */
.psm-matrix-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 380px);
    border-radius: 10px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
}

.psm-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

    .psm-matrix thead {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(236, 72, 153, 0.06));
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .psm-matrix th {
        padding: 9px 10px;
        text-align: center;
        font-size: 10px;
        color: rgba(0, 0, 0, 0.55);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 600;
        border-right: 0.5px solid rgba(0, 0, 0, 0.05);
        white-space: nowrap;
    }

        .psm-matrix th.is-color-col {
            text-align: left;
            min-width: 180px;
        }

        .psm-matrix th.is-total-col {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.1));
            color: #f59e0b;
        }

    .psm-matrix td {
        padding: 7px 8px;
        text-align: center;
        border-right: 0.5px solid rgba(0, 0, 0, 0.04);
        border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
        vertical-align: middle;
    }

        .psm-matrix td.is-color-cell {
            text-align: left;
            font-weight: 500;
            color: #0a0a0a;
            background: rgba(0, 0, 0, 0.015);
            position: sticky;
            left: 0;
            z-index: 1;
        }

        .psm-matrix td.is-total-cell {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(239, 68, 68, 0.05));
            font-weight: 700;
            color: #f59e0b;
        }

    .psm-matrix input.psm-qty {
        width: 100%;
        max-width: 70px;
        padding: 5px 6px;
        border-radius: 5px;
        border: 0.5px solid rgba(0, 0, 0, 0.1);
        font-size: 11.5px;
        text-align: center;
        outline: none;
        font-family: inherit;
    }

        .psm-matrix input.psm-qty:focus {
            border-color: #8b5cf6;
            box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1);
        }

.psm-matrix-color-delete {
    background: transparent;
    border: none;
    padding: 0;
    margin-left: 6px;
    color: rgba(239, 68, 68, 0.7);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

    .psm-matrix-color-delete:hover {
        color: #ef4444;
    }

/* Add Color row in order modal */
.psm-add-color-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: end;
    padding: 14px;
    background: linear-gradient(135deg, rgba(99,102,241,0.03), rgba(236,72,153,0.03));
    border-radius: 10px;
    margin: 14px 0;
}

    .psm-add-color-row label {
        margin: 0;
        align-self: center;
    }

/* Add Order top row */
.psm-add-order-row {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

/* Grid modal split layout */
.psm-grid-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 991px) {
    .psm-grid-split {
        grid-template-columns: 1fr;
    }
}

.psm-grid-side-title {
    font-size: 13px;
    font-weight: 600;
    color: #0a0a0a;
    margin-bottom: 12px;
    text-align: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(236,72,153,0.06));
    border-radius: 8px;
}

/* Override psm-style-grid for narrower viewports */
@media (max-width: 1199px) {
    .psm-style-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .psm-style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .psm-style-grid {
        grid-template-columns: 1fr;
    }
}

/* BlazoredTypeahead override (within the Order modal) */
.psm-typeahead-wrap input.blazored-typeahead__input {
    padding: 9px 12px !important;
    border-radius: 8px !important;
    border: 0.5px solid rgba(0, 0, 0, 0.12) !important;
    font-size: 13px !important;
    height: auto !important;
}

    .psm-typeahead-wrap input.blazored-typeahead__input:focus {
        border-color: #8b5cf6 !important;
        box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1) !important;
    }


/* =============================================================
   COMPANY PAGE — additions
   Photo-centered card variant + status badge + active toggle tile.
   ============================================================= */

/* Photo-centered card variant (used by Company page) */
.psm-card.is-centered .psm-card-head {
    height: 60px;
    transition: opacity 0.2s, filter 0.2s;
}

.psm-card.is-centered.is-inactive .psm-card-head {
    opacity: 0.7;
}

.psm-card.is-centered.is-inactive .psm-photo-stack {
    filter: grayscale(0.5);
}

.psm-card.is-centered.is-inactive .psm-card-name {
    color: rgba(0, 0, 0, 0.5);
}

.psm-card.is-centered.is-inactive .psm-card-sub {
    color: rgba(0, 0, 0, 0.4);
}

.psm-card.is-centered.is-inactive .psm-card-info-label {
    color: rgba(0, 0, 0, 0.4);
}

.psm-card.is-centered.is-inactive .psm-card-info-value {
    color: rgba(0, 0, 0, 0.6);
}

.psm-photo-stack {
    display: flex;
    justify-content: center;
    margin-top: -36px;
    margin-bottom: 4px;
    transition: filter 0.2s;
}

.psm-photo-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    padding: 3px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.psm-photo-ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
}

    .psm-photo-ring-inner img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .psm-photo-ring-inner.g-1 {
        background: #1a2454;
    }

    .psm-photo-ring-inner.g-2 {
        background: #F5BB16;
    }

    .psm-photo-ring-inner.g-3 {
        background: #6366f1;
    }

    .psm-photo-ring-inner.g-4 {
        background: #10b981;
    }

    .psm-photo-ring-inner.g-5 {
        background: #0a0e1a;
    }

    .psm-photo-ring-inner.g-6 {
        background: #d99c00;
    }

/* Centered text block */
.psm-card-centered-text {
    text-align: center;
    margin-bottom: 10px;
}

    .psm-card-centered-text .psm-card-name {
        white-space: normal;
        text-align: center;
    }

    .psm-card-centered-text .psm-card-sub {
        white-space: normal;
        text-align: center;
        margin-bottom: 0;
    }

/* Status badge on the gradient strip */
.psm-status-pill {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 9px;
    color: #ffffff;
    font-weight: 700;
    backdrop-filter: blur(6px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.4px;
}

    .psm-status-pill .psm-status-dot {
        width: 4px;
        height: 4px;
        border-radius: 50%;
    }

    .psm-status-pill.is-active {
        background: rgba(16, 185, 129, 0.95);
    }

        .psm-status-pill.is-active .psm-status-dot {
            background: #ffffff;
            box-shadow: 0 0 6px #ffffff;
            animation: psm-pulse 1.6s ease-in-out infinite;
        }

    .psm-status-pill.is-inactive {
        background: rgba(0, 0, 0, 0.5);
    }

        .psm-status-pill.is-inactive .psm-status-dot {
            background: rgba(255, 255, 255, 0.7);
        }

@keyframes psm-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.7);
    }
}

/* Active toggle tile (replaces RadzenSwitch on the card) */
.psm-toggle-tile {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px 4px 12px;
    border-radius: 7px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.15s;
    user-select: none;
}

    .psm-toggle-tile.is-on {
        background: rgba(16, 185, 129, 0.08);
    }

        .psm-toggle-tile.is-on:hover {
            background: rgba(16, 185, 129, 0.14);
        }

    .psm-toggle-tile.is-off {
        background: rgba(0, 0, 0, 0.04);
    }

        .psm-toggle-tile.is-off:hover {
            background: rgba(0, 0, 0, 0.07);
        }

.psm-toggle-label {
    font-size: 10.5px;
    font-weight: 600;
}

.psm-toggle-tile.is-on .psm-toggle-label {
    color: #10b981;
}

.psm-toggle-tile.is-off .psm-toggle-label {
    color: rgba(0, 0, 0, 0.45);
}

.psm-toggle-switch {
    width: 32px;
    height: 18px;
    border-radius: 9px;
    position: relative;
    transition: background 0.2s;
}

.psm-toggle-tile.is-on .psm-toggle-switch {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.psm-toggle-tile.is-off .psm-toggle-switch {
    background: rgba(0, 0, 0, 0.15);
}

.psm-toggle-knob {
    position: absolute;
    top: 2px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: left 0.2s, right 0.2s;
}

.psm-toggle-tile.is-on .psm-toggle-knob {
    right: 2px;
    left: auto;
}

.psm-toggle-tile.is-off .psm-toggle-knob {
    left: 2px;
    right: auto;
}

/* Action row for company cards (toggle + edit + delete) */
.psm-card-actions.is-with-toggle {
    align-items: center;
}

    .psm-card-actions.is-with-toggle .psm-action-btn {
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        padding: 0;
    }

/* Photo upload tile in modal */
.psm-photo-upload {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(99,102,241,0.03), rgba(236,72,153,0.03));
    border: 1.5px dashed rgba(139, 92, 246, 0.25);
    border-radius: 10px;
}

.psm-photo-upload-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

    .psm-photo-upload-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .psm-photo-upload-preview i {
        font-size: 26px;
        color: rgba(139, 92, 246, 0.35);
    }

.psm-photo-upload-body {
    flex: 1;
}

.psm-photo-upload-hint {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
    margin-top: 4px;
}


/* =============================================================
   FACTORY PAGE — additions
   Company-name header strip + 3 compact toggles
   ============================================================= */

/* 2-column grid for Factory cards (more info per card) */
.psm-factory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (max-width: 991px) {
    .psm-factory-grid {
        grid-template-columns: 1fr;
    }
}

/* Card variant with company-name header strip */
.psm-card.is-factory .psm-card-head {
    height: 56px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: opacity 0.2s;
}

.psm-card.is-factory.is-inactive .psm-card-head {
    opacity: 0.7;
}

.psm-card.is-factory.is-inactive .psm-card-name {
    color: rgba(0, 0, 0, 0.5);
}

    .psm-card.is-factory.is-inactive .psm-card-name i {
        color: rgba(0, 0, 0, 0.4);
    }

.psm-card.is-factory.is-inactive .psm-card-info-label {
    color: rgba(0, 0, 0, 0.4);
}

.psm-card.is-factory.is-inactive .psm-card-info-value {
    color: rgba(0, 0, 0, 0.6);
}

.psm-company-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.psm-company-tag-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .psm-company-tag-icon i {
        color: #ffffff;
        font-size: 15px;
    }

.psm-company-tag-body {
    min-width: 0;
}

.psm-company-tag-label {
    font-size: 8.5px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.psm-company-tag-name {
    font-size: 12px;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Factory name (replaces .psm-card-name in factory variant) */
.psm-factory-name {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #0a0a0a;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .psm-factory-name i {
        color: #8b5cf6;
        font-size: 17px;
    }

/* 3 compact toggles row */
.psm-mini-toggles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.psm-mini-toggle {
    padding: 6px 7px;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
}

.psm-mini-toggle-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.psm-mini-toggle-state {
    display: flex;
    align-items: center;
    gap: 5px;
}

.psm-mini-switch {
    width: 22px;
    height: 12px;
    border-radius: 6px;
    position: relative;
    transition: background 0.2s;
}

.psm-mini-knob {
    position: absolute;
    top: 2px;
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    transition: left 0.2s, right 0.2s;
}

.psm-mini-toggle-text {
    font-size: 10px;
    font-weight: 600;
}

/* Off state — same for all three */
.psm-mini-toggle.is-off {
    background: rgba(0, 0, 0, 0.04);
}

    .psm-mini-toggle.is-off:hover {
        background: rgba(0, 0, 0, 0.07);
    }

    .psm-mini-toggle.is-off .psm-mini-toggle-label,
    .psm-mini-toggle.is-off .psm-mini-toggle-text {
        color: rgba(0, 0, 0, 0.45);
    }

    .psm-mini-toggle.is-off .psm-mini-switch {
        background: rgba(0, 0, 0, 0.15);
    }

    .psm-mini-toggle.is-off .psm-mini-knob {
        left: 2px;
        right: auto;
    }

/* On states — color-coded per toggle type */
.psm-mini-toggle.is-on .psm-mini-knob {
    right: 2px;
    left: auto;
}

.psm-mini-toggle.t-active.is-on {
    background: rgba(16, 185, 129, 0.08);
}

    .psm-mini-toggle.t-active.is-on:hover {
        background: rgba(16, 185, 129, 0.14);
    }

    .psm-mini-toggle.t-active.is-on .psm-mini-toggle-label,
    .psm-mini-toggle.t-active.is-on .psm-mini-toggle-text {
        color: #10b981;
    }

    .psm-mini-toggle.t-active.is-on .psm-mini-switch {
        background: linear-gradient(90deg, #10b981, #34d399);
    }

.psm-mini-toggle.t-smv.is-on {
    background: rgba(139, 92, 246, 0.08);
}

    .psm-mini-toggle.t-smv.is-on:hover {
        background: rgba(139, 92, 246, 0.14);
    }

    .psm-mini-toggle.t-smv.is-on .psm-mini-toggle-label,
    .psm-mini-toggle.t-smv.is-on .psm-mini-toggle-text {
        color: #8b5cf6;
    }

    .psm-mini-toggle.t-smv.is-on .psm-mini-switch {
        background: linear-gradient(90deg, #6366f1, #8b5cf6);
    }

.psm-mini-toggle.t-lock.is-on {
    background: rgba(245, 158, 11, 0.08);
}

    .psm-mini-toggle.t-lock.is-on:hover {
        background: rgba(245, 158, 11, 0.14);
    }

    .psm-mini-toggle.t-lock.is-on .psm-mini-toggle-label,
    .psm-mini-toggle.t-lock.is-on .psm-mini-toggle-text {
        color: #f59e0b;
    }

    .psm-mini-toggle.t-lock.is-on .psm-mini-switch {
        background: linear-gradient(90deg, #f59e0b, #ef4444);
    }

/* Edit + Delete row at bottom of factory card */
.psm-factory-foot {
    display: flex;
    gap: 6px;
    padding-top: 10px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.05);
}

    .psm-factory-foot .psm-action-btn {
        padding: 7px;
        font-size: 11px;
        font-weight: 500;
    }


/* =============================================================
   USER PAGE — additions
   Role badge + featured switch-account button + role-tinted bits
   ============================================================= */

/* Card variant for User cards */
.psm-card.is-user .psm-card-head {
    height: 70px;
    transition: opacity 0.2s;
}

.psm-card.is-user.is-inactive .psm-card-head {
    opacity: 0.6;
}

.psm-card.is-user.is-inactive .psm-photo-ring {
    filter: grayscale(0.5);
}

.psm-card.is-user.is-inactive .psm-card-name {
    color: rgba(0, 0, 0, 0.5);
}

.psm-card.is-user.is-inactive .psm-card-sub {
    color: rgba(0, 0, 0, 0.4);
}

.psm-card.is-user.is-inactive .psm-card-info-label {
    color: rgba(0, 0, 0, 0.4);
}

.psm-card.is-user.is-inactive .psm-card-info-value {
    color: rgba(0, 0, 0, 0.6);
}

/* Role badge — top-left of strip, alongside status pill */
.psm-role-pill {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    font-size: 9px;
    color: #ffffff;
    font-weight: 700;
    backdrop-filter: blur(6px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.4px;
}

    .psm-role-pill i {
        font-size: 11px;
    }

/* Smaller photo for User cards (less vertical space taken) */
.psm-card.is-user .psm-photo-ring {
    width: 56px;
    height: 56px;
}

.psm-card.is-user .psm-photo-stack {
    margin-top: -28px;
}

.psm-card.is-user .psm-photo-ring-inner {
    font-size: 18px;
}

/* Featured switch-account button (the SuperAdmin's superpower) */
.psm-switch-btn {
    width: 100%;
    padding: 7px;
    border: none;
    border-radius: 8px;
    color: #8b5cf6;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 8px;
    font-family: inherit;
    transition: filter 0.15s, transform 0.15s;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
}

    .psm-switch-btn:hover:not(:disabled) {
        filter: brightness(0.95);
        transform: translateY(-1px);
    }

    .psm-switch-btn i {
        font-size: 13px;
    }

    /* Color variants based on role gradient */
    .psm-switch-btn.g-1 {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
        color: #8b5cf6;
    }

    .psm-switch-btn.g-2 {
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
        color: #8b5cf6;
    }

    .psm-switch-btn.g-3 {
        background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(245, 158, 11, 0.1));
        color: #ec4899;
    }

    .psm-switch-btn.g-4 {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.1));
        color: #f59e0b;
    }

    .psm-switch-btn.g-5 {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(99, 102, 241, 0.1));
        color: #10b981;
    }

    .psm-switch-btn.g-6 {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
        color: #8b5cf6;
    }

    .psm-switch-btn:disabled {
        background: rgba(0, 0, 0, 0.04);
        color: rgba(0, 0, 0, 0.3);
        cursor: not-allowed;
        transform: none;
    }

/* Smaller action row buttons for user cards */
.psm-card.is-user .psm-action-btn {
    width: 30px;
    height: 30px;
    padding: 0;
}


/* =============================================================
   ROLE / PERMISSIONS PAGE — additions
   Picker header + selected-user banner + Radzen grid wrapper
   ============================================================= */

/* Top header card (icon + title + user picker) */
.psr-header {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 14px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.psr-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 220px;
}

.psr-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(139, 92, 246, 0.25);
    flex-shrink: 0;
}

    .psr-header-icon i {
        font-size: 18px;
        color: #ffffff;
    }

.psr-header-title {
    font-size: 13px;
    font-weight: 600;
    color: #0a0a0a;
}

.psr-header-sub {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
}

.psr-header-picker {
    flex: 1;
    max-width: 360px;
    min-width: 200px;
    margin-left: auto;
}

/* Wrapper that holds the user banner + Radzen grid + footer */
.psr-shell {
    background: #ffffff;
    border-radius: 12px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Selected user banner above the grid */
.psr-user-banner {
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(236, 72, 153, 0.06));
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.psr-user-banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.psr-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
}

    .psr-user-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.psr-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #0a0a0a;
}

.psr-user-meta {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.55);
}

    .psr-user-meta .psr-user-role {
        color: #8b5cf6;
        font-weight: 600;
    }

.psr-user-banner-right {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.55);
}

    .psr-user-banner-right strong {
        color: #8b5cf6;
        font-weight: 600;
    }

/* Wrapper around the RadzenDataGrid — gives it our padding + scrollbar */
.psr-grid-wrap {
    padding: 8px 0;
    background: #ffffff;
}

    .psr-grid-wrap .rz-datatable {
        border: none !important;
        box-shadow: none !important;
    }

    .psr-grid-wrap .rz-grid-table {
        font-size: 12px !important;
    }

    .psr-grid-wrap .rz-data-grid-data {
        border: none !important;
    }

/* Footer with helper text + Update button */
.psr-foot {
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 0.5px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.psr-foot-hint {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

    .psr-foot-hint i {
        font-size: 13px;
    }

    .psr-foot-hint strong {
        color: #0a0a0a;
        font-weight: 600;
    }

.psr-update-btn {
    padding: 9px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(139, 92, 246, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}

    .psr-update-btn:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 5px 14px rgba(139, 92, 246, 0.35);
    }

    .psr-update-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    .psr-update-btn i {
        font-size: 14px;
    }

/* Empty state when no user is picked */
.psr-empty {
    padding: 60px 24px;
    text-align: center;
}

.psr-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(236, 72, 153, 0.08));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

    .psr-empty-icon i {
        font-size: 26px;
        color: #8b5cf6;
    }

.psr-empty-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: #0a0a0a;
}

.psr-empty-sub {
    font-size: 12.5px;
    color: rgba(0, 0, 0, 0.55);
    max-width: 360px;
    margin: 0 auto;
}


/* =============================================================
   MACHINE PAGE — additions
   Two-tier toolbar variant + machine-type pills + sort dropdown
   ============================================================= */

/* Two-tier toolbar (machine has more controls than other pages) */
.psm-toolbar.is-two-tier {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

    .psm-toolbar.is-two-tier .psm-toolbar-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
    }

        .psm-toolbar.is-two-tier .psm-toolbar-row.is-second {
            margin-top: 10px;
            padding-top: 10px;
            border-top: 0.5px solid rgba(0, 0, 0, 0.05);
        }

/* Secondary brand button (for StitchClass shortcut) */
.psm-btn-brand-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(245, 187, 22, 0.10));
    color: #8b5cf6;
    border: 0.5px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.15s, transform 0.15s;
    font-family: inherit;
}

    .psm-btn-brand-soft:hover {
        filter: brightness(0.95);
        transform: translateY(-1px);
        color: #8b5cf6;
    }

    .psm-btn-brand-soft i {
        font-size: 14px;
    }

/* Sort dropdown */
.psm-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.03);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    border-radius: 7px;
    font-size: 11px;
}

    .psm-sort i {
        font-size: 13px;
        color: rgba(0, 0, 0, 0.5);
    }

    .psm-sort select {
        border: none;
        outline: none;
        background: transparent;
        font-size: 11.5px;
        min-width: 110px;
        color: #0a0a0a;
        font-family: inherit;
        cursor: pointer;
    }

/* Machine-type pills */
.psm-type-pill {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    letter-spacing: 0.3px;
}

    .psm-type-pill.t-sewing {
        color: #8b5cf6;
        background: rgba(139, 92, 246, 0.08);
    }

    .psm-type-pill.t-manual {
        color: #ec4899;
        background: rgba(236, 72, 153, 0.08);
    }

    .psm-type-pill.t-special {
        color: #f59e0b;
        background: rgba(245, 158, 11, 0.08);
    }

    .psm-type-pill.t-other {
        color: rgba(0, 0, 0, 0.55);
        background: rgba(0, 0, 0, 0.05);
    }

/* "+" inline button inside a select wrapper (for adding StitchClass on the fly) */
.psm-inline-add-wrap {
    position: relative;
}

.psm-inline-add-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.25);
    transition: transform 0.15s;
    z-index: 2;
}

    .psm-inline-add-btn:hover {
        transform: translateY(-50%) scale(1.05);
    }

    .psm-inline-add-btn i {
        font-size: 12px;
    }

/* Machine name cell — icon + name pattern (used in table) */
.psm-machine-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.psm-machine-cell-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .psm-machine-cell-icon i {
        font-size: 12px;
    }

    .psm-machine-cell-icon.t-sewing {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    }

        .psm-machine-cell-icon.t-sewing i {
            color: #8b5cf6;
        }

    .psm-machine-cell-icon.t-manual {
        background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(245, 158, 11, 0.1));
    }

        .psm-machine-cell-icon.t-manual i {
            color: #ec4899;
        }

    .psm-machine-cell-icon.t-special {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.1));
    }

        .psm-machine-cell-icon.t-special i {
            color: #f59e0b;
        }

    .psm-machine-cell-icon.t-other {
        background: rgba(0, 0, 0, 0.05);
    }

        .psm-machine-cell-icon.t-other i {
            color: rgba(0, 0, 0, 0.55);
        }

/* Full-screen Loader overlay (replaces yellow #ffcc00) */
.psm-loader-overlay, .psm-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2147483647;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.psm-loader-spinner, .psm-spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 5px solid rgba(139, 92, 246, 0.15);
    border-top-color: #8b5cf6;
    animation: psm-spin 0.8s linear infinite;
}

@keyframes psm-spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Stitch-class section inside the StitchClass modal */
.psm-modal-section {
    margin: 8px 0 14px;
    padding-bottom: 8px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
}

.psm-modal-section-title {
    font-size: 11px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .psm-modal-section-title i {
        font-size: 13px;
        color: #8b5cf6;
    }

/* Embedded stitch-class table inside modal */
.psm-embedded-table-wrap {
    margin-top: 16px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
    overflow: hidden;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
}

.psm-embedded-table-head {
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(236,72,153,0.06));
    font-size: 11px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
}

    .psm-embedded-table-head i {
        font-size: 14px;
        color: #8b5cf6;
    }


/* =============================================================
   INLINE EDIT STYLES (used by Machine table + StitchClass embedded table)
   ============================================================= */

/* Highlight the row being edited */
.psm-table tbody tr.is-editing {
    background: rgba(99, 102, 241, 0.04) !important;
}

    .psm-table tbody tr.is-editing td {
        padding-top: 6px;
        padding-bottom: 6px;
    }

/* Compact inline input/select inside table cell */
.psm-input.is-inline,
.psm-select.is-inline {
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 11.5px;
    border: 0.5px solid rgba(139, 92, 246, 0.3);
    width: 100%;
    background: #ffffff;
    color: #0a0a0a;
    outline: none;
    font-family: inherit;
}

    .psm-input.is-inline:focus,
    .psm-select.is-inline:focus {
        border-color: #8b5cf6;
        box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.08);
    }

/* Success action button (used for inline save) */
.psm-action-btn.psm-action-success {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
}

    .psm-action-btn.psm-action-success:hover {
        background: rgba(16, 185, 129, 0.14);
    }

/* Muted/secondary cell styling */
.psm-table td.psm-cell-muted,
.psm-cell-muted {
    color: rgba(0, 0, 0, 0.55);
}

/* Action column — right-aligned, compact action buttons row */
.psm-table th.psm-th-actions,
.psm-table td.psm-th-actions {
    text-align: right;
    white-space: nowrap;
}

.psm-table td.psm-th-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding-top: 6px;
    padding-bottom: 6px;
}

    .psm-table td.psm-th-actions .psm-action-btn {
        width: 28px;
        height: 28px;
        padding: 0;
    }

        .psm-table td.psm-th-actions .psm-action-btn i {
            font-size: 12px;
        }


/* =============================================================
   OPERATION PAGE — additions
   Cart badge, video icon states, status badges, action strip,
   autocomplete dropdown, style-mode indicator, OP row expansion
   ============================================================= */

/* Cart badge button */
.psm-cart-btn {
    position: relative;
    padding: 7px 12px;
    background: rgba(245, 187, 22, 0.10);
    border: 0.5px solid rgba(236, 72, 153, 0.2);
    border-radius: 7px;
    color: #ec4899;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: inherit;
    transition: filter 0.15s;
    text-decoration: none;
}

    .psm-cart-btn:hover {
        filter: brightness(0.95);
        color: #ec4899;
    }

    .psm-cart-btn i {
        font-size: 14px;
    }

.psm-cart-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #ffffff;
}

/* Submit-to-OB button */
.psm-submit-btn {
    padding: 7px 14px;
    background: linear-gradient(180deg, #1a2454, #0a0e1a);
    border: none;
    border-radius: 7px;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}

    .psm-submit-btn:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
    }

    .psm-submit-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    .psm-submit-btn i {
        font-size: 12px;
    }

/* Style-mode toggle indicator */
.psm-style-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    background: rgba(10, 14, 26, 0.04);
    border: 0.5px solid rgba(139, 92, 246, 0.15);
    border-radius: 7px;
    font-size: 11.5px;
    color: #8b5cf6;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    user-select: none;
}

    .psm-style-toggle:hover {
        background: rgba(99, 102, 241, 0.09);
    }

    .psm-style-toggle.is-off {
        color: rgba(0, 0, 0, 0.55);
        background: rgba(0, 0, 0, 0.03);
        border-color: rgba(0, 0, 0, 0.08);
    }

.psm-style-toggle-check {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.psm-style-toggle.is-on .psm-style-toggle-check {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
}

    .psm-style-toggle.is-on .psm-style-toggle-check i {
        font-size: 11px;
        color: #ffffff;
    }

/* Operation action strip — 5 tight icon buttons per row */
.psm-op-actions {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
/* psm-op-btn defined below in OperationIndex section */

/* Status badge — P (published) and E (estimate) */
.psm-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    letter-spacing: 0.3px;
}

    .psm-status-badge.is-published {
        color: #10b981;
        background: rgba(16, 185, 129, 0.1);
    }

    .psm-status-badge.is-estimate {
        color: #f59e0b;
        background: rgba(245, 158, 11, 0.1);
    }

/* OP No cell — expand icon + monospace OPNO + published dot */
.psm-opno-cell {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.psm-opno-expand {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    flex-shrink: 0;
}

    .psm-opno-expand:hover {
        color: #8b5cf6;
    }

.psm-opno-text {
    font-family: monospace;
    font-size: 11px;
    font-weight: 500;
}

.psm-opno-dot {
    font-size: 8px;
    color: #10b981;
    flex-shrink: 0;
}

/* Expand row (history) */
.psm-expand-row td {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02), rgba(236, 72, 153, 0.02));
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
}

.psm-expand-inner {
    padding: 8px 14px 12px 40px;
    font-size: 11.5px;
}

    .psm-expand-inner table {
        font-size: 11.5px;
    }

    .psm-expand-inner th {
        color: rgba(0, 0, 0, 0.55);
        font-weight: 600;
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        padding: 4px 10px 4px 0;
    }

    .psm-expand-inner td {
        padding: 4px 10px 4px 0;
        color: #0a0a0a;
        font-weight: 500;
    }

/* Autocomplete dropdown for operation modal */
.psm-autocomplete {
    position: relative;
}

.psm-autocomplete-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    font-size: 12.5px;
    outline: none;
    background: #ffffff;
    color: #0a0a0a;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .psm-autocomplete-input:focus {
        border-color: #8b5cf6;
        box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    }

.psm-autocomplete-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
    list-style: none;
    margin: 0;
}

.psm-autocomplete-item {
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #0a0a0a;
    transition: background 0.1s;
}

    .psm-autocomplete-item:hover {
        background: rgba(139, 92, 246, 0.08);
        color: #8b5cf6;
    }

/* Operation modal — 6-column grid for the autocomplete fields */
.psm-op-field-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.psm-op-field-grid-row2 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}
/* On small widths collapse to 2-col */
@media (max-width: 900px) {
    .psm-op-field-grid,
    .psm-op-field-grid-row2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Grade "+" icon link next to grade label */
.psm-field-label-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 5px;
}

    .psm-field-label-row .psm-label {
        margin-bottom: 0;
    }

.psm-grade-add-link {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(139, 92, 246, 0.2);
}

    .psm-grade-add-link i {
        font-size: 12px;
        color: #ffffff;
    }

/* Conditional subsection search row */
.psm-subsection-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(245, 158, 11, 0.05);
    border: 0.5px solid rgba(245, 158, 11, 0.2);
    border-radius: 7px;
}

    .psm-subsection-search i {
        font-size: 13px;
        color: #f59e0b;
    }

    .psm-subsection-search input {
        border: none;
        outline: none;
        background: transparent;
        font-size: 12.5px;
        font-family: inherit;
    }

/* Read-only input (greyed machine/seam/SMV when status != E) */
.psm-input-readonly {
    background: rgba(0, 0, 0, 0.05) !important;
    color: rgba(0, 0, 0, 0.55) !important;
    cursor: not-allowed !important;
}

/* BlazoredTypeahead width fix — force input to fill its container */
.blazored-typeahead,
.blazored-typeahead__input-wrapper,
.blazored-typeahead__input-wrapper input {
    width: 100% !important;
    min-width: unset !important;
    max-width: unset !important;
}


/* =============================================================
   STYLE/ORDER PAGE — additions
   Style cards, pagination, photo gallery, zoom overlay,
   order modal color/size matrix, shortcut icon strip
   ============================================================= */

/* 4-column 2-row card grid (8 per page) */
.psm-style-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

@media (max-width: 1199px) {
    .psm-style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .psm-style-grid {
        grid-template-columns: 1fr;
    }
}

/* Style card — photo at top-center, info grid, action strip */
.psm-style-card {
    background: #ffffff;
    border-radius: 14px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

    .psm-style-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    }

    /* Gradient strip at top (thinner — 48px) */
    .psm-style-card .psm-card-head {
        height: 48px;
    }

/* Circular photo overlapping the strip */
.psm-style-photo-wrap {
    display: flex;
    justify-content: center;
    margin-top: -32px;
    margin-bottom: 4px;
}

.psm-style-photo-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 3px;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

    .psm-style-photo-ring img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
        display: block;
    }

    .psm-style-photo-ring.is-fallback {
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(236, 72, 153, 0.08));
    }

        .psm-style-photo-ring.is-fallback i {
            font-size: 26px;
            color: #8b5cf6;
        }

/* Style code headline */
.psm-style-code {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #0a0a0a;
    padding: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 10px;
}

/* Info grid inside card */
.psm-style-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 8px;
    font-size: 11px;
    padding: 0 12px 10px;
    flex: 1;
    border-top: 0.5px solid rgba(0, 0, 0, 0.05);
    padding-top: 8px;
}

.psm-style-info-label {
    color: rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.psm-style-info-value {
    color: #0a0a0a;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .psm-style-info-value.is-link {
        color: #8b5cf6;
        cursor: pointer;
        text-decoration: none;
    }

        .psm-style-info-value.is-link:hover {
            text-decoration: underline;
        }

/* Action strip at the bottom of style card */
.psm-style-actions {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 10px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.05);
    gap: 4px;
}

.psm-style-act-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: filter 0.15s;
    font-family: inherit;
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.65);
}

    .psm-style-act-btn:hover {
        filter: brightness(0.9);
        color: rgba(0,0,0,0.65);
    }

    .psm-style-act-btn i {
        font-size: 13px;
    }

    .psm-style-act-btn.is-edit {
        background: rgba(99, 102, 241, 0.06);
        color: #6366f1;
    }

    .psm-style-act-btn.is-copy {
        background: rgba(139, 92, 246, 0.06);
        color: #8b5cf6;
    }

    .psm-style-act-btn.is-thread {
        background: rgba(16, 185, 129, 0.06);
        color: #10b981;
    }

    .psm-style-act-btn.is-photo {
        background: rgba(236, 72, 153, 0.06);
        color: #ec4899;
    }

    .psm-style-act-btn.is-order {
        background: rgba(245, 158, 11, 0.06);
        color: #f59e0b;
    }

    .psm-style-act-btn.is-delete {
        background: rgba(239, 68, 68, 0.06);
        color: #ef4444;
    }

/* Shortcut icon strip (Category / Range / Grid / Season) in toolbar */
.psm-shortcut-strip {
    display: flex;
    align-items: center;
    gap: 6px;
}

.psm-shortcut-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.65);
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

    .psm-shortcut-btn:hover {
        background: rgba(139, 92, 246, 0.1);
        color: #8b5cf6;
    }

    .psm-shortcut-btn i {
        font-size: 16px;
    }

/* Brand-themed pagination */
.psm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    padding: 14px 0 4px;
}

.psm-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 7px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    color: rgba(0, 0, 0, 0.7);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
}

    .psm-page-btn:hover:not(:disabled) {
        background: rgba(99, 102, 241, 0.08);
        border-color: rgba(139, 92, 246, 0.3);
        color: #8b5cf6;
    }

    .psm-page-btn.is-active {
        background: linear-gradient(135deg, #6366f1, #8b5cf6);
        color: #ffffff;
        border-color: transparent;
        box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
    }

    .psm-page-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.psm-page-dots {
    color: rgba(0, 0, 0, 0.4);
    font-size: 12px;
    padding: 0 4px;
}

.psm-page-info {
    font-size: 11.5px;
    color: rgba(0, 0, 0, 0.5);
    margin-left: 8px;
}

.psm-page-loading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #8b5cf6;
    margin-left: 8px;
}

/* Style photo gallery (inside Photo modal) */
.psm-photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.psm-photo-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s;
}

    .psm-photo-thumb:hover {
        transform: scale(1.03);
    }

    .psm-photo-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.psm-photo-thumb-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.15s;
    font-family: inherit;
}

.psm-photo-thumb:hover .psm-photo-thumb-del {
    opacity: 1;
}

/* Zoom overlay (Blazor-rendered, not Bootstrap modal) */
.psm-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2147483640;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.psm-zoom-panel {
    width: 460px;
    max-width: 95vw;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.psm-zoom-header {
    padding: 10px 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.psm-zoom-title {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

.psm-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.psm-zoom-ctrl {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background 0.15s;
}

    .psm-zoom-ctrl:hover {
        background: rgba(255, 255, 255, 0.35);
    }

.psm-zoom-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.02);
}

    .psm-zoom-body img {
        max-width: 100%;
        max-height: 60vh;
        border-radius: 8px;
        transition: transform 0.2s ease;
    }

/* Color/size quantity matrix (in Order modal) */
.psm-qty-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

    .psm-qty-table th, .psm-qty-table td {
        padding: 6px 8px;
        vertical-align: middle;
    }

    .psm-qty-table thead th {
        background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
        color: #ffffff;
        font-weight: 600;
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        position: sticky;
        top: 0;
        z-index: 2;
        text-align: center;
    }

        .psm-qty-table thead th.is-label {
            text-align: left;
            min-width: 140px;
        }

    .psm-qty-table tbody tr {
        border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
    }

        .psm-qty-table tbody tr:nth-child(even) {
            background: rgba(0, 0, 0, 0.01);
        }

    .psm-qty-table tbody td {
        text-align: center;
    }

        .psm-qty-table tbody td.is-color {
            text-align: left;
            font-weight: 500;
            white-space: nowrap;
        }

.psm-qty-input {
    width: 70px;
    padding: 3px 6px;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 5px;
    text-align: center;
    font-size: 11.5px;
    outline: none;
    font-family: inherit;
}

    .psm-qty-input:focus {
        border-color: #8b5cf6;
        box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1);
    }

.psm-qty-total {
    font-weight: 700;
    color: #8b5cf6;
    font-size: 12px;
}

/* Style upload zone (in Add/Edit modal) */
.psm-style-upload-zone {
    border: 1.5px dashed rgba(139, 92, 246, 0.25);
    border-radius: 10px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02), rgba(236, 72, 153, 0.02));
    min-height: 100px;
}

.psm-style-upload-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.psm-upload-thumb {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
}

    .psm-upload-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.psm-upload-thumb-del {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-family: inherit;
}


/* =============================================================
   STYLE/ORDER PAGE — additions
   Style cards with photo avatar, photo gallery, zoom overlay,
   order qty matrix, pagination, copy modal
   ============================================================= */

/* Style card — photo avatar on top of gradient strip */
.psm-card.is-style .psm-card-head {
    height: 70px;
}

.psm-card.is-style .psm-photo-stack {
    margin-top: -36px;
    margin-bottom: 4px;
}

.psm-card.is-style .psm-photo-ring {
    width: 72px;
    height: 72px;
}

.psm-card.is-style .psm-photo-ring-inner {
    font-size: 18px;
}

    .psm-card.is-style .psm-photo-ring-inner img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Style code truncation */
.psm-style-code {
    font-family: monospace;
    font-size: 12px;
    font-weight: 600;
    color: #0a0a0a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    max-width: 100%;
}

/* Order count link — clickable chip on the card */
.psm-order-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #8b5cf6;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
}

    .psm-order-link:hover {
        color: #6366f1;
    }

    .psm-order-link i {
        font-size: 13px;
    }

/* Pagination bar — replaces Bootstrap btn-outline-primary pagination */
.psm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 16px 0 8px;
}

.psm-page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 7px;
    background: #ffffff;
    color: #0a0a0a;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: all 0.15s;
}

    .psm-page-btn:hover:not(:disabled):not(.is-active) {
        border-color: rgba(139, 92, 246, 0.4);
        color: #8b5cf6;
        background: rgba(139, 92, 246, 0.04);
    }

    .psm-page-btn.is-active {
        background: linear-gradient(135deg, #6366f1, #8b5cf6);
        color: #ffffff;
        border-color: transparent;
        box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
    }

    .psm-page-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.psm-page-dots {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.4);
    padding: 0 4px;
    user-select: none;
}

.psm-page-info {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
    margin-left: 8px;
}

/* Photo gallery inside Photo modal */
.psm-photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    padding: 4px 0;
}

.psm-photo-thumb {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.15s;
}

    .psm-photo-thumb:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }

    .psm-photo-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.psm-photo-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.85);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    opacity: 0;
    transition: opacity 0.15s;
}

.psm-photo-thumb:hover .psm-photo-del {
    opacity: 1;
}

.psm-photo-del i {
    font-size: 11px;
}

/* Zoom overlay (Blazor-managed, not Bootstrap modal) */
.psm-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.psm-zoom-panel {
    width: 480px;
    max-width: 95vw;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.psm-zoom-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

.psm-zoom-btns {
    display: flex;
    gap: 6px;
}

.psm-zoom-btn {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    color: #0a0a0a;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background 0.15s;
}

    .psm-zoom-btn:hover {
        background: rgba(139, 92, 246, 0.08);
        color: #8b5cf6;
    }

.psm-zoom-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    max-height: 70vh;
    overflow: hidden;
}

    .psm-zoom-image-wrap img {
        max-width: 100%;
        max-height: 60vh;
        transition: transform 0.2s;
    }

/* Order qty matrix */
.psm-order-matrix {
    overflow-x: auto;
    border-radius: 10px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
}

    .psm-order-matrix table {
        border-collapse: collapse;
        font-size: 11.5px;
        min-width: 100%;
    }

    .psm-order-matrix thead tr {
        background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
        color: #ffffff;
    }

    .psm-order-matrix th, .psm-order-matrix td {
        padding: 6px 10px;
        text-align: center;
        border-right: 0.5px solid rgba(0, 0, 0, 0.06);
        white-space: nowrap;
    }

    .psm-order-matrix th {
        font-weight: 600;
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .psm-order-matrix td:first-child {
        text-align: left;
        font-weight: 500;
    }

    .psm-order-matrix tbody tr:nth-child(even) {
        background: rgba(0,0,0,0.02);
    }

    .psm-order-matrix input[type=text] {
        width: 70px;
        padding: 3px 6px;
        border-radius: 5px;
        border: 0.5px solid rgba(0,0,0,0.12);
        font-size: 11px;
        text-align: center;
        font-family: inherit;
    }

.psm-color-del-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ef4444;
    padding: 0 4px;
}

    .psm-color-del-btn:hover {
        color: #b91c1c;
    }

.psm-total-cell {
    font-weight: 700;
    color: #8b5cf6;
}

/* File upload — branded InputFile */
.psm-file-input {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.1));
    border: 0.5px dashed rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    font-size: 12px;
    color: #8b5cf6;
    cursor: pointer;
    font-family: inherit;
}

.psm-upload-new-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.psm-upload-thumb {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    border: 0.5px solid rgba(0,0,0,0.08);
}

    .psm-upload-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.psm-upload-del {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239,68,68,0.85);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* =============================================================
   COPY OB PAGE — additions
   Three-panel workspace layout
   ============================================================= */

/* Three-panel workspace */
.psm-copy-workspace {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    gap: 14px;
    align-items: start;
}

@media (max-width: 991px) {
    .psm-copy-workspace {
        grid-template-columns: 1fr;
    }
}

/* Panel card */
.psm-copy-panel {
    background: #ffffff;
    border-radius: 12px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.psm-copy-panel-head {
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(236, 72, 153, 0.06));
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
    font-size: 11px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .psm-copy-panel-head i {
        font-size: 14px;
        color: #8b5cf6;
    }

.psm-copy-panel-body {
    padding: 12px 14px;
}

    .psm-copy-panel-body.is-scroll {
        padding: 0;
        overflow: hidden;
    }

/* SubSection filter list */
.psm-subsection-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 14px;
}

.psm-subsection-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
    font-size: 11.5px;
    color: #0a0a0a;
    cursor: pointer;
}

    .psm-subsection-item:last-child {
        border-bottom: none;
    }

    .psm-subsection-item input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: #8b5cf6;
        flex-shrink: 0;
        cursor: pointer;
    }

.psm-subsection-all {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
    font-size: 11.5px;
    font-weight: 600;
    color: #8b5cf6;
}

    .psm-subsection-all input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: #8b5cf6;
        cursor: pointer;
    }

/* Panel toolbar (typeahead + stage + copy button row) */
.psm-copy-panel-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

    .psm-copy-panel-toolbar .psm-sort {
        padding: 5px 8px;
    }

        .psm-copy-panel-toolbar .psm-sort select {
            min-width: 90px;
        }

/* Copy action button */
.psm-copy-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
    transition: transform 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

    .psm-copy-action:hover {
        transform: translateY(-1px);
        color: #ffffff;
    }

    .psm-copy-action i {
        font-size: 14px;
    }

/* Breadcrumb */
.psm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 14px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
}

    .psm-breadcrumb a {
        color: #8b5cf6;
        text-decoration: none;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

        .psm-breadcrumb a:hover {
            color: #6366f1;
        }

.psm-breadcrumb-sep {
    color: rgba(0, 0, 0, 0.3);
}

.psm-breadcrumb-current {
    color: rgba(0, 0, 0, 0.7);
    font-weight: 500;
}

/* Compact OB table inside panel */
.psm-ob-table-wrap {
    max-height: 400px;
    overflow-y: auto;
}

    .psm-ob-table-wrap .psm-table thead tr {
        background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899) !important;
    }

    .psm-ob-table-wrap .psm-table th {
        font-size: 10px;
        padding: 8px 10px;
    }

    .psm-ob-table-wrap .psm-table td {
        padding: 6px 10px;
        font-size: 11px;
    }

    .psm-ob-table-wrap .psm-table input[type="checkbox"] {
        width: 15px;
        height: 15px;
        accent-color: #8b5cf6;
        cursor: pointer;
    }

/* SMV highlight */
.psm-smv-value {
    font-weight: 600;
    color: #8b5cf6;
}

/* ================================================================
   OB INDEX — Operation Sequence page
   ob-* classes — cinematic dark design system
   ================================================================ */

/* ── Page shell ── */
.ob-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0 0 32px;
    font-family: 'Inter','Segoe UI',sans-serif;
}

/* ── Toolbar card ── */
.ob-toolbar-card {
    background: #ffffff;
    border-radius: 12px;
    border: 0.5px solid rgba(10,14,26,0.07);
    box-shadow: 0 1px 4px rgba(10,14,26,0.05);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ob-toolbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

    .ob-toolbar-row.ob-toolbar-main {
        justify-content: space-between;
        flex-wrap: nowrap;
        align-items: center;
    }

/* ── Action icon strip ── */
.ob-action-strip {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding-left: 12px;
    border-left: 0.5px solid rgba(10,14,26,0.08);
    flex-shrink: 0;
}

.ob-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10,14,26,0.04);
    border: 0.5px solid rgba(10,14,26,0.09);
    color: #1a2454;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    flex-shrink: 0;
}

    .ob-action-btn:hover {
        background: rgba(26,36,84,0.10);
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(10,14,26,0.10);
        color: #1a2454;
    }

    .ob-action-btn.is-gold {
        color: #b07800;
        background: rgba(245,187,22,0.10);
        border-color: rgba(245,187,22,0.25);
    }

    .ob-action-btn.is-green {
        color: #10b981;
        background: rgba(16,185,129,0.10);
        border-color: rgba(16,185,129,0.25);
    }

/* ── Controls row ── */
.ob-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.ob-select {
    height: 34px;
    padding: 0 8px;
    border: 0.5px solid rgba(10,14,26,0.15);
    border-radius: 8px;
    font-size: 12px;
    color: #0a0e1a;
    background: #fafaf7;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
    max-width: 140px;
}

    .ob-select:focus {
        border-color: #F5BB16;
        box-shadow: 0 0 0 3px rgba(245,187,22,0.10);
    }

.ob-select-sm {
    height: 34px;
    min-width: 100px;
}

.ob-input {
    height: 34px;
    padding: 0 8px;
    border: 0.5px solid rgba(10,14,26,0.15);
    border-radius: 8px;
    font-size: 12px;
    color: #0a0e1a;
    background: #fafaf7;
    outline: none;
    transition: border-color 0.15s;
    width: 140px;
}

    .ob-input:focus {
        border-color: #F5BB16;
        box-shadow: 0 0 0 3px rgba(245,187,22,0.10);
    }

.ob-input-sm {
    width: 120px;
}

.ob-input-xs {
    width: 72px;
}

/* Style code search wrapper */
.ob-style-search {
    position: relative;
}

/* Autocomplete dropdown */
.ob-dropdown {
    position: absolute;
    top: 36px;
    left: 0;
    background: #ffffff;
    border: 0.5px solid rgba(10,14,26,0.12);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(10,14,26,0.12);
    z-index: 1050;
    min-width: 180px;
    max-height: 200px;
    overflow-y: auto;
    list-style: none;
    padding: 4px 0;
    margin: 0;
}

    .ob-dropdown li {
        padding: 7px 12px;
        font-size: 12px;
        color: #0a0e1a;
        transition: background 0.12s;
    }

        .ob-dropdown li:hover {
            background: rgba(26,36,84,0.07);
            color: #1a2454;
        }

/* SMV badge */
.ob-smv-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #1a2454, #0a0e1a);
    border-radius: 999px;
    color: #F5BB16;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.ob-smv-label {
    color: rgba(245,187,22,0.60);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.ob-smv-value {
    color: #F5BB16;
    font-size: 14px;
    font-weight: 700;
}

/* Search toggle */
.ob-search-toggle-row {
    padding-top: 2px;
}

.ob-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #0a0e1a;
    font-weight: 500;
    cursor: pointer;
}

.ob-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #F5BB16;
    cursor: pointer;
}

.ob-checkbox-lg {
    width: 22px;
    height: 22px;
}

/* ── Search operation panel ── */
.ob-search-panel {
    border-top: 0.5px solid rgba(10,14,26,0.07);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ob-search-filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.ob-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ob-filter-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(10,14,26,0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ob-autocomplete {
    position: relative;
}

.ob-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ob-search-icon {
    position: absolute;
    left: 9px;
    color: rgba(10,14,26,0.35);
    font-size: 14px;
    pointer-events: none;
}

.ob-search-wrap .ob-input {
    padding-left: 30px;
    width: 200px;
}

/* ── Operation results table ── */
.ob-op-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 0.5px solid rgba(10,14,26,0.08);
    max-height: 280px;
    overflow-y: auto;
}

.ob-op-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

    .ob-op-table thead tr {
        background: linear-gradient(135deg, #1a2454, #0a0e1a);
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .ob-op-table thead th {
        padding: 9px 12px;
        color: rgba(255,255,255,0.80);
        font-weight: 600;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        text-align: left;
        white-space: nowrap;
    }

    .ob-op-table tbody tr {
        border-bottom: 0.5px solid rgba(10,14,26,0.06);
    }

        .ob-op-table tbody tr:nth-child(even) {
            background: rgba(10,14,26,0.02);
        }

        .ob-op-table tbody tr:hover {
            background: rgba(26,36,84,0.04);
        }

    .ob-op-table td {
        padding: 7px 12px;
        color: #0a0e1a;
        vertical-align: middle;
    }

.ob-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: rgba(26,36,84,0.07);
    color: #1a2454;
    font-size: 13px;
    margin-left: 6px;
    text-decoration: none;
    transition: background 0.12s;
}

    .ob-cart-btn:hover {
        background: rgba(26,36,84,0.15);
        color: #1a2454;
    }

.ob-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
}

    .ob-status-pill.is-pending {
        background: rgba(245,187,22,0.12);
        color: #b07800;
    }

    .ob-status-pill.is-done {
        background: rgba(16,185,129,0.10);
        color: #10b981;
    }

/* ── Main Radzen grid card ── */
.ob-grid-card {
    background: #ffffff;
    border-radius: 12px;
    border: 0.5px solid rgba(10,14,26,0.07);
    box-shadow: 0 1px 4px rgba(10,14,26,0.05);
    overflow: hidden;
}

.ob-grid-wrap {
    height: 500px;
    overflow-y: auto;
}

/* Radzen grid theme overrides */
.ob-radzen-grid .rz-grid-table {
    width: 100%;
}

    .ob-radzen-grid .rz-grid-table td {
        padding: 5px 8px !important;
        line-height: 1.2 !important;
        font-size: 12px;
    }

.ob-radzen-grid .rz-datatable-thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

    .ob-radzen-grid .rz-column-header,
    .ob-radzen-grid .rz-column-title,
    .ob-radzen-grid .rz-datatable-thead th {
        background-color: #1a2454 !important;
        color: #ffffff !important;
        font-size: 11px !important;
        padding: 8px 10px !important;
    }

.ob-radzen-grid .rz-sortable-column-icon {
    color: #F5BB16 !important;
    fill: #F5BB16 !important;
}

.ob-radzen-grid .rz-data-row:nth-child(even) {
    background: rgba(10,14,26,0.02);
}

.ob-radzen-grid .rz-data-row:hover {
    background: rgba(26,36,84,0.05) !important;
}

.ob-radzen-grid .rz-state-highlight {
    background: rgba(245,187,22,0.08) !important;
}

/* Drag-over highlight */
.ob-drag-over td {
    border-top: 2px solid #F5BB16 !important;
    border-bottom: 2px solid #F5BB16 !important;
}

/* Seq cell + dots */
.ob-seq-cell {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ob-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.ob-dot-pink {
    background: hotpink;
}

.ob-dot-orange {
    background: orange;
}

.ob-dot-red {
    background: #ef4444;
}

.ob-dot-green {
    background: #10b981;
}

.ob-dot-none {
    background: transparent;
}

/* Inline grid controls */
.ob-inline-select {
    height: 28px;
    padding: 0 6px;
    border: 0.5px solid rgba(10,14,26,0.15);
    border-radius: 6px;
    font-size: 11px;
    background: #fafaf7;
    outline: none;
    width: 90px;
}

    .ob-inline-select:focus {
        border-color: #F5BB16;
    }

.ob-inline-input {
    height: 28px;
    padding: 0 8px;
    border: 0.5px solid rgba(10,14,26,0.15);
    border-radius: 6px;
    font-size: 11px;
    background: #fafaf7;
    outline: none;
    width: 100px;
}

    .ob-inline-input:focus {
        border-color: #F5BB16;
        box-shadow: 0 0 0 2px rgba(245,187,22,0.10);
    }

/* Delete header button */
.ob-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    color: #ef4444;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    margin-left: 4px;
    transition: background 0.12s;
}

    .ob-delete-btn:hover {
        background: rgba(239,68,68,0.10);
    }

/* ── Import drop zone ── */
.ob-drop-zone {
    border: 2px dashed rgba(26,36,84,0.20);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    background: rgba(10,14,26,0.02);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}

    .ob-drop-zone:hover {
        border-color: #F5BB16;
        background: rgba(245,187,22,0.04);
    }

.ob-drop-icon {
    font-size: 36px;
    color: #1a2454;
    opacity: 0.5;
    display: block;
    margin-bottom: 8px;
}

.ob-drop-text {
    font-size: 13px;
    color: rgba(10,14,26,0.45);
}

.ob-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .ob-action-strip {
        padding-right: 0;
        border-right: none;
        border-bottom: 0.5px solid rgba(10,14,26,0.08);
        padding-bottom: 10px;
        width: 100%;
    }

    .ob-controls {
        width: 100%;
    }

    .ob-search-filters {
        gap: 8px;
    }
}

/* ── Last action column (checkbox + delete) — compact ── */

/* Force the last column header and cells to be narrow */
.ob-radzen-grid .rz-column-header:last-child,
.ob-radzen-grid .rz-frozen-cell:last-child,
.ob-radzen-grid [data-frozen="right"],
.ob-radzen-grid .rz-datatable-thead [data-frozen="right"] {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    padding: 0 !important;
    text-align: center !important;
    overflow: hidden !important;
}
/* Header: checkbox on top, delete below, stacked */
.ob-action-col-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 40px;
    padding: 3px 0;
}
/* Body cell: checkbox centered */
.ob-action-col-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
}
    /* Checkbox inside action column */
    .ob-action-col-header .ob-checkbox,
    .ob-action-col-cell .ob-checkbox {
        width: 14px;
        height: 14px;
        accent-color: #F5BB16;
        cursor: pointer;
        margin: 0;
        flex-shrink: 0;
    }
/* Delete btn inside header */
.ob-action-col-header .ob-delete-btn {
    width: 16px;
    height: 16px;
    font-size: 12px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    cursor: pointer;
    text-decoration: none;
    border-radius: 3px;
    transition: background 0.12s;
}

    .ob-action-col-header .ob-delete-btn:hover {
        background: rgba(239,68,68,0.15);
    }
/* Frozen column shadow */
.ob-radzen-grid .rz-frozen-cell:last-child {
    background: #ffffff !important;
    box-shadow: -3px 0 8px rgba(10,14,26,0.08) !important;
}

.ob-radzen-grid .rz-column-header:last-child {
    background: #1a2454 !important;
    box-shadow: -3px 0 8px rgba(10,14,26,0.20) !important;
}

/* ================================================================
   THREAD CONSUMPTION — tc-* classes
   ================================================================ */

/* Main table wrapper — wide horizontal scroll */
.tc-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    background: #ffffff;
    border-radius: 12px;
    border: 0.5px solid rgba(10,14,26,0.07);
    box-shadow: 0 1px 4px rgba(10,14,26,0.05);
}

/* Thread table — compact, wide columns */
.tc-table {
    white-space: nowrap;
    min-width: 1800px;
}

    /* Description column — allow wrapping, fixed width */
    .tc-table .tc-desc {
        white-space: normal;
        min-width: 150px;
        max-width: 200px;
    }

    /* Highlight TotalThread column */
    .tc-table .tc-highlight {
        font-weight: 700;
        color: #1a2454;
        background: rgba(245,187,22,0.06);
    }

/* ── Operation page specific ── */
.psm-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}

    .psm-status-badge.is-estimate {
        background: rgba(245,187,22,0.15);
        color: #b07800;
    }

    .psm-status-badge.is-published {
        background: rgba(16,185,129,0.12);
        color: #10b981;
    }

/* Op action buttons */
.psm-op-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    border: 0.5px solid transparent;
    transition: background 0.12s, transform 0.1s;
}

    .psm-op-btn:hover {
        transform: translateY(-1px);
    }

    .psm-op-btn.op-cart {
        background: #f0f1f5;
        color: #1a2454;
        border-color: #e2e4ed;
        border-radius: 10px;
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    .psm-op-btn.op-edit {
        background: rgba(99,102,241,0.08);
        color: #6366f1;
        border-color: rgba(99,102,241,0.2);
    }

    .psm-op-btn.op-copy {
        background: rgba(10,14,26,0.05);
        color: #0a0e1a;
        border-color: rgba(10,14,26,0.12);
    }

    .psm-op-btn.op-analysis {
        background: rgba(245,187,22,0.10);
        color: #b07800;
        border-color: rgba(245,187,22,0.25);
    }

    .psm-op-btn.op-delete {
        background: rgba(239,68,68,0.07);
        color: #ef4444;
        border-color: rgba(239,68,68,0.18);
    }

    .psm-op-btn.op-video-no {
        background: rgba(10,14,26,0.04);
        color: rgba(10,14,26,0.35);
        border-color: rgba(10,14,26,0.10);
    }

    .psm-op-btn.op-video-ok {
        background: rgba(16,185,129,0.10);
        color: #10b981;
        border-color: rgba(16,185,129,0.25);
    }

.psm-op-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

/* OPNO cell */
.psm-opno-cell {
    display: flex;
    align-items: center;
    gap: 5px;
}

.psm-opno-expand {
    font-size: 13px;
    color: rgba(10,14,26,0.35);
    cursor: pointer;
    transition: color 0.12s;
}

    .psm-opno-expand:hover {
        color: #1a2454;
    }
/* psm-opno-dot defined in OperationIndex section above — green #10b981 */

/* Cart badge fix */
.psm-cart-badge {
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #F5BB16;
    color: #0a0e1a;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Grade add link */
.psm-grade-add-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: rgba(245,187,22,0.12);
    color: #b07800;
    border: 0.5px solid rgba(245,187,22,0.25);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

    .psm-grade-add-link:hover {
        background: rgba(245,187,22,0.22);
    }

/* Readonly input */
.psm-input-readonly {
    background: rgba(10,14,26,0.04) !important;
    color: rgba(10,14,26,0.45) !important;
    cursor: not-allowed;
}

/* Expand row */
.psm-expand-row td {
    background: rgba(26,36,84,0.03);
    padding: 0 !important;
}

.psm-expand-inner {
    padding: 10px 20px 14px;
}

.psm-expand-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #1a2454;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
    opacity: 0.7;
}
/* Expand inner uses psm-table — override font size only */
.psm-expand-inner .psm-table th,
.psm-expand-inner .psm-table td {
    font-size: 12px;
    padding: 6px 12px;
}

/* Status badges inside expand row */
.psm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.psm-badge-green {
    background: rgba(16,185,129,0.12);
    color: #10b981;
}

.psm-badge-blue {
    background: rgba(99,102,241,0.12);
    color: #6366f1;
}

.psm-badge-red {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
}

.psm-badge-muted {
    background: rgba(10,14,26,0.07);
    color: #666;
}

/* Op field grids for modals */
.psm-op-field-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.psm-op-field-grid-row2 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

@media (max-width: 1100px) {
    .psm-op-field-grid,
    .psm-op-field-grid-row2 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .psm-op-field-grid,
    .psm-op-field-grid-row2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Autocomplete */
.psm-autocomplete {
    position: relative;
}

.psm-autocomplete-input {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 0.5px solid rgba(10,14,26,0.15);
    border-radius: 8px;
    font-size: 12px;
    background: #fafaf7;
    outline: none;
    transition: border-color 0.15s;
}

    .psm-autocomplete-input:focus {
        border-color: #F5BB16;
        box-shadow: 0 0 0 3px rgba(245,187,22,0.10);
    }

.psm-autocomplete-list {
    position: absolute;
    top: 38px;
    left: 0;
    right: 0;
    background: #fff;
    border: 0.5px solid rgba(10,14,26,0.12);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(10,14,26,0.12);
    z-index: 1050;
    max-height: 180px;
    overflow-y: auto;
    list-style: none;
    padding: 4px 0;
    margin: 0;
}

.psm-autocomplete-item {
    padding: 7px 12px;
    font-size: 12px;
    color: #0a0e1a;
    cursor: pointer;
    transition: background 0.10s;
}

    .psm-autocomplete-item:hover {
        background: rgba(26,36,84,0.07);
        color: #1a2454;
    }

/* Field label row (label + add link) */
.psm-field-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

    .psm-field-label-row .psm-label {
        margin-bottom: 0;
    }

/* Subsection search */
.psm-subsection-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 0.5px solid rgba(10,14,26,0.12);
    background: #fafaf7;
}

    .psm-subsection-search input {
        border: none;
        outline: none;
        background: transparent;
        font-size: 12px;
        color: #0a0e1a;
        width: 140px;
    }

    .psm-subsection-search i {
        color: rgba(10,14,26,0.35);
        font-size: 14px;
    }

/* ================================================================
   STYLE INDEX — Photo gallery, pagination, style cards
   ================================================================ */

/* Photo gallery grid */
.psm-photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    background: #f8f7f4;
    border-radius: 10px;
    border: 0.5px dashed rgba(10,14,26,0.15);
    min-height: 80px;
}

.psm-photo-thumb {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: visible;
}

    .psm-photo-thumb img {
        width: 90px;
        height: 90px;
        object-fit: cover;
        border-radius: 8px;
        border: 0.5px solid rgba(10,14,26,0.10);
    }

.psm-photo-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    z-index: 2;
}

.psm-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: rgba(10,14,26,0.35);
    font-size: 12px;
    width: 100%;
    padding: 20px 0;
}

    .psm-photo-empty i {
        font-size: 20px;
    }

/* File input */
.psm-file-input {
    display: block;
    padding: 6px 10px;
    border-radius: 8px;
    border: 0.5px solid rgba(10,14,26,0.15);
    background: #fafaf7;
    font-size: 12px;
    cursor: pointer;
    width: 100%;
}

/* Style card photo area */
.psm-style-photo-wrap {
    display: flex;
    justify-content: center;
    margin-top: -28px;
    margin-bottom: 4px;
    z-index: 2;
    position: relative;
}

.psm-style-photo-inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(10,14,26,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a2454, #0a0e1a);
}

    .psm-style-photo-inner.g-1 {
        background: #1a2454;
    }

    .psm-style-photo-inner.g-2 {
        background: #F5BB16;
    }

    .psm-style-photo-inner.g-3 {
        background: #6366f1;
    }

    .psm-style-photo-inner.g-4 {
        background: #10b981;
    }

    .psm-style-photo-inner.g-5 {
        background: #0a0e1a;
    }

    .psm-style-photo-inner.g-6 {
        background: #d99c00;
    }

    .psm-style-photo-inner img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* Pagination */
.psm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.psm-page-btn {
    height: 32px;
    min-width: 32px;
    padding: 0 8px;
    border-radius: 7px;
    border: 0.5px solid rgba(10,14,26,0.12);
    background: #fff;
    color: #0a0e1a;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .psm-page-btn:hover:not(:disabled) {
        background: rgba(26,36,84,0.06);
        border-color: rgba(26,36,84,0.25);
    }

    .psm-page-btn.is-active {
        background: linear-gradient(180deg, #1a2454, #0a0e1a);
        color: #F5BB16;
        border-color: #1a2454;
    }

    .psm-page-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.psm-page-dots {
    color: rgba(10,14,26,0.4);
    font-size: 12px;
    padding: 0 2px;
}

.psm-page-info {
    font-size: 11px;
    color: rgba(10,14,26,0.45);
    margin-left: 8px;
}

/* ================================================================
   PROSMV — info labels, border status classes
   ================================================================ */
.psm-info-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(10,14,26,0.45);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 1px;
}

.psm-info-value {
    font-size: 12px;
    color: #000000;
    font-weight: 400;
}

/* Operation card status borders */
.left-border-initial {
    border-left: 4px dotted #ccc;
}

.left-border-saved {
    border-left: 4px solid hotpink;
    background-color: #F4E6F1;
}

.left-border-sent {
    border-left: 4px solid orange;
    background-color: #F9EEC5;
}

.left-border-rejected {
    border-left: 4px dashed red;
    background-color: #ffe6e6;
}

.left-border-approved {
    border-left: 4px solid green;
    background-color: #f6fff6;
}

/* Radzen grid overrides for Prosmv */
.rz-grid-table {
    width: unset;
}

    .rz-grid-table td {
        padding: 0.1rem !important;
        line-height: 1 !important;
    }

.rz-grid-header {
    height: 0.5rem !important;
    padding-top: 0.1rem !important;
    padding-bottom: 0.1rem !important;
    background-color: #1a2454 !important;
    color: #ffffff !important;
}

.custom-grid .rz-datatable-thead th,
.custom-grid .rz-column-header,
.custom-grid .rz-column-title {
    background-color: #1a2454 !important;
    color: #fff !important;
}

.custom-grid .rz-sortable-column-icon {
    color: #F5BB16 !important;
    fill: #F5BB16 !important;
}

.custom-grid .rz-datatable-thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #1a2454;
}

.rz-datatable input[type="text"], .rz-datatable select {
    padding: 2px 4px !important;
    font-size: 0.75rem !important;
    height: 24px !important;
    width: auto !important;
}

.rz-datatable input.form-control.freq-input {
    width: 50px !important;
    padding: 2px 4px;
    font-size: 0.75rem;
}

.rz-datatable input.form-control.desc-input {
    width: 150px !important;
    padding: 2px 4px;
    font-size: 0.75rem;
}

.my-class td {
    border-top: 1px solid black;
    border-bottom: 1px solid black;
}

/* ================================================================
   Thread Consumption — custom SVG icon class
   ================================================================ */
.psm-icon-thread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

    .psm-icon-thread svg {
        width: 1em;
        height: 1em;
        fill: currentColor;
    }
