/* RM Prices Modal & Region Procurement Modal Styles */

/* ── Shared Overlay ── */
.rm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Modal Shell ── */
.rm-modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.2s ease;
    width: 860px;
    max-width: 96vw;
}

.rm-modal--wide {
    width: 1000px;
}

@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Header ── */
.rm-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 100%);
    color: #fff;
    border-radius: 10px 10px 0 0;
}

.rm-modal__header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rm-modal__close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
}

.rm-modal__close:hover { background: rgba(255,255,255,0.3); }

/* ── Tabs ── */
.rm-modal__tabs {
    display: flex;
    border-bottom: 2px solid #e8edf2;
    background: #f8f9fa;
    padding: 0 24px;
}

.rm-modal__tab {
    padding: 12px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.rm-modal__tab:hover { color: #2d6a9f; }
.rm-modal__tab.active { color: #1a3a5c; border-bottom-color: #2d6a9f; font-weight: 600; }

/* ── Body ── */
.rm-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.rm-modal__tab-content { display: none; }
.rm-modal__tab-content.active { display: block; }

/* ── Month Selector Row ── */
.rm-modal__month-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px 16px;
    background: #f0f4f8;
    border-radius: 8px;
}

.rm-modal__month-row label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #344054;
    white-space: nowrap;
}

.rm-modal__month-row input[type="month"] {
    padding: 7px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #344054;
}

/* ── Table Styles ── */
.rm-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.rm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.855rem;
}

.rm-table th {
    background: #1a3a5c;
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.rm-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    color: #344054;
}

.rm-table tr:last-child td { border-bottom: none; }
.rm-table tr:hover td { background: #f7faff; }
.rm-table tr.inactive td { opacity: 0.5; }

/* ── Price Input ── */
.rm-price-input {
    width: 110px;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 0.855rem;
    text-align: right;
    transition: border-color 0.2s;
}

.rm-price-input:focus {
    outline: none;
    border-color: #2d6a9f;
    box-shadow: 0 0 0 2px rgba(45,106,159,0.15);
}

/* ── Action Buttons ── */
.rm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 0.855rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.rm-btn:active { transform: scale(0.97); }
.rm-btn--primary { background: #2d6a9f; color: #fff; }
.rm-btn--primary:hover { background: #1a3a5c; }
.rm-btn--success { background: #28a745; color: #fff; }
.rm-btn--success:hover { background: #1e7e34; }
.rm-btn--danger  { background: #dc3545; color: #fff; }
.rm-btn--danger:hover  { background: #b02a37; }
.rm-btn--secondary { background: #e9ecef; color: #495057; }
.rm-btn--secondary:hover { background: #dee2e6; }
.rm-btn--sm { padding: 4px 10px; font-size: 0.80rem; }

/* ── Add Row / Inline Form ── */
.rm-add-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #c8d6e5;
}

.rm-add-row input[type="text"] {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* ── Status Badge ── */
.rm-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.rm-badge--active   { background: #d1fae5; color: #065f46; }
.rm-badge--inactive { background: #fee2e2; color: #7f1d1d; }

/* ── Category Tag ── */
.rm-cat-tag {
    display: inline-block;
    background: #e0edff;
    color: #1a3a5c;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.78rem;
    margin: 2px;
}

/* ── Category Checkbox List ── */
.rm-cat-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
}

.rm-cat-checklist label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.855rem;
    color: #344054;
    cursor: pointer;
    padding: 5px 12px;
    border: 1px solid #d1dce8;
    border-radius: 20px;
    transition: background 0.15s, border-color 0.15s;
}

.rm-cat-checklist label:has(input:checked) {
    background: #e0edff;
    border-color: #2d6a9f;
    color: #1a3a5c;
    font-weight: 600;
}

.rm-cat-checklist input[type="checkbox"] { accent-color: #2d6a9f; }

/* ── Footer ── */
.rm-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid #f0f0f0;
    background: #f8f9fa;
}

/* ── Feedback banner ── */
.rm-feedback {
    padding: 9px 14px;
    border-radius: 6px;
    font-size: 0.855rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.rm-feedback--success { background: #d1fae5; color: #065f46; }
.rm-feedback--error   { background: #fee2e2; color: #b91c1c; }
.rm-feedback--info    { background: #dbeafe; color: #1e40af; }

/* ─── Region Procurement Modal ─── */
.region-proc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

.region-proc-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
}

.region-proc-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2d6a9f;
    display: flex;
    align-items: center;
    gap: 8px;
}

.region-proc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.region-proc-row label {
    font-size: 0.855rem;
    font-weight: 500;
    color: #344054;
    flex: 1;
}

.region-proc-row input[type="number"] {
    width: 140px;
    padding: 7px 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 0.855rem;
    text-align: right;
    transition: border-color 0.2s;
}

.region-proc-row input[type="number"]:focus {
    outline: none;
    border-color: #2d6a9f;
    box-shadow: 0 0 0 2px rgba(45,106,159,0.15);
}

/* Edit inline */
.rm-edit-input {
    padding: 5px 10px;
    border: 1px solid #2d6a9f;
    border-radius: 5px;
    font-size: 0.855rem;
    width: 100%;
    max-width: 200px;
}

/* Loading spinner inside table */
.rm-table-loading {
    text-align: center;
    padding: 30px;
    color: #6c757d;
    font-size: 0.9rem;
}
