/* Shared quality pass for legacy and custom Django templates. */
.enterprise-page-shell,
.enterprise-module-page {
    min-width: 0;
}

.enterprise-page-shell :where(.table-responsive, .enterprise-table-wrap, .enterprise-table-scroll) {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-color: #9aaabd #edf2f6;
    scrollbar-width: thin;
    border: 1px solid #dfe7ee;
    border-radius: 12px;
    background: #fff;
}

.enterprise-page-shell :where(.table-responsive, .enterprise-table-wrap, .enterprise-table-scroll):focus-visible {
    outline: 3px solid rgba(23, 105, 170, .28);
    outline-offset: 2px;
}

.enterprise-page-shell :where(.ops-table-wrap, .ae-table-wrap, .js-table-wrap, .av-table-wrap, .payment-table-wrapper) {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-color: #9aaabd #edf2f6;
    scrollbar-width: thin;
}

.enterprise-page-shell table {
    max-width: 100%;
    table-layout: auto;
    font-variant-numeric: tabular-nums;
}

.enterprise-page-shell :where(.table-responsive, .enterprise-table-wrap, .enterprise-table-scroll) > table {
    min-width: 100%;
}

.enterprise-page-shell table thead th {
    vertical-align: middle;
    line-height: 1.35;
}

.enterprise-page-shell table tbody td,
.enterprise-page-shell table tbody th {
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.enterprise-page-shell table tbody tr:last-child > * {
    border-bottom-width: 0;
}

.enterprise-page-shell :where(.table-responsive, .enterprise-table-wrap, .enterprise-table-scroll) > table > :not(caption) > * > * {
    padding: .72rem .85rem;
}

/* Keep checkbox and radio controls at their natural size. Older shared rules
   set every input to full width, which distorts those controls in some forms. */
.prophet-main input[type="checkbox"],
.prophet-main input[type="radio"],
.enterprise-page-shell input[type="checkbox"],
.enterprise-page-shell input[type="radio"] {
    width: 1.05rem !important;
    height: 1.05rem;
    min-height: 1.05rem !important;
    flex: 0 0 auto;
    padding: 0 !important;
    vertical-align: middle;
    accent-color: #1769aa;
}

.prophet-main .form-check-label,
.enterprise-page-shell .form-check-label {
    display: inline;
    cursor: pointer;
}

.prophet-main input[type="file"],
.enterprise-page-shell input[type="file"] {
    min-height: 44px;
    padding: .45rem .65rem;
}

.prophet-main input[type="submit"],
.prophet-main input[type="button"],
.prophet-main input[type="reset"],
.enterprise-page-shell input[type="submit"],
.enterprise-page-shell input[type="button"],
.enterprise-page-shell input[type="reset"] {
    width: auto;
    min-height: 42px;
    padding: .55rem .9rem;
    cursor: pointer;
}

.prophet-main :where(button, a, input, select, textarea):focus-visible,
.enterprise-page-shell :where(button, a, input, select, textarea):focus-visible {
    outline: 3px solid rgba(23, 105, 170, .24);
    outline-offset: 2px;
}

.enterprise-page-shell :where(.card, .enterprise-panel, .ops-panel, .ae-panel) {
    min-width: 0;
}

/* Staff message composer: channel selection, recipient fields and delivery status. */
.message-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.message-hotel-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: .55rem .85rem;
    border: 1px solid var(--p-border);
    border-radius: 999px;
    background: #fff;
    color: var(--p-navy);
    font-size: .82rem;
    font-weight: 750;
}

.message-hotel-chip i { color: var(--p-blue); }
.message-compose-panel { padding: clamp(1.15rem, 3vw, 1.8rem); }
.message-panel-heading { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.5rem; }
.message-panel-icon { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: var(--p-blue-soft); color: var(--p-blue); font-size: 1.05rem; }
.message-channel-fieldset { border: 0; padding: 0; margin-left: 0; margin-right: 0; }
.message-channel-fieldset legend { float: none; width: auto; font-size: .88rem; }
.message-channel-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.message-channel-option { display: flex; align-items: center; gap: .7rem; min-width: 0; padding: .8rem .9rem; border: 1px solid var(--p-border); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.message-channel-option:has(input:checked) { border-color: var(--p-blue); background: #f5faff; box-shadow: 0 0 0 3px rgba(23, 105, 170, .08); }
.message-channel-option .form-check-input { flex: 0 0 auto; margin: 0; }
.message-channel-option > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.message-channel-option strong { color: var(--p-navy); font-size: .88rem; }
.message-channel-option small { color: var(--p-muted); font-size: .72rem; font-weight: 500; line-height: 1.35; }
.message-channel-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: #eef5fb; color: var(--p-blue); }
.message-channel-icon.sms { background: #edf8f2; color: var(--p-success); }
.message-sms-note { margin-top: -.3rem; margin-bottom: 1.2rem; color: var(--p-muted); font-size: .77rem; }
.message-sms-note strong { color: #344155; }
.message-compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--p-border); }
.message-length { color: var(--p-muted); font-size: .76rem; }
.message-length.is-over-limit { color: var(--p-danger); font-weight: 750; }
.message-delivery-panel { position: sticky; top: 92px; }
.message-channel-status { display: grid; gap: .7rem; margin-top: 1.2rem; }
.message-status-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .75rem; border: 1px solid var(--p-border); border-radius: 11px; background: #fff; }
.message-status-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #f1f5f8; color: var(--p-blue); }
.message-status-row > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.message-status-row strong { color: var(--p-navy); font-size: .8rem; }
.message-status-row small { color: var(--p-muted); font-size: .68rem; }
.message-status-pill { white-space: nowrap; padding: .28rem .48rem; border-radius: 999px; background: #edf5fb; color: #365d7c; font-size: .62rem; font-weight: 800; }
.message-status-pill.is-ready { background: #e8f6ef; color: #176c46; }
.message-status-pill.is-pending { background: #fff4e5; color: #986012; }
.message-setup-note { margin-top: 1rem; padding: .85rem; border: 1px solid #f0dfbb; border-radius: 10px; background: #fffbf2; color: #6e5529; font-size: .74rem; }
.message-setup-note strong { display: block; margin-bottom: .25rem; color: #624617; }
.message-setup-note code { color: #624617; }
.message-queue-note { color: var(--p-muted); font-size: .75rem; line-height: 1.55; }
.message-queue-note i { color: var(--p-blue); }

@media (max-width: 767.98px) {
    .message-page-header { align-items: flex-start; flex-direction: column; }
    .message-delivery-panel { position: static; }
}

@media (max-width: 479.98px) {
    .message-channel-options { grid-template-columns: 1fr; }
    .message-compose-footer { align-items: stretch; flex-direction: column; }
    .message-compose-footer .btn { width: 100%; }
}

@media (max-width: 575.98px) {
    .enterprise-page-shell :where(.table-responsive, .enterprise-table-wrap, .enterprise-table-scroll) {
        border-radius: 10px;
    }

    .enterprise-page-shell :where(.table-responsive, .enterprise-table-wrap, .enterprise-table-scroll) > table > :not(caption) > * > * {
        padding: .62rem .7rem;
    }
}
.message-channel-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.message-channel-icon.both { background: #f1e9fb; color: #66409a; }
@media (max-width: 900px) {
    .message-channel-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .message-channel-options { grid-template-columns: 1fr; }
}
