/* ============================================================
   RAW MATERIALS V2 — PREMIUM REDESIGN
   ============================================================ */

/* ── Hero Header ── */
.rm-hero-header {
    position: relative;
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem 2rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
    animation: fade-up 0.5s ease;
}

.rm-hero-glow {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.15) 0%, rgba(16, 185, 129, 0.08) 50%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    animation: hero-glow-pulse 4s ease-in-out infinite alternate;
}

.rm-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.rm-hero-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rm-hero-icon-wrap {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.rm-hero-icon-ring {
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-md);
    background: conic-gradient(#0d9488, #10b981, #d97706, #0d9488);
    opacity: 0.5;
    animation: ring-spin 8s linear infinite;
}

.rm-hero-icon {
    position: relative;
    width: 52px;
    height: 52px;
    background: linear-gradient(145deg, #0d9488, #0f766e);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.35);
}

.rm-hero-title {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.035em;
    color: var(--text);
    margin: 0;
    line-height: 1.2;
}

.rm-hero-sub {
    font-size: 0.82rem;
    color: var(--text3);
    margin: 0.25rem 0 0;
    font-weight: 500;
}

.rm-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ── Action Chip ── */
.rm-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.rm-action-chip i {
    font-size: 0.85rem;
}

.rm-action-chip.danger:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.04);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
    transform: translateY(-1px);
}

/* ── Add Button ── */
.rm-add-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.35rem;
    background: linear-gradient(145deg, #0d9488 0%, #0f766e 100%);
    border: none;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3);
}

.rm-add-btn-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.18) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.rm-add-btn:hover .rm-add-btn-glow {
    transform: translateX(100%);
}

.rm-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.4);
}

.rm-add-btn:active {
    transform: translateY(0);
}

/* ── Search Strip ── */
.rm-search-strip {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
    animation: fade-up 0.5s ease 0.1s backwards;
}

/* ── Filter Pills ── */
.rm-filter-pills {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rm-pill-select {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.5rem 0 0.75rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text2);
    transition: all 0.2s ease;
    cursor: pointer;
    height: 36px;
}

.rm-pill-select > i {
    font-size: 0.8rem;
    color: var(--teal);
    flex-shrink: 0;
}

.rm-pill-select select {
    border: none;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text2);
    outline: none;
    cursor: pointer;
    padding: 0 1.2rem 0 0.1rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.1rem center;
    background-size: 8px;
    min-width: 70px;
}

.rm-pill-select:focus-within {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.08);
}

.rm-pill-select select:focus {
    outline: none;
}

.rm-pill-select:hover {
    border-color: rgba(13, 148, 136, 0.35);
    background: rgba(13, 148, 136, 0.03);
}

.rm-search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 380px;
    display: flex;
    align-items: center;
}

.rm-search-icon-wrap {
    position: absolute;
    left: 0;
    width: 42px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text3);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.2s;
}

.rm-search-box:focus-within .rm-search-icon-wrap {
    color: var(--teal);
}

.rm-search-box input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    outline: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.rm-search-box input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.08), 0 4px 12px rgba(13, 148, 136, 0.06);
}

.rm-search-box input::placeholder {
    color: var(--text3);
    font-weight: 400;
}

.rm-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(13, 148, 136, 0.04));
    border: 1px solid rgba(13, 148, 136, 0.15);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--teal-d);
}

.rm-count-badge i {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ── Cards Container ── */
.rm-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 0.75rem;
    animation: fade-up 0.5s ease 0.15s backwards;
}

/* ── Material Card ── */
.rm-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: pv2-card-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) var(--card-delay, 0s) backwards;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.rm-card:hover {
    border-color: rgba(13, 148, 136, 0.25);
    box-shadow: 0 8px 28px rgba(13, 148, 136, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
    transform: translateY(-2px);
}

.rm-card-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.rm-card-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    flex: 1;
}

.rm-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    flex-shrink: 0;
    border: 1px solid;
    letter-spacing: -0.02em;
    transition: transform 0.25s ease;
}

.rm-card:hover .rm-card-avatar {
    transform: scale(1.08);
}

.rm-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.rm-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rm-card-unit {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text3);
    padding: 0.1em 0;
}

.rm-card-unit i {
    font-size: 0.7rem;
    opacity: 0.5;
}

.rm-card-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}

.rm-card-cost {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.rm-card-cost-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text3);
}

.rm-card-cost-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--teal-d);
    letter-spacing: -0.02em;
}

.rm-card-actions {
    display: flex;
    gap: 0.3rem;
    opacity: 0;
    transform: translateX(6px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.rm-card:hover .rm-card-actions {
    opacity: 1;
    transform: translateX(0);
}

.rm-card-action {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface2);
    color: var(--text3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.rm-card-action-edit:hover {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.2);
    color: #7c3aed;
}

.rm-card-action-delete:hover {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ── Empty State ── */
.rm-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface2) 100%);
    border: 1px dashed var(--border2);
    border-radius: var(--radius-xl);
    text-align: center;
    animation: fade-up 0.6s ease;
}

.rm-empty-icon {
    position: relative;
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, rgba(13, 148, 136, 0.1), rgba(13, 148, 136, 0.05));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--teal);
    margin-bottom: 1.5rem;
}

.rm-empty-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 24px;
    border: 2px solid rgba(13, 148, 136, 0.2);
    animation: empty-pulse 2s ease-in-out infinite;
}

.rm-empty-state h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 0.5rem;
}

.rm-empty-state p {
    font-size: 0.88rem;
    color: var(--text3);
    margin: 0 0 1.5rem;
    max-width: 320px;
}

.rm-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(145deg, #0d9488, #0f766e);
    border: none;
    border-radius: 100px;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3);
}

.rm-empty-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.4);
}

/* ── No Results ── */
.rm-no-results {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2.5rem 1.5rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    color: var(--text3);
    font-size: 0.88rem;
    font-weight: 500;
    animation: fade-up 0.3s ease;
}

.rm-no-results i {
    font-size: 1.1rem;
    opacity: 0.5;
}

/* ── Responsive — Raw Materials V2 ── */
@media (max-width: 900px) {
    .rm-hero-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .rm-hero-actions {
        width: 100%;
    }

    .rm-add-btn {
        flex: 1;
        justify-content: center;
    }

    .rm-search-strip {
        flex-direction: column;
    }

    .rm-search-box {
        max-width: 100%;
    }

    .rm-filter-pills {
        width: 100%;
    }

    .rm-pill-select {
        flex: 1;
        justify-content: center;
    }

    .rm-pill-select select {
        flex: 1;
    }

    .rm-cards-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .rm-hero-header {
        padding: 1.25rem;
    }

    .rm-hero-title {
        font-size: 1.35rem;
    }

    .rm-hero-icon-wrap {
        width: 44px;
        height: 44px;
    }

    .rm-hero-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .rm-card-inner {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .rm-card-actions {
        opacity: 1;
        transform: none;
    }

    .rm-card-cost-value {
        font-size: 1rem;
    }

    .rm-action-chip span {
        display: none;
    }
}


/* ============================================================
   RAW MATERIAL MODAL V2 — PREMIUM REDESIGN
   ============================================================ */

.rm-modal-content {
    border: none !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
}

/* ── Modal Header ── */
.rm-modal-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface2) 100%);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.rm-modal-header-glow {
    position: absolute;
    top: -40px;
    left: -40px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(30px);
    pointer-events: none;
    animation: hero-glow-pulse 4s ease-in-out infinite alternate;
}

.rm-modal-header-inner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    position: relative;
    z-index: 1;
}

.rm-modal-icon-wrap {
    position: relative;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
}

.rm-modal-icon {
    position: relative;
    width: 46px;
    height: 46px;
    background: linear-gradient(145deg, #0d9488, #0f766e);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    z-index: 1;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}

.rm-modal-icon-ring {
    position: absolute;
    inset: -3px;
    border-radius: 17px;
    background: conic-gradient(#0d9488, #10b981, #d97706, #0d9488);
    opacity: 0.4;
    animation: ring-spin 6s linear infinite;
    z-index: 0;
}

.rm-modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.02em;
}

.rm-modal-subtitle {
    font-size: 0.72rem;
    color: var(--text3);
    margin: 0.15rem 0 0;
    font-weight: 500;
}

.rm-modal-close {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.rm-modal-close:hover {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    transform: rotate(90deg);
}

/* ── Modal Body ── */
.rm-modal-body {
    padding: 1.75rem !important;
}

/* ── Field Group ── */
.rm-field-group {
    margin-bottom: 1.5rem;
}

.rm-field-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text3);
    margin-bottom: 0.5rem;
}

.rm-field-label i {
    font-size: 0.75rem;
    color: var(--teal);
    opacity: 0.7;
}

.rm-required {
    color: #ef4444;
    font-size: 0.8rem;
}

/* ── Input Wrap ── */
.rm-input-wrap {
    position: relative;
}

.rm-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text);
    outline: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.rm-input::placeholder {
    color: var(--text3);
    font-weight: 400;
    font-size: 0.85rem;
}

.rm-input:focus {
    border-color: var(--teal);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.08);
}

.rm-input-focus-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #0d9488, #10b981);
    border-radius: 0 0 12px 12px;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.rm-input:focus~.rm-input-focus-line {
    left: 0;
    width: 100%;
}

.rm-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08) !important;
}

/* Cost Input with ₹ prefix */
.rm-input-cost {
    position: relative;
}

.rm-input-prefix {
    position: absolute;
    left: 1px;
    top: 1px;
    bottom: 1px;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface3);
    border-right: 1px solid var(--border);
    border-radius: 11px 0 0 11px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--teal-d);
    pointer-events: none;
}

.rm-input-with-prefix {
    padding-left: 3.2rem !important;
}

/* ── Select Wrap ── */
.rm-select-wrap {
    position: relative;
}

.rm-select {
    width: 100%;
    padding: 0.8rem 2.2rem 0.8rem 1rem;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text);
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.rm-select:focus {
    border-color: var(--teal);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.08);
}

.rm-select-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    font-size: 0.8rem;
    pointer-events: none;
    transition: color 0.2s;
}

.rm-select:focus+.rm-select-chevron {
    color: var(--teal);
}

/* ── Fields Row ── */
.rm-fields-row {
    display: flex;
    gap: 1rem;
}

.rm-field-half {
    flex: 1;
}

/* ── Field Error ── */
.rm-field-error {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.45rem;
    padding: 0.4rem 0.7rem;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.12);
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #ef4444;
    animation: shake-error 0.4s ease;
}

.rm-field-error i {
    font-size: 0.75rem;
    flex-shrink: 0;
}

@keyframes shake-error {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-4px);
    }

    40% {
        transform: translateX(4px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(2px);
    }
}

/* ── Modal Footer ── */
.rm-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface2) 100%);
    border-top: 1px solid var(--border);
}

.rm-btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.2rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.rm-btn-cancel i {
    font-size: 0.75rem;
}

.rm-btn-cancel:hover {
    border-color: var(--border2);
    background: var(--surface3);
    color: var(--text);
}

.rm-btn-save {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.6rem;
    background: linear-gradient(145deg, #0d9488, #0f766e);
    border: none;
    border-radius: 100px;
    font-size: 0.88rem;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3);
    font-family: inherit;
}

.rm-btn-save-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.rm-btn-save:hover .rm-btn-save-glow {
    transform: translateX(100%);
}

.rm-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

.rm-btn-save:active {
    transform: translateY(0);
}

/* ── Sub-Variants Toggle ── */
.rm-subvariant-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px dashed rgba(13, 148, 136, 0.3);
    background: rgba(13, 148, 136, 0.03);
    transition: border-color .2s, background .2s;
}
.rm-subvariant-toggle-label:hover {
    border-color: rgba(13, 148, 136, 0.6);
    background: rgba(13, 148, 136, 0.07);
}
.rm-toggle-track {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    background: #d1d5db;
    border-radius: 10px;
    flex-shrink: 0;
    transition: background .2s;
}
#compHasSubVariants:checked + .rm-toggle-knob,
#compHasLoss:checked + .rm-toggle-knob,
#compSyncPrices:checked + .rm-toggle-knob,
#compIsTradingItem:checked + .rm-toggle-knob {
    transform: translateX(16px);
}
#compHasSubVariants:checked ~ .rm-toggle-track,
#subVariantTrack:has(input:checked) {
    background: #0d9488;
}
#compLossTrack:has(input:checked) {
    background: #d97706;
}
#syncPricesTrack:has(input:checked) {
    background: #16a34a;
}
#tradingItemTrack:has(input:checked) {
    background: #0369a1;
}
#compHasTradingTypes:checked + .rm-toggle-knob {
    transform: translateX(16px);
}
#tradingTypesTrack:has(input:checked) {
    background: #0369a1;
}
.rm-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s;
    pointer-events: none;
}

/* Sub-variant rows */
.rm-subvariant-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}
.rm-sv-input {
    padding: 7px 10px !important;
    font-size: 0.84rem !important;
}
.rm-sv-cost {
    padding-left: 24px !important;
}
.rm-sv-prefix {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 0.84rem;
    pointer-events: none;
}
.rm-sv-delete {
    width: 28px;
    height: 28px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    transition: background .15s;
}
.rm-sv-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}
.rm-add-subvariant-btn {
    margin-top: 4px;
    padding: 5px 12px;
    font-size: 0.75rem;
    background: rgba(13, 148, 136, 0.08);
    color: #0d9488;
    border: 1px solid rgba(13, 148, 136, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background .15s;
}
.rm-add-subvariant-btn:hover {
    background: rgba(13, 148, 136, 0.15);
}
.rm-sv-badge-inline {
    font-size: 0.78rem !important;
    color: #0d9488 !important;
    font-weight: 700;
    background: rgba(13,148,136,0.1);
    padding: 1px 7px;
    border-radius: 8px;
}

/* ── Responsive ── */
@media (max-width: 576px) {
    .rm-modal-header {
        padding: 1.25rem;
    }

    .rm-modal-body {
        padding: 1.25rem !important;
    }

    .rm-modal-footer {
        padding: 1rem 1.25rem;
    }

    .rm-fields-row {
        flex-direction: column;
        gap: 0;
    }

    .rm-modal-icon-wrap {
        width: 40px;
        height: 40px;
    }

    .rm-modal-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .rm-modal-icon-ring {
        border-radius: 15px;
    }
}

