/* rate-master.css - Extracted Rate Master inline styles for performance */

.rate-master-page {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 !important;
    min-height: 100% !important;
    padding: 14px 20px 60px 20px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    background-color: #f4f6fa;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #2b3674;
}

/* Header Section */
.rm-header-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(112, 144, 176, 0.06);
    margin-bottom: 16px;
    border: 1px solid #eef2f6;
}

.rm-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rm-header-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4318ff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.8);
}

.rm-header-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #2b3674;
    margin: 0;
    letter-spacing: 0.5px;
}

.rm-header-subtitle {
    font-size: 0.8rem;
    color: #707eae;
    margin: 2px 0 0 0;
    font-weight: 500;
}

.rm-filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e0e5f2;
    border-radius: 10px;
    padding: 6px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rm-filter-btn:hover {
    background: #f8fafc;
    border-color: #c7d2fe;
}

.rm-filter-btn .icon-funnel {
    font-size: 16px;
    color: #4318ff;
}

.rm-filter-btn .filter-text {
    font-size: 0.7rem;
    font-weight: 700;
    color: #4318ff;
}

/* Main Controls Card */
.rm-controls-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 4px 20px rgba(112, 144, 176, 0.06);
    margin-bottom: 16px;
    border: 1px solid #eef2f6;
}

.rm-type-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f4f7fe;
}

.rm-type-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #707eae;
    letter-spacing: 0.5px;
}

.rm-type-options {
    display: flex;
    align-items: center;
    gap: 20px;
}

.rm-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #485585;
    cursor: pointer;
    user-select: none;
}

.rm-radio-label input[type="radio"] {
    accent-color: #4318ff;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.rm-radio-label.active span {
    color: #2b3674;
    font-weight: 700;
}

/* Grid Layout */
.rm-grid-container {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
}

.rm-grid-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rm-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rm-field-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: #707eae;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.rm-input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e0e5f2;
    border-radius: 8px;
    font-size: 0.82rem;
    color: #2b3674;
    background-color: #ffffff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.rm-input:focus {
    border-color: #4318ff;
    box-shadow: 0 0 0 3px rgba(67, 24, 255, 0.08);
}

.rm-select {
    appearance: auto;
    cursor: pointer;
}

.rm-input-with-btn {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rm-profile-dropdown-wrapper {
    position: relative;
    flex: 1;
}

.rm-add-profile-btn {
    height: 36px;
    width: 36px;
    border-radius: 8px;
    background: #f0f2ff;
    color: #4318ff;
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.rm-add-profile-btn:hover {
    background: #e2e8ff;
}

.rm-edit-profile-btn {
    height: 36px;
    width: 36px;
    border-radius: 8px;
    background: #fff8e6;
    color: #d97706;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.rm-dept-options {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 36px;
}

.rm-copy-row {
    display: flex;
    gap: 8px;
}

.rm-btn-copy {
    height: 36px;
    padding: 0 20px;
    background: #4318ff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.rm-btn-copy:hover {
    background: #3311db;
}

.rm-two-col-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.rm-set-group {
    display: flex;
    gap: 6px;
}

.rm-select-compact {
    flex: 1.2;
    font-size: 0.78rem;
}

.rm-input-compact {
    width: 65px;
    text-align: center;
    font-weight: 700;
}

.rm-btn-set {
    height: 36px;
    padding: 0 14px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.rm-btn-set:hover {
    background: #1d4ed8;
}

.rm-btn-set-patient {
    width: 100%;
    height: 40px;
    background: linear-gradient(135deg, #4318ff 0%, #3311db 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(67, 24, 255, 0.2);
    transition: opacity 0.2s;
    margin-top: 4px;
}

.rm-btn-set-patient:hover {
    opacity: 0.95;
}

/* Table Container & Table Style */
.dc-bottom-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(112, 144, 176, 0.06);
    border: 1px solid #eef2f6;
}

.dc-table-wrapper {
    max-height: calc(100vh - 430px);
    min-height: 320px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.dc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.dch-table-thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: #707eae;
    font-weight: 800;
    font-size: 0.68rem;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-bottom: 2px solid #e0e5f2;
    z-index: 10;
    white-space: nowrap;
    text-transform: uppercase;
}

.dch-table-tr:hover {
    background-color: #f8fafc;
}

.dch-table-tr td {
    padding: 8px 12px;
    border-bottom: 1px solid #f4f7fe;
    color: #2b3674;
    vertical-align: middle;
    white-space: nowrap;
}

/* Footers / Stat cards */
.dc-footers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.dc-footer-card {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 10px rgba(112, 144, 176, 0.04);
}

.dc-footer-info label {
    font-size: 0.68rem;
    font-weight: 800;
    color: #707eae;
    letter-spacing: 0.5px;
}

.dc-footer-info .value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #2b3674;
}

.rm-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e5f2;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 9999;
    max-height: 220px;
    overflow-y: auto;
}

.rm-dropdown-item {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: none;
    background: transparent;
    font-size: 0.82rem;
    color: #2b3674;
    cursor: pointer;
    border-bottom: 1px solid #f4f7fe;
}

.rm-dropdown-item:hover {
    background: #f8fafc;
    color: #4318ff;
}

/* Mobile Card View (< 768px) */
.mobile-card-list {
    display: none;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 767.98px) {
    /* Hide HTML table completely on mobile viewports */
    .dc-table-wrapper table.dc-table,
    .dc-table-wrapper .dc-table {
        display: none !important;
    }

    /* Show mobile card list */
    .mobile-card-list {
        display: flex !important;
    }

    /* Card styling */
    .mobile-data-card {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 14px 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        display: flex;
        flex-direction: column;
        gap: 10px;
        position: relative;
    }

    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        border-bottom: 1px solid #f1f5f9;
        padding-bottom: 8px;
    }

    .mobile-card-srno {
        font-weight: 800;
        color: #4f46e5;
        font-size: 0.75rem;
        background: #eef2ff;
        padding: 2px 8px;
        border-radius: 6px;
    }

    .mobile-card-title {
        font-weight: 700;
        color: #1e293b;
        font-size: 0.9rem;
        text-transform: uppercase;
        flex: 1;
        margin-left: 8px;
    }

    .mobile-card-subtitle {
        font-size: 0.75rem;
        color: #64748b;
        font-style: italic;
    }

    .mobile-card-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px 12px;
        font-size: 0.8rem;
    }

    .mobile-card-field {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-card-label {
        font-size: 0.68rem;
        font-weight: 800;
        color: #707eae;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mobile-card-value {
        font-weight: 700;
        color: #2b3674;
    }

    /* Fix floating badge / absolute overlays overlapping text */
    .floating-badge,
    [class*="floating"],
    .rm-header-card [class*="badge"] {
        position: static !important;
        transform: none !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    .rm-controls-card {
        padding: 14px !important;
    }

    .rm-two-col-fields {
        grid-template-columns: 1fr !important;
    }

    .rm-type-options {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .rm-dept-options {
        flex-wrap: wrap !alignment;
        height: auto !important;
        gap: 8px !important;
    }

    /* Flex-wrap pagination cleanly without breaking screen boundaries */
    .pagination-container,
    .dch-pagination,
    .tm-pagination-bar,
    [class*="pagination"] {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 12px 8px !important;
    }

    .pagination-buttons {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px !important;
    }

    .pagination-btn,
    .tm-btn-outline {
        flex: 1 1 auto !important;
        min-width: 60px !important;
        text-align: center !important;
    }
}

/* Desktop View (>= 768px) */
@media (min-width: 768px) {
    .dc-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    .dc-table-wrapper table.dc-table {
        display: table !important;
        width: 100%;
    }

    .mobile-card-list {
        display: none !important;
    }
}

/* Excel Action Buttons & Import Modal Styling */
.rm-excel-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rm-btn-excel-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.rm-btn-excel-export:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.rm-btn-excel-import {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
    margin: 0;
}

.rm-btn-excel-import:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.rm-btn-excel-template {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.rm-btn-excel-template:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Excel Import Audit Modal */
.rm-import-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.rm-import-modal-card {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 1050px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    animation: rmModalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rmModalSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.rm-import-modal-header {
    padding: 16px 22px;
    background: #0f172a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1e293b;
}

.rm-import-modal-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rm-import-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px 22px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.rm-import-kpi-card {
    background: #ffffff;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rm-import-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.rm-import-kpi-num {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.1;
}

.rm-import-kpi-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.rm-import-modal-body {
    padding: 16px 22px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rm-import-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow-y: auto;
    max-height: 380px;
    background: #ffffff;
}

.rm-import-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.rm-import-table th {
    position: sticky;
    top: 0;
    background: #f1f5f9;
    color: #475569;
    font-weight: 800;
    padding: 8px 12px;
    text-align: left;
    border-bottom: 2px solid #cbd5e1;
    z-index: 5;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.rm-import-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

.rm-import-table tr:hover {
    background: #f8fafc;
}

.rm-import-badge-changed {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.68rem;
}

.rm-import-badge-matched {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.68rem;
}

.rm-import-badge-unmatched {
    background: #fef3c7;
    color: #b45309;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.68rem;
}

.rm-import-modal-footer {
    padding: 14px 22px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


