/* Reusable titled section card with a gradient stripe header; single source of truth for the section panels.
   Put .emma-section-grid on a parent to arrange cards into responsive columns; each SectionCardComponent renders one .emma-section-card. */

.emma-section-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    align-items: start;
}

/* Column-count variants -- default 3-up; wider-field windows use 2-up and stretch cards to equal height per row. */
.emma-section-grid--cols-2 {
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
}

/* Single-column stack -- full-width cards stacked with the grid gap (for top-to-bottom edit forms). */
.emma-section-grid--cols-1 {
    grid-template-columns: 1fr;
}

/* Square card, card-token background/border, subtle lift. */
.emma-section-card {
    display: flex;
    flex-direction: column;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 0.25rem 0.4rem rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Spans the whole row instead of a single grid column. */
.emma-section-card--full {
    grid-column: 1 / -1;
}

/* Header-less "panel" variant (no Title/HeaderContent): card chrome only -- subtle tinted fill, no stripe. --emma-surface-subtle is currently undefined, so fall back to Bootstrap tertiary-bg for an actual fill. */
.emma-section-card--panel {
    background: var(--emma-surface-subtle, var(--bs-tertiary-bg));
    border-radius: 6px;
    box-shadow: none;
}

/* Gradient stripe header -- same primary gradient as the grid-toolbar context pill, toned down for a full-width bar. */
.emma-section-card__head {
    display: flex;
    align-items: center;
    min-height: 29px;
    padding: 4px 14px;
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.90) 0%, rgba(var(--bs-primary-rgb), 0.70) 100%);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Soft tone: a light primary-tinted band with primary text instead of the bold white-on-color bar -- a quieter header. */
.emma-section-card__head--soft {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.22) 0%, rgba(var(--bs-primary-rgb), 0.07) 100%);
    color: var(--bs-primary);
    border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.18);
    box-shadow: none;
}

.emma-section-card__title {
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.15;
}

/* Optional right-aligned header slot (icon / action / badge(s)). */
.emma-section-card__head-extra {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.emma-section-card__body {
    padding: 0.5rem 0.75rem 0.65rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

/* A memo that grows to fill its card so a memo-only card matches a taller neighbour in a stretched row; min-height is the floor. */
.emma-fill-memo {
    flex: 1 1 auto;
    min-height: 150px;
    display: flex;
}
.emma-fill-memo textarea {
    flex: 1 1 auto;
    resize: none;
}

/* Opt-in taller memo (+50px floor) — used by the AdminCustomer Comments/Notes pair. */
.emma-fill-memo.emma-fill-memo--tall {
    min-height: 200px;
}

/* A DevExpress form layout in the body has no outer gutters, so fields sit flush to the card padding. Scoped to forms inside a section card. */
.emma-section-card__body .dxbl-fl {
    --dxbl-fl-padding-x: 0px;
    --dxbl-fl-padding-y: 2px;
}
