﻿/* ==========================================================================
   Emergency receipt and inpatient
   ========================================================================== */

.er-register, .er-detail, .admitted-list, .booking-history {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--panel-border);
    background: var(--surface);
}

.er-caption, .er-detail-caption, .admitted-foot, .er-detail-foot {
    padding: 3px 8px;
    background: var(--panel-caption);
    border-bottom: 1px solid var(--panel-border);
    font-size: 12px;
    font-weight: 600;
    color: #14507f;
    text-align: center;
}

.er-head, .er-row, .er-detail-head, .er-detail-row { display: flex; }

.er-head, .er-detail-head {
    background: linear-gradient(#f2f6fa, #dfe9f1);
    border-bottom: 1px solid var(--panel-border);
    font-size: 12px;
    font-weight: 600;
}

.er-body { max-height: 250px; overflow-y: auto; }
.er-detail-body { flex: 1; max-height: 260px; overflow-y: auto; }

.er-row, .er-detail-row { font-size: 12px; border-bottom: 1px solid #eef2f6; cursor: pointer; }
.er-row:hover { background: #e8f2fa; }
.er-row-selected { background: #2f6ea5; color: #fff; }

.er-col { padding: 3px 6px; border-right: 1px solid #eef2f6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.er-col-order { width: 92px; flex-shrink: 0; }
.er-col-mr { width: 92px; flex-shrink: 0; }
.er-col-name { flex: 1; min-width: 150px; }
.er-col-gender { width: 78px; flex-shrink: 0; }
.er-col-user { width: 160px; flex-shrink: 0; }
.er-col-date { width: 150px; flex-shrink: 0; border-right: none; }
.er-col-code { width: 90px; flex-shrink: 0; }
.er-col-desc { flex: 1; min-width: 160px; }
.er-col-amount { width: 110px; flex-shrink: 0; text-align: right; }

.er-detail-foot { border-bottom: none; border-top: 1px solid var(--panel-border); text-align: right; font-weight: 700; }

.er-lower { display: flex; gap: 10px; align-items: flex-start; }
.er-clock-panel { flex: 0 0 210px; }
.er-detail { flex: 1; min-width: 0; min-height: 300px; }

.er-clock { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.er-clock-face { width: 150px; height: 150px; }
.er-clock-time { font-size: 11px; color: var(--ink-muted); text-align: center; }

.admitted-layout { display: flex; gap: 10px; align-items: flex-start; }
.admitted-list { flex: 1 1 620px; min-width: 0; min-height: 420px; }
.admitted-detail { flex: 0 0 480px; display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 1180px) {
    .admitted-layout, .er-lower, .cancel-detail { flex-direction: column; }
    .admitted-detail, .er-clock-panel { flex: 1 1 auto; width: 100%; }
}

.admitted-head, .admitted-row { display: flex; }

.admitted-head {
    background: linear-gradient(#f2f6fa, #dfe9f1);
    border-bottom: 1px solid var(--panel-border);
    font-size: 12px;
    font-weight: 600;
}

.admitted-body { flex: 1; overflow-y: auto; }
.admitted-row { font-size: 12px; border-bottom: 1px solid #eef2f6; cursor: pointer; }
.admitted-row:hover { background: #e8f2fa; }
.admitted-row-selected { background: #2f6ea5; color: #fff; }

.ad-col { padding: 3px 6px; border-right: 1px solid #eef2f6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-col-mr { width: 76px; flex-shrink: 0; }
.ad-col-name { flex: 1; min-width: 140px; }
.ad-col-consultant { width: 160px; flex-shrink: 0; }
.ad-col-room { width: 96px; flex-shrink: 0; }
.ad-col-date { width: 84px; flex-shrink: 0; }
.ad-col-time { width: 74px; flex-shrink: 0; }
.ad-col-bill { width: 56px; flex-shrink: 0; border-right: none; }

.admitted-foot { border-bottom: none; border-top: 1px solid var(--panel-border); text-align: left; }

.admitted-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 16px; font-size: 12px; }
.admitted-detail-wide { grid-column: 1 / -1; }

.admitted-notes { display: flex; flex-direction: column; gap: 4px; }

.entry-textarea {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--input-border);
    border-radius: 2px;
    font-family: inherit;
    font-size: 12px;
    background: #f8fbfd;
    resize: vertical;
}

.booking-results { flex: 0 0 380px; }

.bh-head, .bh-row { display: flex; }

.booking-history { min-height: 180px; }

.bh-head {
    background: linear-gradient(#f2f6fa, #dfe9f1);
    border-bottom: 1px solid var(--panel-border);
    font-size: 12px;
    font-weight: 600;
}

.bh-body { flex: 1; overflow-y: auto; max-height: 240px; }
.bh-row { font-size: 12px; border-bottom: 1px solid #eef2f6; }

.bh-col { padding: 3px 6px; border-right: 1px solid #eef2f6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-col-receipt { width: 96px; flex-shrink: 0; }
.bh-col-mr { width: 140px; flex-shrink: 0; }
.bh-col-name { flex: 1; min-width: 140px; }
.bh-col-amount { width: 96px; flex-shrink: 0; text-align: right; }
.bh-col-option { width: 96px; flex-shrink: 0; }
.bh-col-date { width: 130px; flex-shrink: 0; }
.bh-col-user { width: 150px; flex-shrink: 0; }

/* Consumed/available - the advance's lifecycle, read straight off its allocations and refunds. */
.bh-col-status { width: 96px; flex-shrink: 0; text-align: right; }
.bh-col-status-zero { color: #94a3af; }

.bh-col-refund { width: 168px; flex-shrink: 0; border-right: none; display: flex; align-items: center; gap: 4px; }
.bh-refund-input { width: 82px; padding: 1px 4px; font-size: 12px; text-align: right; }

