/* ================================================================
   SANTEJ PMR DETAIL VIEW STYLES - Exact Figma Design Reproduction
   ================================================================ */

.spdv-page {
    font-family: inherit;
    color: #151515;
    background-color: transparent;
    min-height: 100%;
    padding: 0 0 80px 0;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Two Column Layout: Left (~68%), Right Cost Summary (~32%) */
.spdv-grid {
    display: flex;
    gap: 12px;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.spdv-left-col {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
}

.spdv-right-col {
    flex: 0 0 320px;
    width: 320px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
}

/* Card Base */
.spdv-card {
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.03);
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

/* Branch Identity Crest on Primary Cards (PMR Information & Cost Summary) */
.spdv-left-col>.spdv-card:first-child,
.spdv-cost-card {
    position: relative;
    overflow: hidden;
}

.spdv-left-col>.spdv-card:first-child::before,
.spdv-cost-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.85) 0%, rgba(220, 38, 38, 0.25) 35%, transparent 85%);
    pointer-events: none;
    z-index: 2;
}

/* Section Icon Badge & Branded PMR Number Pill */
.spdv-section-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background-color: #FEF2F2;
    color: #DC2626;
    border: 1px solid rgba(220, 38, 38, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.spdv-section-icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.spdv-pmr-pill {
    display: inline-block;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.spdv-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.spdv-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #151515;
    margin: 0;
}

/* Red Info Badge Button */
.spdv-info-badge-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spdv-info-icon {
    width: 18px;
    height: 18px;
    display: block;
}

/* PMR Info Grid (1 row x 4 cols) */
.spdv-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding-top: 4px;
}

.spdv-info-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.spdv-info-label {
    font-size: 11px;
    font-weight: 600;
    color: #151515;
}

.spdv-info-value {
    font-size: 13px;
    font-weight: 400;
    color: #808080;
}

/* Raw Material Weights Card Header Elements */
.spdv-rm-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Revised-status pills shown next to the Raw Material Weights heading. */
.spdv-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    height: 24px;
    box-sizing: border-box;
    white-space: nowrap;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.spdv-status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.spdv-status-lab {
    color: #3449D8;
    background-color: #EEF0FF;
    border: 1px solid #D5DAFB;
}

.spdv-status-prod {
    color: #00B4E5;
    background-color: #DBF4FF;
    border: 1px solid #00B4E5;
}

/*.status-emailsent {
    background-color: #EFF6FF;
    border: 1px solid #60A5FA;
    color: #1D4ED8;
}
*/
.spdv-pill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background-color: #FFFFFF;
    border: 1px solid #8090FE;
    color: #3449D8;
    line-height: 1.2;
}

.spdv-btn-add-material {
    background-color: #FFFFFF;
    border: 1px solid #D9E0E7;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #151515;
    cursor: pointer;
    margin-left: auto;
    transition: background-color 0.15s, border-color 0.15s;
}

.spdv-btn-add-material:hover {
    background-color: #F8F9FA;
    border-color: #CBD5E1;
}

.spdv-card-subtitle {
    font-size: 12px;
    color: #808080;
    margin: -4px 0 14px 0;
    font-weight: 400;
}

/* Raw Material Table Wrapper */
/* Grows with the screen height so PMRs with many materials use the free
   space instead of scrolling in a small box. 480px is roughly everything
   else on the page (header, PMR info, card titles, Cost per Kg rows,
   footer buttons). Never smaller than the original 250px, so 720–768px
   tall laptops look the same as before. */
.spdv-rm-table-wrap {
    border: 1px solid #F0F0F5;
    border-radius: 6px;
    max-height: max(250px, calc(100vh - 480px));
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    background-color: #FFFFFF;
}

.spdv-rm-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 12px;
}

.spdv-rm-table th {
    background-color: #F8FAFC;
    padding: 9px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    border-bottom: 1px solid #E2E8F0;
    position: sticky;
    top: 0;
    z-index: 5;
    white-space: nowrap;
}

.spdv-rm-table tbody tr {
    transition: background-color 0.15s ease;
}

.spdv-rm-table tbody tr:hover {
    background-color: rgba(220, 38, 38, 0.025);
}

.spdv-col-material {
    text-align: left;
    min-width: 130px;
}

.spdv-col-rate {
    text-align: right;
    width: 95px;
    min-width: 75px;
}

.spdv-col-weight {
    text-align: right;
    width: 125px;
    min-width: 85px;
}

.spdv-col-new-weight {
    text-align: right;
    width: 120px;
    min-width: 85px;
}

.spdv-col-cost {
    text-align: right;
    width: 105px;
    min-width: 80px;
}

.spdv-col-action {
    width: 36px;
    min-width: 36px;
    text-align: center;
}

.spdv-pencil-icon {
    width: 12px;
    height: 12px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Pencil toggle button that unlocks a column for editing. */
.spdv-pencil-btn {
    border: none;
    background: transparent;
    padding: 2px;
    cursor: pointer;
    line-height: 0;
    border-radius: 4px;
}

.spdv-pencil-btn:hover {
    background-color: #F4F3FF;
}

.spdv-pencil-btn.spdv-pencil-active {
    background-color: #E0DBFF;
}

/* Read-only / disabled cells: non-interactive, no hover, no focus */
.spdv-rm-input[readonly],
.spdv-rm-input:read-only,
.spdv-rm-input:disabled,
.spdv-rm-input[disabled] {
    background-color: #F8F8FB;
    border-color: #ECECF2;
    color: #555;
    cursor: default !important;
    pointer-events: none;
    outline: none !important;
    box-shadow: none !important;
    user-select: none;
}

.spdv-rm-input[readonly]:hover,
.spdv-rm-input:read-only:hover,
.spdv-rm-input:disabled:hover,
.spdv-rm-input[disabled]:hover,
.spdv-rm-input[readonly]:focus,
.spdv-rm-input:read-only:focus,
.spdv-rm-input:disabled:focus,
.spdv-rm-input[disabled]:focus {
    background-color: #F8F8FB !important;
    border-color: #ECECF2 !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: default !important;
}

/* New Weight purple column when locked/read-only */
.spdv-rm-input.spdv-input-purple[readonly],
.spdv-rm-input.spdv-input-purple:read-only,
.spdv-rm-input.spdv-input-purple:disabled,
.spdv-rm-input.spdv-input-purple[disabled] {
    background-color: #F4F3FF !important;
    border-color: #E0DBFF !important;
    color: #151515 !important;
    font-weight: 600;
    cursor: default !important;
    pointer-events: none;
    outline: none !important;
    box-shadow: none !important;
    user-select: none;
}

.spdv-rm-input.spdv-input-purple[readonly]:hover,
.spdv-rm-input.spdv-input-purple:read-only:hover,
.spdv-rm-input.spdv-input-purple:disabled:hover,
.spdv-rm-input.spdv-input-purple[disabled]:hover,
.spdv-rm-input.spdv-input-purple[readonly]:focus,
.spdv-rm-input.spdv-input-purple:read-only:focus,
.spdv-rm-input.spdv-input-purple:disabled:focus,
.spdv-rm-input.spdv-input-purple[disabled]:focus {
    background-color: #F4F3FF !important;
    border-color: #E0DBFF !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: default !important;
}

.spdv-rm-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #F5F5F8;
    vertical-align: middle;
}

.spdv-select-wrap {
    position: relative;
    width: 100%;
}

.spdv-rm-select {
    width: 100%;
    height: 32px;
    padding: 0 24px 0 10px;
    border: 1px solid #E5E5EE;
    border-radius: 6px;
    font-size: 12px;
    color: #151515;
    background-color: #FFFFFF;
    appearance: none;
    cursor: pointer;
}

.spdv-select-chevron {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #808080;
}

.spdv-select-chevron svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Radzen raw-material dropdown used in admin "Add Material" rows. */
.spdv-select-radzen.rz-dropdown {
    width: 100%;
    min-height: 32px;
    height: 32px;
    border: 1px solid #E5E5EE;
    border-radius: 6px;
    font-size: 12px;
    background-color: #FFFFFF;
}

.spdv-rm-input {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #E5E5EE;
    border-radius: 6px;
    font-size: 12px;
    color: #151515;
    background-color: #FFFFFF;
    box-sizing: border-box;
    text-align: right;
}

.spdv-rm-input:focus {
    outline: none;
    border-color: #9CA3AF;
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.2);
}

.spdv-input-purple {
    background-color: #F4F3FF;
    border: 1px solid #E0DBFF;
    color: #151515;
    font-weight: 600;
}

.spdv-box-red {
    height: 32px;
    padding: 0 10px;
    background-color: #FFF0F2;
    border: 1px solid #FFE0E4;
    border-radius: 6px;
    color: #FF0022;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    cursor: default;
    pointer-events: none;
    user-select: none;
}

.spdv-btn-delete {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #CBD5E1;
    line-height: 0;
    transition: color 0.15s;
}

.spdv-btn-delete:hover {
    color: #FF2D55;
}

.spdv-btn-delete svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Table Footer (Total Row aligned directly below columns) */
.spdv-rm-table tfoot {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background-color: #FFFFFF;
}

.spdv-total-tr td {
    padding: 8px 8px;
    border-top: 1px solid #E5E5EE;
    border-bottom: none;
    vertical-align: middle;
    background-color: #FFFFFF;
}

.spdv-total-td-label {
    text-align: left;
    vertical-align: middle;
}

.spdv-total-label {
    font-size: 12px;
    font-weight: 700;
    color: #151515;
    line-height: 1.3;
}

.spdv-total-box {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    box-sizing: border-box;
    text-align: right;
}

.spdv-total-box-plain {
    background-color: #F4F4F8;
    border: 1px solid #E5E5EE;
    color: #151515;
}

.spdv-total-box-purple {
    background-color: #F4F3FF;
    border: 1px solid #E0DBFF;
    color: #151515;
}

.spdv-total-box-red {
    background-color: #FFF0F2;
    border: 1px solid #FFE0E4;
    color: #FF0022;
    font-weight: 700;
}

/* ================================================================
   RIGHT COLUMN: Cost Summary Card Styles
   ================================================================ */
.spdv-cost-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.spdv-cost-card-subtitle {
    font-size: 12px;
    color: #808080;
    /*    margin: -4px 0 16px 0;*/
    padding-bottom: 12px;
    border-bottom: 1px solid #F0F0F5;
    font-weight: 400;
    line-height: 1.3;
}

.spdv-cost-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spdv-cost-item {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.spdv-cost-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.spdv-cost-label {
    font-size: 12px;
    font-weight: 500;
    color: #151515;
    white-space: nowrap;
    flex-shrink: 0;
}

.spdv-cost-row-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.spdv-cost-input-sm {
    width: 50px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid #E5E5EE;
    border-radius: 6px;
    font-size: 12px;
    color: #151515;
    background-color: #FFFFFF;
    text-align: center;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.spdv-cost-input-md {
    width: 110px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #E5E5EE;
    border-radius: 6px;
    font-size: 12px;
    color: #151515;
    background-color: #FFFFFF;
    text-align: right;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.spdv-cost-input-sm:focus,
.spdv-cost-input-md:focus {
    border-color: #9CA3AF;
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.2);
}

.spdv-cost-input-sm.invalid,
.spdv-cost-input-md.invalid {
    border-color: #EF4444 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15) !important;
}

/* Disabled styling matching Cost per Kg (.spdv-cost-pill-gray) without hover effects */
.spdv-cost-input-sm:disabled,
.spdv-cost-input-sm[disabled],
.spdv-cost-input-sm.spdv-cost-input-disabled,
.spdv-cost-input-md:disabled,
.spdv-cost-input-md[disabled],
.spdv-cost-input-md.spdv-cost-input-disabled {
    background-color: #F4F4F8 !important;
    border: 1px solid #E5E5EE !important;
    color: #151515 !important;
    font-weight: 600 !important;
    cursor: default !important;
    outline: none !important;
    box-shadow: none !important;
}

.spdv-cost-input-sm:disabled:hover,
.spdv-cost-input-sm[disabled]:hover,
.spdv-cost-input-sm.spdv-cost-input-disabled:hover,
.spdv-cost-input-md:disabled:hover,
.spdv-cost-input-md[disabled]:hover,
.spdv-cost-input-md.spdv-cost-input-disabled:hover,
.spdv-cost-input-sm:disabled:focus,
.spdv-cost-input-sm[disabled]:focus,
.spdv-cost-input-sm.spdv-cost-input-disabled:focus,
.spdv-cost-input-md:disabled:focus,
.spdv-cost-input-md[disabled]:focus,
.spdv-cost-input-md.spdv-cost-input-disabled:focus {
    background-color: #F4F4F8 !important;
    border-color: #E5E5EE !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: default !important;
}

.spdv-cost-percent-sign {
    font-size: 12px;
    color: #808080;
}

/* Read-only computed amount (e.g. profit in rupees), styled like the inputs. */
.spdv-cost-readonly {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background-color: #fff;
    color: #333;
    flex-shrink: 0;
}

.spdv-cost-pill-red {
    min-width: 110px;
    max-width: 155px;
    height: 32px;
    padding: 0 10px;
    background-color: #FFF0F2;
    border: 1px solid #FFE0E4;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #FF0022;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    box-sizing: border-box;
    flex-shrink: 0;
    overflow: hidden;
}

.spdv-cost-pill-gray {
    min-width: 110px;
    max-width: 155px;
    height: 32px;
    padding: 0 10px;
    background-color: #F4F4F8;
    border: 1px solid #E5E5EE;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #151515;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    box-sizing: border-box;
    flex-shrink: 0;
    overflow: hidden;
}

.spdv-cost-pill-red span,
.spdv-cost-pill-gray span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ================================================================
   BOTTOM FOOTER BUTTONS CARD (Bottom Attached Frosted Glass Dock)
   ================================================================ */
.spdv-footer-card {
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0;
    padding: 14px 24px;
    margin: 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-collapsed .spdv-footer-card {
    left: 70px;
}

@media (max-width: 768px) {
    .spdv-footer-card {
        left: 0;
    }
}

.spdv-btn-white {
    background-color: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    color: #1F2937;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.spdv-btn-white:hover {
    background-color: #F8FAFC;
    border-color: #94A3B8;
    color: #111827;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.spdv-btn-white:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.spdv-btn-black {
    background-color: #18181B;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.spdv-btn-black:hover {
    background-color: #27272A;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

.spdv-btn-black:active {
    transform: translateY(0);
    background-color: #09090B;
}

.spdv-btn-red {
    background-color: #DC2626;
    border: 1px solid #DC2626;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.spdv-btn-red:hover {
    background-color: #B91C1C;
    border-color: #B91C1C;
    box-shadow: 0 3px 8px -1px rgba(220, 38, 38, 0.35);
    transform: translateY(-1px);
}

.spdv-btn-red:active {
    transform: translateY(0);
    background-color: #991B1B;
}

/* Cost Action Icons */
.spdv-cost-title-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
}

.spdv-cost-action-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.spdv-icon-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, transform 0.1s;
}

.spdv-icon-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.spdv-action-icon {
    width: 22px;
    height: 22px;
    display: block;
}

/* ================================================================
   SANTEJ PMR DETAILS DIALOG (spdd-*)
   ================================================================ */
.spdd-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    font-family: inherit;
}

.spdd-modal {
    background: #FFFFFF;
    border-radius: 10px;
    width: 680px;
    max-width: 92vw;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #E5E5EE;
    overflow: hidden;
    animation: spddFadeIn 0.2s ease-out;
}

@keyframes spddFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spdd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #E5E5EE;
}

.spdd-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spdd-title {
    font-size: 15px;
    font-weight: 700;
    color: #151515;
    margin: 0;
}

.spdd-badge-purple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 14px;
    background-color: #F3E8FA;
    border: 1px solid #8E44AD;
    color: #8E44AD;
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 12px;
    height: 26px;
    min-width: 105px;
    box-sizing: border-box;
    line-height: 1;
    white-space: nowrap;
}

.spdd-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #808080;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.spdd-close-btn:hover {
    color: #151515;
}

.spdd-body {
    padding: 16px 20px 20px 20px;
}

.spdd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 20px;
    row-gap: 14px;
}

.spdd-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-bottom: 1px solid #F0F0F5;
    padding-bottom: 10px;
}

.spdd-label {
    font-size: 11px;
    font-weight: 600;
    color: #151515;
}

.spdd-value {
    font-size: 12px;
    color: #808080;
    font-weight: 400;
}

.spdd-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 20px;
    border-top: 1px solid #E5E5EE;
}

.spdd-btn-close {
    background: #FFFFFF;
    border: 1px solid #E5E5EE;
    border-radius: 6px;
    padding: 6px 24px;
    font-size: 12px;
    font-weight: 600;
    color: #151515;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.spdd-btn-close:hover {
    background-color: #F8F9FA;
    border-color: #D1D5DB;
}

/* ================================================================
   CONFIRM PRODUCTION SUBMISSION DIALOG (cpsd-*)
   ================================================================ */
.cpsd-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10500;
    font-family: inherit;
}

.cpsd-modal {
    background: #FFFFFF;
    border-radius: 14px;
    width: 440px;
    max-width: 90vw;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    padding: 28px 28px 24px 28px;
    box-sizing: border-box;
    animation: cpsdFadeIn 0.2s ease-out;
    text-align: center;
}

@keyframes cpsdFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cpsd-close-btn {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 20px;
    color: #6B7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.cpsd-close-btn:hover {
    color: #111827;
}

.cpsd-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cpsd-icon-wrap {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.cpsd-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.cpsd-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.cpsd-desc {
    font-size: 12.5px;
    color: #9CA3AF;
    margin: 0 0 24px 0;
    line-height: 1.4;
    max-width: 320px;
}

.cpsd-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.cpsd-btn-discard {
    background-color: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 600;
    color: #151515;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    min-width: 130px;
}

.cpsd-btn-discard:hover {
    background-color: #F9FAFB;
    border-color: #9CA3AF;
}

.cpsd-btn-submit {
    background-color: #FF0000;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    cursor: pointer;
    transition: background-color 0.15s;
    min-width: 130px;
}

.cpsd-btn-submit:hover {
    background-color: #D90000;
}

/* ================================================================
   SANTEJ RECOMMENDED DIALOG (srd-*)
   ================================================================ */
.srd-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    font-family: inherit;
}

.srd-modal {
    background: #FFFFFF;
    border-radius: 10px;
    width: 460px;
    max-width: 90vw;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    border: 1px solid #E5E5EE;
    overflow: hidden;
    animation: srdFadeIn 0.2s ease-out;
}

@keyframes srdFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.srd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #E5E5EE;
}

.srd-title {
    font-size: 15px;
    font-weight: 700;
    color: #151515;
    margin: 0;
}

.srd-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #808080;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.srd-close-btn:hover {
    color: #151515;
}

.srd-body {
    padding: 18px 20px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.srd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 16px;
    row-gap: 10px;
    border-bottom: 1px solid #F0F0F5;
    padding-bottom: 14px;
}

.srd-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.srd-label {
    font-size: 11px;
    font-weight: 600;
    color: #151515;
}

.srd-value {
    font-size: 12px;
    color: #808080;
    font-weight: 400;
}

.srd-note-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.srd-note-text {
    font-size: 12px;
    color: #808080;
    margin: 0;
    line-height: 1.45;
    font-weight: 400;
}


/* Validation error messages inside the cost summary card */
.spdv-cost-field-wrap {
    align-items: flex-start;
}

.spdv-cost-field-col {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.spdv-field-error {
    font-size: 11px;
    color: #DC2626;
    margin-top: 4px;
    line-height: 1.35;
    font-weight: 500;
    text-align: right;
    display: block;
}

.spdv-cost-field-col .spdv-field-error {
    text-align: left;
    max-width: 220px;
}

/* Recommended badge as a clickable button */
.spdv-pill-badge-btn {
    cursor: pointer;
    background: none;
    transition: background-color 0.15s, border-color 0.15s;
}

.spdv-pill-badge-btn:hover {
    background-color: #EEF0FF;
    border-color: #3449D8;
}

/* ================================================================
   RESPONSIVE DESIGN (Laptop & Desktop: 1200px – 1920px)
   Breakpoints follow css/responsive-layout.css: 1440px, 1280px.
   The 1080px / 768px blocks further down are below the supported
   width (html min-width: 1200px) and are kept only as a fallback.
   ================================================================ */

/* Standard Laptops (1200px to 1440px, or 1080p with 125%/150% scaling) */
@media (max-width: 1440px) {
    .spdv-right-col {
        flex: 0 0 280px;
        width: 280px;
        min-width: 280px;
    }

    .spdv-card {
        padding: 12px 14px;
    }

    .spdv-cost-input-md {
        width: 95px;
    }

    .spdv-cost-input-sm {
        width: 44px;
        padding: 0 4px;
    }

    .spdv-cost-pill-red,
    .spdv-cost-pill-gray {
        min-width: 95px;
        max-width: 125px;
    }

    .spdv-cost-label {
        font-size: 11.5px;
    }

    .spdv-footer-card {
        padding: 12px 16px;
        gap: 8px;
    }

    .spdv-btn-white,
    .spdv-btn-black,
    .spdv-btn-red {
        padding: 8px 14px;
        font-size: 12.5px;
    }

    .spdv-info-grid {
        gap: 10px;
    }

    .spdv-total-box {
        padding: 0 6px;
    }
}

/* Small Laptops (1240px / 1280px screens).
   Keeps the 2-column layout and the 280px Cost Summary from the 1440px
   block; tightens spacing so the materials table fits without scrolling
   even when the user expands the sidebar. */
@media (max-width: 1280px) {

    .spdv-grid,
    .spdv-left-col {
        gap: 10px;
    }

    .spdv-card {
        padding: 10px 12px;
    }

    .spdv-card-title-row {
        margin-bottom: 8px;
    }

    .spdv-card-title {
        font-size: 14px;
    }

    .spdv-card-subtitle {
        margin-bottom: 10px;
    }

    /* PMR Information: 4 columns still fit; just tighter. */
    .spdv-info-grid {
        gap: 8px;
    }

    .spdv-info-value {
        font-size: 12px;
        overflow-wrap: anywhere;
    }

    /* Materials table: smaller cell + input padding. */
    .spdv-rm-table th {
        padding: 8px 6px;
    }

    .spdv-rm-table td,
    .spdv-total-tr td {
        padding: 5px 6px;
    }

    .spdv-rm-input,
    .spdv-box-red {
        padding: 0 6px;
    }

    .spdv-total-label {
        font-size: 11.5px;
    }

    /* Cost Summary: tighter rows inside the 280px column. */
    .spdv-cost-list {
        gap: 10px;
    }

    .spdv-cost-row,
    .spdv-cost-row-right {
        gap: 4px;
    }

    .spdv-cost-label {
        font-size: 11px;
    }

    .spdv-cost-input-md {
        width: 92px;
        padding: 0 6px;
    }

    .spdv-cost-pill-red,
    .spdv-cost-pill-gray {
        min-width: 92px;
        padding: 0 6px;
    }

    .spdv-cost-card-subtitle {
        font-size: 11.5px;
        padding-bottom: 10px;
    }

    /* Footer buttons: smaller, and wrap if the sidebar is expanded. */
    .spdv-footer-card {
        margin-top: 10px;
        padding: 10px 12px;
    }

    .spdv-btn-white,
    .spdv-btn-black,
    .spdv-btn-red {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Tablets and Narrow Viewports (<= 991.98px): keep desktop side-by-side on laptops */
@media (max-width: 991.98px) {
    .spdv-grid {
        flex-direction: column;
    }

    .spdv-left-col {
        width: 100%;
        flex: 1 1 100%;
    }

    .spdv-right-col {
        width: 100%;
        flex: 1 1 100%;
        min-width: 0;
    }

    .spdv-cost-card {
        height: auto;
    }

    .spdv-cost-row-right {
        justify-content: flex-end;
    }

    .spdv-cost-input-md {
        width: 110px;
    }

    .spdv-cost-input-sm {
        width: 50px;
    }

    .spdv-cost-pill-red,
    .spdv-cost-pill-gray {
        min-width: 110px;
        max-width: 155px;
    }

    .spdv-footer-card {
        justify-content: center;
        gap: 10px;
    }
}

/* Tablets and Mobile (<= 768px) */
@media (max-width: 768px) {
    .spdv-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .spdv-footer-card {
        flex-direction: column;
        align-items: stretch;
    }

    .spdv-btn-white,
    .spdv-btn-black,
    .spdv-btn-red {
        width: 100%;
        text-align: center;
    }
}

/* ================================================================
   SANTEJ SELLING COST PER KG HIGHLIGHT BOX (Red Theme)
   ================================================================ */
.spmr-selling-cost-highlight,
.santej-pmr-details-dialog .hpmr-selling-cost-highlight {
    width: 38%;
    margin-top: 10px;
    padding: 6px 12px;
    background-color: #FEF2F2;
    border: 1px solid #FECACA;
    border-left: 3.5px solid #FF0000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-sizing: border-box;
    box-shadow: 0 1px 4px rgba(255, 0, 0, 0.05);
    overflow: hidden;
}

.spmr-selling-cost-label-wrap,
.santej-pmr-details-dialog .hpmr-selling-cost-label-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.spmr-selling-cost-label,
.santej-pmr-details-dialog .hpmr-selling-cost-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #0F172A;
    letter-spacing: 0.1px;
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}

.spmr-selling-cost-sublabel,
.santej-pmr-details-dialog .hpmr-selling-cost-sublabel {
    font-size: 10px;
    font-weight: 500;
    color: #64748B;
    line-height: 1.2;
    white-space: nowrap;
}

.spmr-selling-cost-value-wrap,
.santej-pmr-details-dialog .hpmr-selling-cost-value-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background-color: #FFFFFF;
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid #FECACA;
    box-shadow: 0 1px 3px rgba(255, 0, 0, 0.06);
    min-width: 0;
    max-width: calc(100% - 115px);
    box-sizing: border-box;
    flex-shrink: 1;
}

.spmr-selling-cost-currency,
.santej-pmr-details-dialog .hpmr-selling-cost-currency {
    font-size: 12px;
    font-weight: 700;
    color: #0F172A;
    flex-shrink: 0;
}

.spmr-selling-cost-value,
.santej-pmr-details-dialog .hpmr-selling-cost-value {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

@media (max-width: 600px) {

    .spmr-selling-cost-highlight,
    .santej-pmr-details-dialog .hpmr-selling-cost-highlight {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 8px 12px;
    }

    .spmr-selling-cost-value-wrap,
    .santej-pmr-details-dialog .hpmr-selling-cost-value-wrap {
        align-self: flex-start;
        max-width: 100%;
    }
}