﻿/* Page heading */
.roster-page {
    padding: 1.5rem 0 3rem;
    background: #fff;
}

.roster-heading {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}

.roster-heading h1 {
    flex-shrink: 0;
    margin: 0;
    color: #18231d;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.roster-heading p {
    margin: 0;
    padding-left: 20px;
    border-left: 1px solid #aeb7b1;
    color: #343d37;
    font-size: 1rem;
}

/* Search form */
.roster-page .roster-search {
    margin-bottom: 22px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #cbd2cd;
    border-radius: 7px;
}

.roster-page .roster-search-body {
    padding: 18px;
}

.roster-page .roster-search-body > .row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) 180px;
    gap: 14px 18px;
    margin: 0;
}

.roster-page .roster-search-body > .row > * {
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.roster-page .roster-search .form-label {
    margin-bottom: 5px;
    font-size: 0.9375rem;
}

.roster-page .roster-search .form-control,
.roster-page .roster-search .form-select {
    min-height: 40px;
}

.roster-page .roster-search-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
    grid-column: 5;
    grid-row: 1 / 3;
}

.roster-page .roster-search-actions .btn {
    min-height: 42px;
}

/* Results and pagination */
.roster-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.roster-result-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.roster-result-summary strong {
    font-size: 1.125rem;
}

.roster-result-summary span {
    padding-left: 12px;
    border-left: 1px solid #cbd2cd;
    color: #626b65;
    font-size: 0.9375rem;
}

.roster-page .roster-toolbar nav.mt-4 {
    margin-top: 0 !important;
}

.roster-toolbar .pagination {
    margin-bottom: 0;
}

.roster-page .pagination .page-link {
    color: #173b2a;
}

.roster-page .pagination .active .page-link {
    background: #173b2a;
    border-color: #173b2a;
    color: #fff;
}

/* Roster cards */
.inmate-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.roster-page .inmate-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) 140px;
    align-items: start;
    gap: 14px 18px;
    margin: 0;
    padding: 16px;
    overflow: hidden;
    background: #f4f5f5;
    border: 1px solid #cbd2cd;
    border-radius: 7px;
}

.roster-page .inmate-card-header {
    grid-column: 1 / -1;
    margin: -16px -16px 0;
    padding: 12px 16px;
    background: #173b2a;
    color: #fff;
    border-radius: 6px 6px 0 0;
}

.roster-page .inmate-card-header h2 {
    margin: 0;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.roster-page .inmate-photo {
    display: block;
    width: 112px;
    height: 140px;
    object-fit: contain;
    background: #eef1ef;
    border: 1px solid #d9ddda;
    border-radius: 5px;
}

.inmate-summary {
    min-width: 0;
}

.inmate-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px 12px;
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.inmate-facts dt {
    font-weight: 700;
}

.inmate-facts dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

/* Card actions */
.roster-page .inmate-actions {
    display: grid;
    grid-column: 3;
    grid-row: 2;
    grid-template-columns: 1fr;
    align-self: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.roster-page .inmate-actions > .btn {
    width: 100%;
    min-width: 0;
    height: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    white-space: nowrap;
}

.roster-page .inmate-actions .btn,
.roster-page .roster-search-actions .btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.3;
}

.roster-page .btn-roster-primary {
    background: #173b2a;
    border-color: #173b2a;
    color: #fff;
}

.roster-page .btn-roster-primary:hover {
    background: #0f2b1e;
    border-color: #0f2b1e;
    color: #fff;
}

.roster-page .btn-roster-gold {
    background: #efb544;
    border-color: #efb544;
    color: #111;
    font-weight: 700;
}

.roster-page .btn-roster-gold:hover {
    background: #dda331;
    border-color: #dda331;
    color: #111;
}

.roster-page .inmate-actions .view-details-button {
    background: #46535e;
    color: #fff;
}

.roster-page .inmate-actions .view-details-button:hover,
.roster-page .inmate-actions .view-details-button:focus-visible {
    background: #35414b;
    color: #fff;
}

.roster-page .inmate-actions .view-details-button:active {
    background: #29343d;
    color: #fff;
}

.roster-action-icon {
    flex-shrink: 0;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.roster-page .notify-help {
    padding: 0;
    border: 0;
    background: transparent;
    color: #46535e;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

/* Notification feedback */
.notification-success {
    display: none;
    padding: 1rem;
    background: #dff4e8;
    border: 1px solid #badbcc;
    border-radius: 7px;
    color: #174a31;
}

.notification-errors {
    display: none;
}

/* Inmate detail dialog */
#inmateDetailModal .modal-content {
    border: 0;
    border-radius: 10px;
    overflow: hidden;
}

#inmateDetailModal .modal-header {
    padding: 16px 24px;
    background: #46535e;
    color: #fff;
    border-bottom: 0;
}

#inmateDetailModal .modal-title {
    font-weight: 700;
}

#inmateDetailBody {
    padding: 0;
    background: #f4f5f5;
}

/* Detail identity and booking summary */
#inmateDetailModal .id-identity {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 340px;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: #fff;
}

#inmateDetailModal .id-photo {
    width: 120px;
    height: 140px;
    object-fit: contain;
    background: #ecefed;
    border-radius: 7px;
}

#inmateDetailModal .id-name {
    min-width: 0;
    padding-left: 24px;
    border-left: 3px solid #efb544;
}

#inmateDetailModal .id-name h3 {
    margin: 0;
    color: #173b2a;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    overflow-wrap: anywhere;
}

#inmateDetailModal .id-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 16px;
    background: #173b2a;
    color: #fff;
    border-radius: 6px;
}

#inmateDetailModal .id-summary > div {
    min-width: 0;
}

#inmateDetailModal .id-summary dt {
    font-size: 14px;
    font-weight: 400;
}

#inmateDetailModal .id-summary dd {
    margin: 4px 0 0;
    font-size: 17px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

#inmateDetailModal .id-summary > div:first-child dd {
    color: #efb544;
}

/* Detail panels */
#inmateDetailModal .id-columns {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: start;
    gap: 18px;
    padding: 24px;
}

#inmateDetailModal .id-panel {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #cbd2cd;
    border-radius: 8px;
}

#inmateDetailModal .id-panel > h4 {
    margin: 0;
    padding: 12px 16px;
    background: #173b2a;
    color: #fff;
    border-bottom: 3px solid #efb544;
    font-size: 20px;
    font-weight: 700;
}

#inmateDetailModal .id-facts {
    margin: 0;
    padding: 10px;
}

#inmateDetailModal .id-fact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 8px 10px;
}

#inmateDetailModal .id-fact:nth-child(odd) {
    background: #eef0f1;
}

#inmateDetailModal .id-fact dt {
    font-weight: 700;
}

#inmateDetailModal .id-fact dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* Charges */
#inmateDetailModal .id-charges {
    display: grid;
    gap: 16px;
    padding: 16px;
}

#inmateDetailModal .id-charge {
    overflow: hidden;
    border: 1px solid #dfab36;
    border-radius: 6px;
}

#inmateDetailModal .id-charge h5 {
    margin: 0;
    padding: 12px 14px;
    background: #eef0f1;
    border-bottom: 1px solid #dce1dd;
    font-size: 16px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

#inmateDetailModal .id-charge-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 12px;
}

#inmateDetailModal .id-charge-grid dl {
    min-width: 0;
    margin: 0;
}

#inmateDetailModal .id-charge-grid .id-fact {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    padding: 6px;
    background: transparent;
    border-bottom: 1px solid #e2e5e3;
}

#inmateDetailModal .id-empty {
    margin: 0;
    color: #626b65;
}

/* Tablet */
@media (max-width: 1199.98px) {
    .roster-page .roster-search-body > .row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .roster-page .roster-search-actions {
        grid-column: 1 / -1;
        grid-row: auto;
        flex-direction: row;
    }

    .roster-page .roster-search-actions .btn {
        flex: 1;
    }

    .roster-page .inmate-card {
        gap: 12px;
    }

    .roster-page .inmate-photo {
        width: 85px;
        height: 110px;
    }

    .inmate-facts {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .inmate-facts dd {
        margin-bottom: 7px;
    }
}

@media (max-width: 991px) {
    #inmateDetailModal .id-columns {
        grid-template-columns: 1fr;
    }
}

/* Smaller tablets */
@media (max-width: 767.98px) {
    .roster-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .roster-heading p {
        padding-left: 0;
        border-left: 0;
    }

    .roster-page .roster-search-body > .row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inmate-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .inmate-facts {
        grid-template-columns: max-content minmax(0, 1fr);
        gap: 4px 12px;
    }

    .inmate-facts dd {
        margin-bottom: 0;
    }
}

@media (max-width: 767px) {
    .roster-page .inmate-card {
        grid-template-columns: 85px minmax(0, 1fr);
    }

    .roster-page .inmate-actions {
        grid-column: 1 / -1;
        grid-row: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #inmateDetailModal .id-identity {
        grid-template-columns: 85px minmax(0, 1fr);
    }

    #inmateDetailModal .id-summary {
        grid-column: 1 / -1;
    }
}

/* Phones */
@media (max-width: 575px) {
    #inmateDetailModal .id-identity {
        gap: 16px;
        padding: 16px;
    }

    #inmateDetailModal .id-photo {
        width: 85px;
        height: 110px;
    }

    #inmateDetailModal .id-name {
        padding-left: 16px;
    }

    #inmateDetailModal .id-columns {
        padding: 16px;
    }

    #inmateDetailModal .id-charge-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 479.98px) {
    .roster-page .roster-search-body > .row {
        grid-template-columns: minmax(0, 1fr);
    }

    .roster-page .roster-search-actions {
        flex-direction: column;
    }

    .inmate-facts {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .inmate-facts dd {
        margin-bottom: 7px;
    }
}

#submitNotifyButton {
    background: #efb544;
    border-color: #efb544;
    color: #111;
    font-weight: 700;
}

#submitNotifyButton:hover {
    background: #dda331;
    border-color: #dda331;
}

#notifyInmatePhoto {
    width: 75px;
    height: 90px;
    object-fit: contain;
    background: #eef1ef;
    border-radius: 5px;
}
#notifyModal .modal-header {
    background: #46535e;
    color: #fff;
}

#notifyModal .modal-title {
    font-weight: 700;
}

#notifyModal .notify-inmate-summary {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #dce1dd;
}

#notifyModal #notifyInmateName {
    margin: 0 0 6px;
    color: #173b2a;
    font-size: 1.5rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

#notifyModal #notifyInmateDemographics {
    color: #46535e;
}