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

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

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

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

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

/* Card Base */
.spdv-card {
    background-color: #FFFFFF;
    border: 1px solid #E5E5EE;
    border-radius: 8px;
    padding: 14px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

.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;
}

.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 */
.spdv-rm-table-wrap {
    border: 1px solid #F0F0F5;
    border-radius: 6px;
    max-height: 250px;
    overflow-y: auto;
    background-color: #FFFFFF;
}

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

.spdv-rm-table th {
    background-color: #FFFFFF;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #808080;
    text-align: left;
    border-bottom: 1px solid #E5E5EE;
    position: sticky;
    top: 0;
    z-index: 5;
}

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

.spdv-rm-table td {
    padding: 6px 10px;
    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;
}

.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: #3449D8;
}

.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;
}

.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;
}

/* Total Weights & RM Cost Row */
.spdv-total-row {
    display: flex;
    align-items: center;
    padding: 12px 10px 4px 10px;
    margin-top: 8px;
    border-top: 1px solid #E5E5EE;
    gap: 10px;
}

.spdv-total-label {
    font-size: 12px;
    font-weight: 700;
    color: #151515;
    margin-right: auto;
}

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

.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-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

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

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

.spdv-cost-input-sm {
    width: 44px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid #E5E5EE;
    border-radius: 6px;
    font-size: 12px;
    color: #151515;
    background-color: #FFFFFF;
    text-align: center;
}

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

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

.spdv-cost-pill-red {
    width: 100px;
    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;
}

.spdv-cost-pill-gray {
    width: 100px;
    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;
}

/* ================================================================
   BOTTOM FOOTER BUTTONS CARD (In-Page Flow)
   ================================================================ */
.spdv-footer-card {
    background-color: #FFFFFF;
    border: 1px solid #E5E5EE;
    border-radius: 8px;
    padding: 14px 20px;
    margin-top: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.spdv-btn-white {
    background-color: #FFFFFF;
    border: 1px solid #D9E0E7;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    color: #151515;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}
.spdv-btn-white:hover {
    background-color: #F8F9FA;
    border-color: #CBD5E1;
}

.spdv-btn-black {
    background-color: #151515;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    cursor: pointer;
    transition: background-color 0.15s;
}
.spdv-btn-black:hover {
    background-color: #2D2D2D;
}

.spdv-btn-red {
    background-color: #FF0022;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    cursor: pointer;
    transition: background-color 0.15s;
}
.spdv-btn-red:hover {
    background-color: #D9001B;
}

/* 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);
    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);
    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);
    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;
}
