/* ========================================
   GLOBAL BRAND COLORS
   ======================================== */
.border-custom-1 {
    border-color: rgb(45,101,145);
    border-style: solid;
}

.border-bottom-custom-1 {
    border-bottom-color: rgb(45,101,145);
    border-bottom-style: solid;
}

.btn-custom-1 {
    background-color: rgb(45,101,145);
    border-color: rgb(45,101,145);
    color: #ffffff;
}

.btn-custom-1:first-child:active,
.btn-custom-1:focus,
.btn-custom-1:hover {
    background-color: rgb(37,93,137);
    border-color: rgb(37,93,137);
}

.text-custom-1 {
    color: rgb(45,101,145);
}

a.link-color-hover-inherit:hover {
    color: inherit;
}

a.link-color-inherit {
    color: inherit;
}

/* === Bright Yellow Highlight for Field Differences === */
.bg-warning {
    background-color: #ffff00 !important;
}

/* === Badge styling with proper padding === */
.badge {
    padding: 0.4rem 0.6rem !important;
}

/* === Filter Bar Styling === */
.filter-bar {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e7f3ff;
    border: 1px solid #b6d4fe;
    border-radius: 1rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    color: #0d6efd;
}

.filter-chip .remove {
    cursor: pointer;
    color: #0d6efd;
    font-weight: bold;
    margin-left: 0.25rem;
    text-decoration: none;
}

.filter-chip .remove:hover {
    color: #0b5ed7;
    text-decoration: underline;
}

/* Mobile adjustments for filter bar */
@media (max-width: 767px) {
    .filter-bar {
        padding: 0.75rem;
    }
}

/* ========================================
   REFERRALS LIST PAGE
   ======================================== */
.case-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #dee2e6;
}

.case-table th,
.case-table td {
    border: 1px solid #dee2e6;
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
}

.case-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #6c757d;
}

.case-table a {
    text-decoration: none;
}

.case-table .status-active {
    color: #198754;
}

.case-table .status-closed {
    color: #6c757d;
}

/* ========================================
   REFERRAL DETAIL PAGE
   ======================================== */
.detail-container {
    max-width: 100%;
    background-color: #f5f5f0;
}

.detail-header {
    background: linear-gradient(to bottom, #7ba05b 0%, #6a8f4f 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #5a7f3f;
}

.detail-header h2 {
    font-size: 1.5rem;
    font-weight: normal;
    margin: 0;
}

.status-bar {
    background-color: white;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid #ddd;
}

.status-label {
    color: #d9534f;
    font-weight: bold;
    font-size: 0.9rem;
}

.content-wrapper {
    padding: 1.5rem;
    background-color: #f5f5f0;
}

.form-container {
    background-color: #faf9f5;
    border: 1px solid #d4d0c8;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 0.95rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #d4d0c8;
}

.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.form-label {
    flex: 0 0 140px;
    text-align: right;
    padding-right: 1rem;
    font-size: 0.9rem;
    color: #333;
    margin: 0;
}

.form-value {
    flex: 1;
    background-color: white;
    border: 1px solid #b8b8b8;
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    color: #333;
    min-height: 28px;
    height: auto;
    line-height: 1.2;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

.form-value:empty::before {
    content: '\00a0';
}

.form-value-readonly {
    background-color: #f9f9f9;
}

.section-spacer {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border: 1px solid #b8b8b8;
}

.portal-table thead {
    background-color: #e8e8e8;
}

.portal-table th {
    text-align: left;
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: bold;
    border-bottom: 1px solid #b8b8b8;
    border-right: 1px solid #d0d0d0;
}

.portal-table th:last-child {
    border-right: none;
}

.portal-table td {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #e8e8e8;
}

.portal-table td:last-child {
    border-right: none;
}

.portal-table tbody tr:hover {
    background-color: #f5f5f5;
}

.portal-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.portal-empty {
    text-align: center;
    padding: 1.5rem;
    color: #888;
    font-style: italic;
    font-size: 0.9rem;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablet and below (992px) */
@media (max-width: 992px) {
    .two-column {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .form-label {
        flex: 0 0 120px;
    }
}

/* Mobile landscape (768px) */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }

    .form-container {
        padding: 1rem;
    }

    .detail-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .detail-header h2 {
        font-size: 1.25rem;
    }

    .form-group {
        flex-direction: column;
        margin-bottom: 0.75rem;
    }

    .form-label {
        text-align: left;
        padding-bottom: 0.25rem;
        padding-right: 0;
        flex: 1;
        font-weight: 600;
    }

    .form-value {
        width: 100%;
    }

    /* Make portal table horizontally scrollable on mobile */
    .portal-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .portal-table thead,
    .portal-table tbody,
    .portal-table tr {
        display: table;
        width: 100%;
        table-layout: auto;
    }

    .portal-table thead {
        width: 100%;
    }

    .portal-table tbody {
        width: 100%;
    }

    .portal-table th,
    .portal-table td {
        font-size: 0.8rem;
        padding: 0.4rem;
        white-space: normal;
        word-wrap: break-word;
    }

    .portal-table th:nth-child(1),
    .portal-table td:nth-child(1) {
        min-width: 90px;
    }

    .portal-table th:nth-child(2),
    .portal-table td:nth-child(2) {
        min-width: 200px;
    }

    .portal-table th:nth-child(3),
    .portal-table td:nth-child(3) {
        min-width: 120px;
    }
}

/* Mobile portrait (576px) */
@media (max-width: 576px) {
    body {
        font-size: 0.9rem;
    }

    .content-wrapper {
        padding: 0.75rem;
    }

    .form-container {
        padding: 0.75rem;
    }

    .detail-header {
        padding: 0.75rem;
    }

    .detail-header h2 {
        font-size: 1.1rem;
    }

    .detail-header .btn {
        width: 100%;
        justify-content: center;
    }

    .section-title {
        font-size: 0.9rem;
    }

    .form-label {
        font-size: 0.85rem;
    }

    .form-value {
        font-size: 0.85rem;
        padding: 0.4rem;
    }

    .status-bar {
        padding: 0.5rem 0.75rem;
    }

    .status-label {
        font-size: 0.85rem;
    }

    .section-spacer {
        margin-top: 1.5rem;
    }

    /* Stack portal table for very small screens */
    .portal-table {
        font-size: 0.8rem;
    }

    .portal-table th:nth-child(1),
    .portal-table td:nth-child(1) {
        width: 90px;
        min-width: 90px;
    }

    .portal-table th:nth-child(3),
    .portal-table td:nth-child(3) {
        width: 100px;
        min-width: 100px;
    }

    .portal-table th,
    .portal-table td {
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
    }

    .portal-empty {
        font-size: 0.85rem;
        padding: 1rem;
    }

    /* Referrals list table wrapper */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .case-table {
        min-width: 0;
    }
}