/**
 * RMD CSS
 *
 * Change Log
 *
 * v0.1.11
 * - Added Case Hub person drill-through link styling.
 * - Raised Person modal above Case modal.
 *
 * v0.1.10
 * - Added Key Information section heading styling.
 *
 * v0.1.9
 * - Replaced delete button styling with active/inactive toggle button styling.
 *
 * v0.1.8
 * - Added Case Hub delete button styling.
 * - Added left/right footer action layout.
 *
 * v0.1.7
 * - Tidied Case Hub modal footer action bar.
 * - Added padding and rounded corners to footer action area.
 *
 * v0.1.6
 * - Polished Case Hub modal styling.
 * - Increased Case Hub modal width.
 * - Added light grey Case Hub body background.
 * - Added tab icon spacing and active tab colour.
 *
 * v0.1.5
 * - Added Case Hub modal, tab, card and key information styling.
 *
 * v0.1.4
 * - Added case relationship row hover styling.
 * - Added case relationship row cursor styling.
 *
 * v0.1.3
 * - Added consultation row hover styling.
 * - Added consultation row cursor styling.
 *
 * v0.1.2
 * - Added case row hover styling.
 * - Added case row cursor styling.
 *
 * v0.1.1
 * - Added organisation unit row hover styling.
 * - Added organisation unit row cursor styling.
 *
 * v0.1.0
 * - Added base scope styling.
 * - Added table styling.
 * - Added toolbar/button styling.
 * - Added rudimentary modal styling.
 */

.rmd-scope {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.rmd-scope * {
    box-sizing: border-box;
}

.rmd-card {
    padding: 1.25rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    background: #fff;
}

.rmd-muted {
    color: #666;
}

.rmd-hidden-flags {
    display: none;
}

.rmd-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rmd-button {
    display: inline-block;
    padding: 0.45rem 0.8rem;
    border: 1px solid #bbb;
    border-radius: 0.25rem;
    background: #f7f7f7;
    cursor: pointer;
    font: inherit;
}

.rmd-button:hover {
    background: #efefef;
}

.rmd-button-primary {
    border-color: #333;
    background: #333;
    color: #fff;
}

.rmd-button-primary:hover {
    background: #111;
}

.rmd-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.rmd-table th,
.rmd-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: top;
}

.rmd-table th {
    font-weight: 600;
    background: #f5f5f5;
}

.rmd-person-row {
    cursor: pointer;
}

.rmd-person-row:hover {
    background: #f9f9f9;
}

.rmd-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 1rem;
    background: rgba(0, 0, 0, 0.35);
}

.rmd-modal {
    width: min(900px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: 1.25rem;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.25);
}

.rmd-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rmd-modal-header h3 {
    margin: 0;
}

.rmd-modal-close {
    border: 0;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.rmd-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.rmd-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-weight: 600;
}

.rmd-form-grid input,
.rmd-form-grid select,
.rmd-form-grid textarea {
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 1px solid #bbb;
    border-radius: 0.25rem;
    font: inherit;
}

.rmd-checkbox-label {
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start;
}

.rmd-checkbox-label input {
    width: auto;
}

.rmd-modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.rmd-person-save-status {
    margin-right: auto;
    color: #666;
}



.rmd-org-unit-row {
    cursor: pointer;
}

.rmd-org-unit-row:hover {
    background: #f9f9f9;
}


.rmd-case-row {
    cursor: pointer;
}

.rmd-case-row:hover {
    background: #f9f9f9;
}


.rmd-consultation-row {
    cursor: pointer;
}

.rmd-consultation-row:hover {
    background: #f9f9f9;
}


.rmd-case-relationship-row {
    cursor: pointer;
}

.rmd-case-relationship-row:hover {
    background: #f9f9f9;
}




.rmd-case-modal-backdrop .rmd-modal {
    width: min(1500px, 98vw);
    padding: 0;
}

.rmd-case-hub-header {
    padding: 1.25rem 1.5rem;
    margin-bottom: 0;
    border-bottom: 1px solid #e0e0e0;
}

.rmd-case-tabs {
    display: flex;
    gap: 0;
    padding: 0 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.rmd-case-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;

    padding: 0.9rem 1rem;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: #555;
}

.rmd-case-tab:hover {
    background: #f2f2f2;
}

.rmd-case-tab.is-active {
    border-bottom-color: #0073aa;
    color: #111;
    font-weight: 600;
}


.rmd-case-tab-icon {
    display: inline-block;
    min-width: 1.1em;
    color: #666;
    text-align: center;
}

.rmd-case-tab.is-active .rmd-case-tab-icon {
    color: #0073aa;
}


.rmd-case-form {
    padding: 1.25rem 1.5rem;
}

.rmd-case-tab-panel {
    display: none;
}

.rmd-case-tab-panel.is-active {
    display: block;
}

.rmd-case-hub-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(450px, 1fr);
    gap: 1rem;
}

.rmd-case-hub-card {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 0.4rem;
    background: #fff;
}

.rmd-case-hub-card h4 {
    margin: 0 0 1rem;
}

.rmd-case-hub-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rmd-case-key-info {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.65rem 1rem;
    margin: 0;
}

.rmd-case-key-info dt {
    font-weight: 600;
}

.rmd-case-key-info dd {
    margin: 0;
    color: #333;
    overflow-wrap: anywhere;
}

.rmd-case-key-info-section {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e0e0e0;
}

.rmd-case-key-info-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.rmd-case-key-info-section h5 {
    margin: 0 0 0.55rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}


.rmd-case-child-table {
    margin-top: 0;
}

.rmd-case-child-table td:first-child {
    width: 220px;
    font-weight: 600;
}

.rmd-case-form .rmd-modal-actions {
    margin-top: 1.25rem;
    padding: 0.75rem;
    border-top: 1px solid #e0e0e0;
    border-radius: 0.4rem;
    background: #f5f6f7;
}


.rmd-modal-actions-left {
    margin-right: auto;
}

.rmd-modal-actions-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rmd-button-status-toggle {
    background: #fff;
}

.rmd-button-inactivate {
    border-color: #d63638;
    color: #d63638;
}

.rmd-button-inactivate:hover {
    background: #fff5f5;
}

.rmd-button-activate {
    border-color: #008a20;
    color: #008a20;
}

.rmd-button-activate:hover {
    background: #f0fff4;
}


.rmd-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #0073aa;
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-decoration: none;
}

.rmd-link-button:hover {
    text-decoration: underline;
}

.rmd-link-button:disabled {
    color: #666;
    cursor: default;
    text-decoration: none;
}

.rmd-person-modal-backdrop {
    z-index: 10000;
}

