/* Shared hero + KPI-row + card wrapper for the "row 1 hero / row 2 KPI tiles" layout. */

.emma-page-wrapper {
    padding: 1rem 1.25rem 1.5rem;
    overflow-y: auto;
    height: calc(100vh - 65px);
}

.emma-page-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.15), rgba(var(--bs-primary-rgb), 0.03));
    border-left: 5px solid var(--bs-primary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.emma-page-hero-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-primary);
    color: #fff;
    font-size: 1.6rem;
    flex-shrink: 0;
}

/* emma-icon uses a mask; force white inside the primary circle. */
.emma-page-hero-icon .emma-icon {
    background-color: #fff !important;
    width: 1.6rem;
    height: 1.6rem;
}

.emma-page-hero-title {
    font-size: 1.25rem;
    font-weight: 700;
}
/* Step the title down for long titles (e.g. a mail subject as the hero title)
   so the hero doesn't balloon. Bucketed by length in PageHeroComponent. */
.emma-page-hero-title.is-long   { font-size: 1.05rem; line-height: 1.3; }
.emma-page-hero-title.is-xlong  { font-size: 0.95rem; line-height: 1.3; }
.emma-page-hero-title.is-xxlong { font-size: 0.85rem; line-height: 1.35; }

.emma-page-hero-sub {
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
    margin-top: 0.15rem;
}

.emma-page-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.emma-page-kpi-tile {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-left: 4px solid var(--bs-border-color);
    border-radius: 6px;
    padding: 0.85rem 1rem;
}

.emma-page-kpi-tile.tone-success { border-left-color: var(--bs-success); }
.emma-page-kpi-tile.tone-warning { border-left-color: var(--bs-warning); }
.emma-page-kpi-tile.tone-danger  { border-left-color: var(--bs-danger); }
.emma-page-kpi-tile.tone-info    { border-left-color: var(--bs-info); }
.emma-page-kpi-tile.tone-primary { border-left-color: var(--bs-primary); }

.emma-page-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
}

.emma-page-kpi-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    margin-top: 0.15rem;
}

.emma-page-kpi-sub {
    font-size: 0.72rem;
    color: var(--bs-secondary-color);
    margin-top: 0.15rem;
}

.emma-page-kpi-progress {
    height: 8px;
    background: rgba(var(--bs-secondary-rgb), 0.15);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.35rem;
}

.emma-page-kpi-progress-fill {
    height: 100%;
    background: var(--bs-success);
    transition: width 300ms;
}

/* Do NOT add overflow:hidden here — DxLoadingPanel wraps children in its own
   container without inheriting flex, so overflow:hidden makes the grid vanish
   when the loading panel doesn't supply an explicit height. */
.emma-page-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    padding: 0.85rem 1rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.emma-page-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
