/* ================================================================
   HAJIPUR CREATE PMR / DESIGN INPUT PAGE STYLES (Figma/Mockup)
   ================================================================ */

.cpmr-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a2e;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
    width: 100%;
}

/* Main Rounded White Box for Customer Details & Design Input */
.cpmr-main-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 24px 28px;
    box-sizing: border-box;
    width: 100%;
}

/* Customer Details Header */
.cpmr-header-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.cpmr-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.cpmr-badge-rh {
    background-color: #e5e7eb;
    color: #0405AB;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
}

.cpmr-subtitle {
    font-size: 12.5px;
    color: #9ca3af;
    margin: 0 0 20px 0;
}

/* 4-Column Form Grid */
.cpmr-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

/* Tablet & below only: keep 4-column form on laptops (1024px+). */
@media (max-width: 991.98px) {
    .cpmr-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .cpmr-grid-4 {
        grid-template-columns: 1fr;
    }
}

.cpmr-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cpmr-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
}

.cpmr-label .required-star {
    color: #ef4444;
    margin-left: 2px;
}

.cpmr-input,
.cpmr-select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
    color: #111827;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.cpmr-input:focus:not([readonly]):not(.cpmr-input-readonly),
.cpmr-select:focus:not([readonly]):not(.cpmr-input-readonly) {
    border-color: #9CA3AF;
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.2);
}

.cpmr-input.invalid,
.cpmr-input.is-invalid {
    border-color: #ef4444 !important;
}

.cpmr-input.invalid:focus,
.cpmr-input.is-invalid:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15) !important;
}

.cpmr-input-readonly,
.cpmr-input[readonly],
.cpmr-input:read-only,
.cpmr-input:disabled,
.cpmr-input[disabled],
.cpmr-input.cpmr-input-disabled {
    background-color: #f3f4f6 !important;
    color: #6b7280 !important;
    -webkit-text-fill-color: #6b7280 !important;
    cursor: not-allowed !important;
    border-color: #d1d5db !important;
    box-shadow: none !important;
    outline: none !important;
    caret-color: transparent !important;
    user-select: none;
}

.cpmr-input-readonly:hover,
.cpmr-input[readonly]:hover,
.cpmr-input:read-only:hover,
.cpmr-input:disabled:hover,
.cpmr-input[disabled]:hover,
.cpmr-input.cpmr-input-disabled:hover {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    outline: none !important;
    caret-color: transparent !important;
    user-select: none;
}

.cpmr-input-readonly:focus,
.cpmr-input[readonly]:focus,
.cpmr-input:read-only:focus,
.cpmr-input:disabled:focus,
.cpmr-input[disabled]:focus,
.cpmr-input.cpmr-input-disabled:focus,
.cpmr-input-readonly:focus-visible,
.cpmr-input[readonly]:focus-visible,
.cpmr-input:read-only:focus-visible,
.cpmr-input:disabled:focus-visible,
.cpmr-input[disabled]:focus-visible,
.cpmr-input.cpmr-input-disabled:focus-visible,
.cpmr-input-readonly:active,
.cpmr-input[readonly]:active,
.cpmr-input:read-only:active,
.cpmr-input:disabled:active,
.cpmr-input[disabled]:active,
.cpmr-input.cpmr-input-disabled:active {
    border-color: #d1d5db !important;
    box-shadow: none !important;
    outline: none !important;
    caret-color: transparent !important;
    user-select: none;
}

.cpmr-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cpmr-select-wrapper .cpmr-select {
    appearance: none;
    padding-right: 32px;
}

.cpmr-select-chevron {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: #9ca3af;
    display: flex;
    align-items: center;
}

.cpmr-select-chevron svg {
    width: 16px;
    height: 16px;
}

.cpmr-rh-icon {
    height: 22px;
    width: auto;
    object-fit: contain;
}

/* Outer Soft Lavender Wrapper for Design Input Section (#F5F5FF) */
.cpmr-design-section-wrapper {
    background-color: #F5F5FF;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Design Input Banner Inside Lavender Wrapper */
.cpmr-design-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.cpmr-design-banner-title {
    font-size: 16px;
    font-weight: 700;
    color: #0405AB;
    margin: 0;
}

.cpmr-btn-add-new {
    background-color: #0405AB;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cpmr-btn-add-new:hover {
    background-color: #03048a;
    color: #ffffff;
}

/* Design Input Item Card (White box inside Lavender container) */
.cpmr-design-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.cpmr-design-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.cpmr-design-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.cpmr-design-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cpmr-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ef4444;
    padding: 4px;
    display: flex;
    align-items: center;
}

.cpmr-chevron-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280 !important;
    -webkit-text-fill-color: #6b7280 !important;
    padding: 4px;
    display: flex;
    align-items: center;
}

/* Radio Group Row */
.cpmr-radio-row {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 40px;
}

.cpmr-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

.cpmr-radio-label input[type="radio"] {
    accent-color: #0405AB;
}


/* Custom Table matching media_1787160814986.png */
.cpmr-table-wrapper {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 16px;
    background: #ffffff;
}

.cpmr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cpmr-table th {
    background-color: #EBEBFF;
    color: #111827;
    font-weight: 700;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.cpmr-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

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

.cpmr-table-type-cell {
    font-weight: 600;
    color: #374151;
    width: 20%;
}

/* Submit Actions Outside Card */
.cpmr-submit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.cpmr-btn-cancel {
    background-color: #ffffff;
    color: #111827;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cpmr-btn-cancel:hover {
    border-color: #9ca3af;
    background-color: #f9fafb;
}

.cpmr-btn-submit {
    background-color: #0405AB;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.cpmr-btn-submit:hover {
    background-color: #03048a;
}

/* ================================================================
   OLD PMR SPLIT LAYOUT & RAW MATERIAL WEIGHTS CARD STYLES
   ================================================================ */

.cpmr-old-pmr-select {
    background-color: #f8f9ff !important;
    border-color: #e2e8f0;
}

.cpmr-split-layout {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    align-items: flex-start;
}

.cpmr-split-left {
    flex: 1 1 48%;
    min-width: 0;
    margin-top: 0 !important;
}

.cpmr-raw-material-card {
    flex: 1 1 52%;
    min-width: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cpmr-rm-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.cpmr-rm-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px 0;
}

.cpmr-rm-subtitle {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

.cpmr-btn-add-material {
    background-color: #ffffff;
    color: #111827;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.cpmr-btn-add-material:hover {
    border-color: #0405AB;
    color: #0405AB;
}

.cpmr-rm-table-wrapper {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

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

.cpmr-rm-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 12px;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
}

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

.cpmr-rm-table tr:last-child td {
    border-bottom: none;
}

.cpmr-rm-input {
    height: 36px;
    font-size: 12.5px;
    text-align: right;
}

.cpmr-rm-input:disabled,
.cpmr-rm-input[disabled],
.cpmr-rm-input.cpmr-input-disabled {
    background-color: #f8fafc;
    color: #475569;
    cursor: not-allowed !important;
    border-color: #e2e8f0;
    opacity: 1;
    -webkit-text-fill-color: #475569;
}

.cpmr-rm-input::placeholder {
    color: #94a3b8;
    text-align: right;
}

.cpmr-rm-input:disabled::placeholder,
.cpmr-rm-input[disabled]::placeholder,
.cpmr-rm-input.cpmr-input-disabled::placeholder {
    color: #94a3b8;
    -webkit-text-fill-color: #94a3b8;
    opacity: 1;
}

.cpmr-btn-delete-mat {
    color: #9ca3af;
    padding: 4px;
}

.cpmr-btn-delete-mat:hover {
    color: #ef4444;
}

/* Warning alert box */
.cpmr-warning-alert {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cpmr-warning-icon {
    color: #1e40af;
    display: flex;
    align-items: center;
    margin-top: 1px;
}

.cpmr-warning-text {
    font-size: 12px;
    color: #1e40af;
    line-height: 1.4;
}

/* Raw Material Footer & Action Buttons */
.cpmr-rm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
}

.cpmr-rm-footer .cpmr-warning-alert {
    flex: 1;
}

.cpmr-rm-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

@media (max-width: 991.98px) {
    .cpmr-split-layout {
        flex-direction: column;
    }

    .cpmr-split-left,
    .cpmr-raw-material-card {
        width: 100%;
    }

    .cpmr-rm-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .cpmr-rm-actions {
        justify-content: flex-end;
    }
}

/* ================================================================
   REVISION TABS (Between Customer Details & Design Input)
   ================================================================ */

.cpmr-revision-tabs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cpmr-rev-tab {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    border-radius: 4px 4px 0 0;
}

.cpmr-rev-tab:hover {
    color: #111827;
}

.cpmr-rev-tab.active {
    background-color: #eef2ff;
    color: var(--primary-color, #0405ab);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color, #0405ab);
}

/* ================================================================
   DESIGN OUTPUT SECTION (Below Submit Actions)
   ================================================================ */

.cpmr-design-output-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-top: 4px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}


.cpmr-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.cpmr-output-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.cpmr-output-subtabs {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.cpmr-output-subtab {
    background: transparent;
    border: none;
    padding: 8px 0;
    font-size: 13.5px;
    font-weight: 500;
    color: #6b7280 !important;
    -webkit-text-fill-color: #6b7280 !important;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.cpmr-output-subtab:hover {
    color: #111827;
}

.cpmr-output-subtab.active {
    color: var(--primary-color, #0405ab);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color, #0405ab);
}

/* Design Output Table */
.cpmr-output-table-wrapper {
    overflow-x: auto;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
}

.cpmr-output-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cpmr-output-table th {
    background-color: #fafbfd;
    color: #6b7280 !important;
    -webkit-text-fill-color: #6b7280 !important;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.cpmr-output-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
    vertical-align: middle;
    white-space: nowrap;
}

.cpmr-output-table tr:hover {
    background-color: #f9fafb;
}

.cpmr-product-tag {
    display: inline-block;
    background-color: #f0f2ff;
    color: #1e1b4b;
    font-weight: 500;
    font-size: 12.5px;
    padding: 4px 10px;
    border-radius: 6px;
}

/* Pagination Bar */
.cpmr-output-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 12px;
}

.cpmr-pagination-info {
    font-size: 12.5px;
    color: #6b7280 !important;
    -webkit-text-fill-color: #6b7280 !important;
}

.cpmr-pagination-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cpmr-page-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    color: #374151;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cpmr-page-btn:hover:not(.active) {
    background-color: #f9fafb;
    border-color: #d1d5db !important;
    box-shadow: none !important;
    outline: none !important;
    caret-color: transparent !important;
    user-select: none;
}

.cpmr-page-btn.active {
    background-color: var(--primary-color, #0405ab);
    border-color: var(--primary-color, #0405ab);
    color: #ffffff;
}






/* ── Action bar (Cancel / Submit) ─────────────────────────────────── */
.cpmr-action-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    margin-top: 8px;
}

/* ── Modal overlay shared by History & Success dialogs ─────────────── */
.cpmr-dialog-overlay {
    position: fixed;
    inset: 0;
    background: 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: 9999;
}

.cpmr-dialog {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px 32px 24px;
    min-width: 340px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    position: relative !important;
    overflow: hidden !important;
}

/* Branch crest sits flush at the very top edge, smoothly clipped by 16px radius */
.cpmr-dialog::before,
.cpmr-success-dialog::before,
.cpmr-dialog-overlay>div:first-child::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    width: 100% !important;
    background: linear-gradient(90deg, rgba(4, 5, 171, 0.85) 0%, rgba(4, 5, 171, 0.25) 30%, transparent 80%) !important;
    flex-shrink: 0 !important;
    pointer-events: none !important;
    border-radius: 16px 16px 0 0 !important;
    z-index: 10 !important;
}

.cpmr-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cpmr-dialog-header h4 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.cpmr-dialog-body {
    font-size: 14px;
    color: #6b7280 !important;
    -webkit-text-fill-color: #6b7280 !important;
    margin-bottom: 16px;
}

.cpmr-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.cpmr-dialog-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.cpmr-dialog-close:hover {
    color: #374151;
    background-color: #f3f4f6 !important;
}

/* ── Success Dialog specifics ─────────────────────────────────────── */
.cpmr-success-dialog {
    text-align: center;
    padding: 36px 40px 28px;
}

.cpmr-success-close {
    position: absolute;
    top: 16px;
    right: 16px;
}

.cpmr-success-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

/* outer pale-green bubble */
.cpmr-success-icon-bg {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #dcfce7;
    opacity: 0.6;
}

/* inner circle with border */
.cpmr-success-icon-circle {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2.5px solid #22c55e;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.cpmr-success-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.cpmr-success-subtitle {
    font-size: 13.5px;
    color: #6b7280 !important;
    -webkit-text-fill-color: #6b7280 !important;
    line-height: 1.55;
    margin: 0 0 4px;
}

.cpmr-success-dialog .cpmr-dialog-footer {
    justify-content: center;
}

/* Divider line inside design cards */
.cpmr-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

/* Radzen dropdown styling for PMR form */
.cpmr-radzen-dropdown {
    width: 100%;
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0 !important;
    font-size: 14px;
    color: #1f2937;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

.cpmr-radzen-dropdown .rz-dropdown-label-container {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.cpmr-radzen-dropdown:focus-within {
    border-color: #9CA3AF !important;
    outline: none !important;
    caret-color: transparent !important;
    user-select: none;
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.2) !important;
}

.cpmr-table-dropdown {
    height: 36px;
    font-size: 13px;
}


/* %LDR Section in Create PMR (Below Raw Material Table) */
.cpmr-ldr-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: -4px;
    margin-bottom: 0px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 100%);
    border: 1px solid #E0E7FF;
    border-left: 4px solid #0405AB;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(4, 5, 171, 0.04);
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.cpmr-ldr-card.is-disabled {
    background: #F9FAFB;
    border-color: #E5E7EB;
    border-left-color: #CBD5E1;
}

.cpmr-ldr-card.has-error {
    background: linear-gradient(135deg, #FFFDFD 0%, #FEF2F2 100%);
    border-color: #FECACA;
    border-left-color: #EF4444;
}

.cpmr-ldr-label-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.cpmr-ldr-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #1E293B;
    margin: 0;
    line-height: 1.3;
}

.cpmr-ldr-label .required-star {
    color: #EF4444 !important;
    font-weight: 700;
    margin-left: 1px;
}

.cpmr-ldr-hint {
    font-size: 11.5px;
    font-weight: 400;
    color: #64748B;
    margin: 0;
    line-height: 1.4;
    word-break: break-word;
}

.cpmr-ldr-card.is-disabled .cpmr-ldr-hint {
    color: #9CA3AF;
}

.cpmr-ldr-input-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.cpmr-ldr-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cpmr-ldr-input {
    width: 80px;
    height: 32px;
    padding: 4px 8px;
    font-size: 12.5px;
    font-weight: 500;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    background-color: #FFFFFF;
    color: #1F2937;
    box-sizing: border-box;
    transition: all 0.15s ease;
    text-align: right;
}

.cpmr-ldr-input:focus {
    border-color: #0405AB;
    outline: none;
    box-shadow: 0 0 0 2px rgba(4, 5, 171, 0.15);
}

.cpmr-ldr-input:disabled,
.cpmr-ldr-input[disabled] {
    background-color: #F3F4F6;
    color: #64748B;
    cursor: not-allowed !important;
    border-color: #E5E7EB;
    -webkit-text-fill-color: #64748B;
    opacity: 1;
}

.cpmr-ldr-input.invalid {
    border-color: #EF4444 !important;
}

.cpmr-ldr-input.invalid:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15) !important;
}

.cpmr-ldr-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
    box-sizing: border-box;
    flex-shrink: 0;
}

.cpmr-ldr-edit-btn:hover {
    background-color: #EEF2FF;
    border-color: #0405AB;
}

.cpmr-ldr-edit-btn:active {
    transform: scale(0.92);
}

.cpmr-ldr-edit-btn.is-editing {
    background-color: #EEF2FF;
    border-color: #0405AB;
    box-shadow: 0 0 0 2px rgba(4, 5, 171, 0.15);
}

.cpmr-ldr-edit-btn img,
.cpmr-ldr-edit-btn svg {
    width: 14px;
    height: 14px;
    display: block;
}

.cpmr-ldr-error-msg {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #EF4444;
}

/* Lock background scrolling while a PMR dialog (history/success) is open */
html:has(.cpmr-dialog-overlay),
body:has(.cpmr-dialog-overlay),
body :has(.cpmr-dialog-overlay) {
    overflow: hidden !important;
}

.cpmr-dialog-overlay {
    overscroll-behavior: contain;
}


/* ================================================================
   RESPONSIVE — Hajipur Add PMR (/hajipur/add-pmr)
   Laptop & desktop only (1200px – 1920px). Breakpoints follow
   css/responsive-layout.css. The 1200px / 1024px / 640px blocks above
   are below the supported width (html min-width: 1200px) and are kept
   only as a fallback.
   ================================================================ */

/* Standard laptops (1366 / 1440): slightly less padding around the form. */
@media (max-width: 1440px) {
    .cpmr-main-card {
        padding: 20px 22px;
    }

    .cpmr-design-card {
        padding: 16px;
    }
}

/* Small laptops (1240 / 1280): the form has 3 nested boxes (main card >
   Design Input wrapper > design card), so trimming each one's padding
   gives the 4-column grid and the old-PMR split layout ~60px more room. */
@media (max-width: 1280px) {
    .cpmr-container {
        gap: 12px;
    }

    .cpmr-main-card {
        padding: 16px 18px;
    }

    .cpmr-subtitle {
        margin-bottom: 14px;
    }

    .cpmr-grid-4 {
        gap: 12px;
        margin-bottom: 12px;
    }

    .cpmr-label {
        font-size: 12px;
    }

    /* Inputs: 40px -> 36px tall (radio row matches so it stays aligned). */
    .cpmr-input,
    .cpmr-select,
    .cpmr-radzen-dropdown,
    .cpmr-radio-row {
        height: 36px;
    }

    .cpmr-design-section-wrapper {
        padding: 12px;
        margin-top: 16px;
        gap: 12px;
    }

    .cpmr-design-card {
        padding: 14px;
    }

    .cpmr-design-card-header {
        margin-bottom: 12px;
    }

    .cpmr-btn-add-new {
        padding: 6px 14px;
        font-size: 13px;
    }

    /* Planning table (Type / Customer Details / Deep Planning). */
    .cpmr-table th {
        padding: 10px 12px;
    }

    .cpmr-table td {
        padding: 6px 8px;
    }

    /* Old-PMR split layout: tighter gap and Raw Material card padding. */
    .cpmr-split-layout {
        gap: 12px;
        margin-top: 12px;
    }

    .cpmr-raw-material-card {
        padding: 12px;
        gap: 12px;
    }

    .cpmr-rm-table th {
        padding: 8px 10px;
    }

    .cpmr-btn-cancel,
    .cpmr-btn-submit {
        padding: 8px 20px;
        font-size: 13px;
    }

    .cpmr-action-bar {
        padding-top: 14px;
    }
}

/* Small laptops with the sidebar EXPANDED (the user opened it below 1366px):
   each half of the old-PMR split would only be ~400px wide, too narrow for
   the planning dropdowns and the weight columns. Stack the two halves
   instead. With the sidebar collapsed (the default on these screens) the
   side-by-side layout is kept. */
@media (max-width: 1365.98px) {
    body:not(.sidebar-collapsed) .cpmr-split-layout {
        flex-direction: column;
        align-items: stretch;
    }

    body:not(.sidebar-collapsed) .cpmr-split-left,
    body:not(.sidebar-collapsed) .cpmr-raw-material-card {
        width: 100%;
        flex-basis: auto;
    }
}