/* ═══════════════════════════════════════════════
   App Shell
   ═══════════════════════════════════════════════ */

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #f5f7fa;
}

/* ── Topbar ── */
.app-topbar {
    height: 56px;
    flex-shrink: 0;
    background: linear-gradient(90deg, #1a2332 0%, #243447 100%);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.5rem;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.topbar-hamburger {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.15rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.topbar-hamburger:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.topbar-brand {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    user-select: none;
}

/* User menu sitting on the dark topbar */
.topbar-user-menu {
    background: transparent !important;
}

    .topbar-user-menu .dxbl-menu-title,
    .topbar-user-menu .dxbl-menu-item > .dxbl-btn,
    .topbar-user-menu .dxbl-menu-item > .dxbl-btn > .dxbl-image {
        color: rgba(255, 255, 255, 0.88) !important;
        background: transparent !important;
        border-radius: 6px;
        font-size: 0.9rem;
    }

.topbar-user-menu .dxbl-menu-item > .dxbl-btn:hover,
.topbar-user-menu .dxbl-menu-item > .dxbl-btn:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}

/* ── Body (drawer + content) ── */
.app-body {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
}

/* ── Drawer panel (sidebar) ── */
.drawer-panel {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.drawer-panel .dxbl-menu-bar .dxbl-menu-title {
    width: 100%;
    padding-left: var(--dxbl-menu-item-padding-x);
    padding-right: var(--dxbl-menu-item-padding-x);
}
/* Menu item of the page that is open (Layout.razor ItemCss): topbar color as accent */
.drawer-panel .menu-item-active > .dxbl-menu-item > .dxbl-btn {
    background: rgba(26, 35, 50, 0.08);
    color: #1a2332;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #1a2332;
    border-radius: 4px;
}

/* Version badge at the bottom of the menu, same colors as the topbar */
.drawer-version {
    margin-top: auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: center;
}

.version-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #1a2332 0%, #243447 100%);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ── Page content area ── */
.app-content {
    flex: 1;
    height: 100%;
    overflow: auto;
    padding: 1.5rem;
    background: #f5f7fa;
    min-width: 0;
}

/* ── Footer ── */
.app-footer {
    height: 40px;
    flex-shrink: 0;
    background: #1a2332;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 1.5rem;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════════ */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

body {
    height: 100vh;
}

.flex-auto {
    flex: auto !important;
}

.flex-basis {
    flex-basis: 1px !important
}

.h-25 {
    height: 25% !important;
}

.h-30 {
    height: 33.333333% !important;
}

.h-75 {
    height: 75% !important;
}

.h-90 {
    height: 90% !important;
}

@media (max-width: 680px) {
    .pe-xs-0 {
        padding-right: 0 !important;
    }

    .me-xs-0 {
        margin-right: 0 !important;
    }
}

.w-130px {
    width: 130px !important;
}

.w-135px {
    width: 135px !important;
}

/* ═══════════════════════════════════════════════
   Page card — shared layout for all main pages
   ═══════════════════════════════════════════════ */

/* Page container (stand-alone, not Bootstrap's .card): header, toolbar, body, footer. */
.page-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #ffffff;
    border: 1px solid #dde3ee;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .04);
    overflow: hidden;
}

.page-card-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #e8edf3;
    flex-shrink: 0;
}

.page-card-body {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.75rem;
}

/* A grid placed directly in the page body takes the remaining height (even when empty) and
   scrolls inside it instead of sizing to its rows. */
.page-card-body > .dxbl-grid {
    flex: 1 1 0;
    min-height: 0;
}

.page-card-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid #e8edf3;
    flex-shrink: 0;
}

/* Inline notice (e.g. access denied), replaces Bootstrap's .alert */
.app-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid #ffe08a;
    border-radius: 8px;
    background: #fff8e1;
    color: #664d03;
}

/* Busy overlay shown over a positioned container (Components/Common/Loading) */
.loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
}

.page-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid #e8edf3;
    flex-shrink: 0;
}

.page-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: #eff3ff;
    color: #3b5bdb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.page-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a2332;
    line-height: 1.2;
    margin: 0;
}

.page-card-subtitle {
    font-size: 0.72rem;
    color: #8592a3;
    font-weight: 500;
    margin: 2px 0 0;
}

/* ── Stat chips bar (summary metrics above the grid) ── */

.stat-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e8edf3;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.75rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #dde3ee;
    font-size: 0.73rem;
    font-weight: 500;
    color: #6c757d;
    white-space: nowrap;
}

    .stat-chip strong {
        font-size: 0.88rem;
        font-weight: 700;
    }

    .stat-chip i {
        font-size: 0.75rem;
    }

    .stat-chip.stat-total strong  { color: #3b5bdb; }
    .stat-chip.stat-success strong { color: #087f5b; }
    .stat-chip.stat-danger strong  { color: #c92a2a; }
    .stat-chip.stat-info strong    { color: #0c7abf; }

/* ── Soft status badges (replace Bootstrap 4 badge-* color variants) ── */

.badge-soft-success {
    display: inline-block;
    padding: 0.3em 0.75em;
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 600;
    background-color: #d3f9d8;
    color: #1b4332;
}

.badge-soft-danger {
    display: inline-block;
    padding: 0.3em 0.75em;
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 600;
    background-color: #ffe0e0;
    color: #7d1a1a;
}

.badge-soft-warning {
    display: inline-block;
    padding: 0.3em 0.75em;
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 600;
    background-color: #fff3cd;
    color: #664d03;
}

/* ── Validation icon for fields without a DX editor (ValidationIcon.razor) ── */
.validation-icon {
    display: inline-flex;
    align-items: center;
    color: var(--bs-danger);
    font-size: 1rem;
    line-height: 1;
    cursor: help;
}

.audience-section-label + .validation-icon {
    margin-left: 0.25rem;
}

/* Plain text in a DxFormLayout item: same top padding and line height as the caption, so both
   lines line up (editors get that alignment from their own padding) */
.fl-static-text {
    display: block;
    padding: 0.5rem 0;
    line-height: 22px;
}

/* ── Page loader (Loading BlockUI="true" → DxLoadingPanel over <body>) ── */
.dxbl-loading-panel.page-loading-panel {
    --dxbl-loading-panel-shading-color: rgba(15, 23, 42, 0.45);
    --dxbl-loading-panel-indicator-area-background-color: #ffffff;
    --dxbl-loading-panel-indicator-area-color: #1e293b;
    --dxbl-loading-panel-message-color: #1e293b;
}
