/* Management Console 0.2.0: reuse the portal surface tokens and grid behavior. */
.management-breadcrumb { display:flex; gap:.7rem; align-items:center; margin-bottom:1rem; }
.management-counts { display:grid; grid-template-columns:repeat(auto-fit,minmax(155px,1fr)); gap:1rem; margin-bottom:1.4rem; }
.management-counts .portal-panel { margin:0; display:flex; flex-direction:column; gap:.45rem; padding:1rem 1.2rem; }
.management-counts strong { color:var(--portal-blue,#173e70); font-size:1.9rem; }
.management-sections { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:1.3rem; margin-bottom:1.3rem; }
.management-sections .portal-panel { margin:0; }
.management-links { display:flex; flex-direction:column; gap:.6rem; }
.management-resource-link { display:block; padding:.7rem .85rem; background:#f1f6ff; border:1px solid #d4e1f2; border-radius:.55rem; font-weight:600; text-decoration:none; }
.management-resource-link:hover,.management-resource-link:focus-visible { background:#e0edff; border-color:#78a6df; }
.management-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:1rem; margin-bottom:1rem; }
.management-toolbar input { max-width:360px; }
#management-editor textarea { min-height:100px; }
#f-document_body_html,#f-print_css,#f-html_body { min-height:240px; font:13px/1.6 Consolas,monospace; }
#f-print_css { min-height:120px; }
.merge-token-list { display:flex; flex-wrap:wrap; gap:.6rem; }
.merge-token-list code { background:#edf4ff; padding:.4rem .55rem; border:1px solid #c6d8ed; border-radius:.35rem; }
.management-message { border-left:3px solid #4b85c5; padding:.7rem 1rem; margin:1rem 0; background:#f2f7ff; }
.management-message small { display:block; color:#5e6d80; margin:.4rem 0; }
.management-message p,.management-text { white-space:pre-wrap; }
.signature-pad { width:100%; max-width:480px; height:140px; background:white; border:1px solid #9eb5d1; border-radius:.45rem; touch-action:none; }
.management-global-scope { color:#355277; background:#eef4ff; border:1px solid #bbcee8; padding:.5rem .9rem; border-radius:.5rem; }
@media (max-width:600px) { .management-sections {grid-template-columns:1fr;} .management-counts {grid-template-columns:repeat(2,minmax(0,1fr));} }

.signature-capture canvas {
    display: block;
    width: 100%;
    max-width: 700px;
    height: auto;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    background: #fff;
    touch-action: none;
}

.lookup-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: stretch;
}
.lookup-picker__display[readonly] {
    background: #fff;
    cursor: default;
}
.lookup-picker__button {
    min-width: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: .95rem;
}
.lookup-picker__source {
    display: none;
}
.lookup-modal-open {
    overflow: hidden;
}
.lookup-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}
.lookup-modal[hidden] {
    display: none;
}
.lookup-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(19, 34, 58, .45);
}
.lookup-modal__dialog {
    position: relative;
    width: min(920px, 100%);
    max-height: min(84vh, 760px);
    background: #fff;
    border: 1px solid #c8d6e7;
    border-radius: 1rem;
    box-shadow: 0 18px 42px rgba(23, 62, 112, .18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.lookup-modal__header,
.lookup-modal__footer {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #dce6f2;
}
.lookup-modal__footer {
    border-top: 1px solid #dce6f2;
    border-bottom: 0;
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}
.lookup-modal__title {
    color: var(--portal-blue, #173e70);
    font-size: 1.25rem;
    font-weight: 700;
}
.lookup-modal__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}
.lookup-modal__search,
.lookup-modal__body {
    padding: 1rem 1.25rem;
}
.lookup-modal__body {
    padding-top: 0;
    overflow: auto;
}
.lookup-modal__table-wrap {
    border: 1px solid #d7e2ee;
    border-radius: .75rem;
}
.lookup-modal__table {
    margin-bottom: 0;
}
.lookup-modal__table thead th {
    position: sticky;
    top: 0;
    background: #f4f8fc;
    z-index: 1;
}
.lookup-modal__actions {
    width: 110px;
    text-align: right;
    white-space: nowrap;
}
.lookup-modal__meta {
    color: #6b7c91;
    font-size: .825rem;
    margin-top: .15rem;
    word-break: break-all;
}
@media (max-width: 767.98px) {
    .lookup-picker {
        grid-template-columns: 1fr;
    }
    .lookup-picker__button {
        width: 100%;
    }
    .lookup-modal {
        padding: .75rem;
    }
    .lookup-modal__dialog {
        width: 100%;
        max-height: 92vh;
    }
    .lookup-modal__footer {
        justify-content: stretch;
    }
    .lookup-modal__footer .btn {
        flex: 1 1 auto;
    }
}

/* Brevo 0.2.2b: isolated template preview; existing lookup/card rules unchanged. */
.brevo-template-frame {
    display: block;
    width: 100%;
    min-height: 480px;
    border: 1px solid var(--portal-border, #bdd0e5);
    border-radius: 12px;
    background: #fff;
}
