/* SHEQ Cloud 360 standalone runtime shell. */
:root {
    --runtime-accent: #2563eb;
    --runtime-accent-2: #06b6d4;
    --runtime-accent-soft: rgba(37, 99, 235, .11);
    --runtime-panel: #ffffff;
    --runtime-border: #dbe5ef;
    --runtime-muted: #64748b;
    --runtime-dark: #0f172a;
    --runtime-danger: #dc2626;
    --runtime-warning: #d97706;
    --runtime-success: #15803d;
}

.runtime-page-shell,
.runtime-page {
    --runtime-accent: #2563eb;
    --runtime-accent-2: #06b6d4;
    --runtime-accent-soft: rgba(37, 99, 235, .11);
    color: var(--runtime-dark);
}

.runtime-page-shell {
    width: 100%;
    min-width: 0;
    padding: 24px;
}

.runtime-page-shell.runtime-page-embedded {
    padding: 12px;
}

.runtime-page {
    padding: 20px;
}

.runtime-page-hero,
.runtime-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px;
    margin-bottom: 18px;
    border: 1px solid var(--runtime-border);
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .20), transparent 33%),
        radial-gradient(circle at top left, rgba(6, 182, 212, .13), transparent 35%),
        linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

.runtime-page-hero-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--runtime-accent), var(--runtime-accent-2));
    box-shadow: 0 12px 26px rgba(37, 99, 235, .24);
    font-size: 1.65rem;
}

.runtime-page-hero-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.runtime-page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--runtime-accent);
    font-size: .78rem;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.runtime-page-hero h1,
.runtime-page-header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--runtime-dark);
    font-size: clamp(1.55rem, 3vw, 2.65rem);
    font-weight: 850;
    letter-spacing: -.035em;
}

.runtime-page-hero p,
.runtime-page-header p {
    max-width: 980px;
    margin: 9px 0 0;
    color: var(--runtime-muted);
    line-height: 1.65;
}

.runtime-page-hero-actions,
.runtime-page-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
}

.runtime-shortcut-row,
.runtime-process-card-grid,
.runtime-panel-grid,
.runtime-stat-grid,
.runtime-upload-row,
.runtime-grid-layout {
    display: grid;
    min-width: 0;
    gap: 16px;
}

.runtime-shortcut-row {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 18px;
}

.runtime-shortcut-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    padding: 16px;
    color: var(--runtime-dark);
    text-decoration: none;
    border: 1px solid var(--runtime-border);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
    transition: transform .17s ease, box-shadow .17s ease, border-color .17s ease;
}

.runtime-shortcut-card:hover {
    color: var(--runtime-dark);
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, .40);
    box-shadow: 0 18px 36px rgba(15, 23, 42, .11);
}

.runtime-shortcut-card > span {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    color: var(--runtime-accent);
    background: var(--runtime-accent-soft);
    font-size: 1.28rem;
}

.runtime-shortcut-card strong { font-size: .98rem; font-weight: 850; }
.runtime-shortcut-card small { color: var(--runtime-muted); line-height: 1.45; }

.runtime-process-card-shell {
    padding: 18px;
    margin-bottom: 18px;
    border: 1px solid var(--runtime-border);
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.runtime-process-card-intro { margin-bottom: 14px; }
.runtime-process-card-intro > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    margin-bottom: 7px;
    border-radius: 999px;
    color: #075985;
    background: #e0f2fe;
    font-size: .75rem;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.runtime-process-card-intro h2 { margin: 0; font-size: 1.35rem; font-weight: 850; }
.runtime-process-card-intro p { margin: 5px 0 0; color: var(--runtime-muted); }

.runtime-process-card-grid { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
.runtime-process-card {
    display: grid;
    gap: 5px;
    min-height: 126px;
    padding: 16px;
    color: var(--runtime-dark);
    text-decoration: none;
    border: 1px solid #d7e2ee;
    border-radius: 16px;
    background: #fff;
    transition: .17s ease;
}
.runtime-process-card:hover,
.runtime-process-card.is-active {
    color: var(--runtime-dark);
    border-color: var(--runtime-accent);
    background: #eff6ff;
    box-shadow: 0 12px 26px rgba(37, 99, 235, .12);
}
.runtime-process-card > i { color: var(--runtime-accent); font-size: 1.35rem; }
.runtime-process-card strong { font-weight: 850; }
.runtime-process-card small { color: #475569; font-weight: 700; }
.runtime-process-card span { color: var(--runtime-muted); font-size: .84rem; line-height: 1.45; }

.runtime-filter-card,
.runtime-info-panel,
.runtime-stat-card,
.runtime-upload-card,
.runtime-grid-card {
    border: 1px solid var(--runtime-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.runtime-filter-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    margin-bottom: 18px;
}

.runtime-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.runtime-filter-field {
    display: grid;
    gap: 5px;
    min-width: 0;
    margin: 0;
}
.runtime-filter-field > span {
    color: #334155;
    font-size: .78rem;
    font-weight: 800;
}
.runtime-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.runtime-panel-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 18px; }
.runtime-info-panel { padding: 17px; }
.runtime-info-panel h2 { margin: 0 0 7px; font-size: 1rem; font-weight: 850; }
.runtime-info-panel h2 i { color: var(--runtime-accent); }
.runtime-info-panel p { margin: 0 0 7px; color: var(--runtime-muted); line-height: 1.55; }
.runtime-info-panel ul { margin: 8px 0 0; padding-left: 1.15rem; color: #334155; }

.runtime-stat-grid { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); margin-bottom: 18px; }
.runtime-stat-card {
    position: relative;
    display: grid;
    gap: 5px;
    min-height: 132px;
    padding: 17px;
    overflow: hidden;
}
.runtime-stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--runtime-accent);
}
.runtime-stat-card > i { color: var(--runtime-accent); font-size: 1.25rem; }
.runtime-stat-card span { color: var(--runtime-muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.runtime-stat-card strong { color: var(--runtime-dark); font-size: 1.7rem; line-height: 1.05; }
.runtime-stat-card small { color: var(--runtime-muted); }
.runtime-stat-danger::before { background: #dc2626; }
.runtime-stat-warning::before { background: #f59e0b; }
.runtime-stat-success::before { background: #16a34a; }
.runtime-stat-secondary::before { background: #64748b; }

.runtime-upload-row { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); margin-bottom: 18px; }
.runtime-upload-row-bottom { margin-top: 18px; }
.runtime-upload-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
}
.runtime-upload-icon {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    color: var(--runtime-accent);
    background: var(--runtime-accent-soft);
    font-size: 1.3rem;
}
.runtime-upload-body { flex: 1 1 auto; min-width: 0; }
.runtime-upload-body h2 { margin: 0 0 5px; font-size: 1rem; font-weight: 850; }
.runtime-upload-body p { margin: 0; color: var(--runtime-muted); }
.runtime-upload-actions { display: flex; align-self: center; flex-wrap: wrap; gap: 8px; }
.runtime-upload-error { white-space: pre-line; font-weight: 700; }
.runtime-upload-card-has-error { border-color: rgba(220, 38, 38, .45); box-shadow: 0 8px 24px rgba(220, 38, 38, .10); }
.runtime-upload-filter-invalid { border-color: #dc3545 !important; box-shadow: 0 0 0 .15rem rgba(220, 53, 69, .20) !important; }

.runtime-grid-layout { grid-template-columns: minmax(0, 1fr); }
.runtime-grid-layout-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.runtime-grid-card { min-width: 0; overflow: hidden; }
.runtime-grid-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--runtime-border);
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}
.runtime-grid-card-header h2 { margin: 0; font-size: 1.02rem; font-weight: 850; }
.runtime-grid-card-header p { margin: 4px 0 0; color: var(--runtime-muted); font-size: .85rem; }
.runtime-grid-header-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: max-content; }
.runtime-grid-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.runtime-grid-dependency {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--runtime-accent);
    background: var(--runtime-accent-soft);
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}
.runtime-grid-host,
.runtime-grid-card .jqgrid-host,
.runtime-grid-card .kendo-grid-host { min-width: 0; padding: 12px; }

.runtime-row-green > td { background: #ecfdf5 !important; }
.runtime-row-yellow > td { background: #fffbeb !important; }
.runtime-row-orange > td { background: #fff7ed !important; }
.runtime-row-red > td { background: #fef2f2 !important; }
.runtime-row-brown > td { background: #fdf4e7 !important; }

@media (max-width: 1100px) {
    .runtime-grid-layout-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
    .runtime-page-shell,
    .runtime-page { padding: 12px; }
    .runtime-page-hero,
    .runtime-page-header { flex-direction: column; padding: 18px; border-radius: 16px; }
    .runtime-page-hero-icon { width: 48px; height: 48px; border-radius: 15px; }
    .runtime-page-hero-actions,
    .runtime-page-header-actions,
    .runtime-filter-actions,
    .runtime-grid-header-side,
    .runtime-grid-header-actions { width: 100%; align-items: stretch; justify-content: flex-start; }
    .runtime-page-hero-actions .btn,
    .runtime-page-header-actions .btn,
    .runtime-filter-actions .btn,
    .runtime-grid-header-actions .btn,
    .runtime-upload-actions .btn { width: 100%; }
    .runtime-grid-card-header,
    .runtime-upload-card { flex-direction: column; align-items: stretch; }
    .runtime-shortcut-row,
    .runtime-process-card-grid,
    .runtime-filter-grid,
    .runtime-panel-grid,
    .runtime-stat-grid,
    .runtime-upload-row { grid-template-columns: minmax(0, 1fr); }
}

/* Non-blocking user messages used instead of browser alert() boxes. */
#ingq-toast-stack {
    position: fixed;
    top: 76px;
    right: 18px;
    z-index: 10950;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(440px, calc(100vw - 28px));
    pointer-events: none;
}

.ingq-toast {
    display: grid;
    grid-template-columns: 32px 1fr 28px;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, .12);
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
    opacity: 0;
    transform: translateY(-8px) scale(.98);
    transition: opacity .16s ease, transform .16s ease;
    pointer-events: auto;
    overflow: hidden;
}

.ingq-toast.ingq-toast-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.ingq-toast-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.ingq-toast-success .ingq-toast-icon { background: #dcfce7; color: #15803d; }
.ingq-toast-warning .ingq-toast-icon { background: #fef3c7; color: #b45309; }
.ingq-toast-danger .ingq-toast-icon { background: #fee2e2; color: #b91c1c; }
.ingq-toast-info .ingq-toast-icon { background: #dbeafe; color: #1d4ed8; }

.ingq-toast-title {
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 3px;
}

.ingq-toast-message {
    color: #334155;
    font-size: .92rem;
    line-height: 1.35;
    white-space: pre-line;
    max-height: 220px;
    overflow: auto;
}

.ingq-toast-close {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 1.35rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.ingq-toast-success { border-left: 5px solid #22c55e; }
.ingq-toast-warning { border-left: 5px solid #f59e0b; }
.ingq-toast-danger { border-left: 5px solid #ef4444; }
.ingq-toast-info { border-left: 5px solid #3b82f6; }

@media (max-width: 575.98px) {
    #ingq-toast-stack {
        top: 62px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}

.theme-she {
    --runtime-accent: #2563eb;
    --runtime-accent-2: #06b6d4;
    --runtime-accent-soft: rgba(37, 99, 235, .11);
}

.theme-she .runtime-page-header {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .20), transparent 32%),
        radial-gradient(circle at top left, rgba(6, 182, 212, .13), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.theme-she .runtime-grid-card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}

/* PM Live Dashboard - live cards and lightweight CSS charts */
.pm-dashboard-shell {
    margin-top: 1rem;
}

.pm-dashboard-loading {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    color: #53657f;
    font-size: .88rem;
}

.pm-dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.pm-dashboard-kpi {
    background: #fff;
    border: 1px solid #d8e1ec;
    border-radius: 10px;
    padding: 1rem 1.15rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
    min-height: 118px;
}

.pm-dashboard-kpi span,
.pm-dashboard-kpi small {
    display: block;
    color: #53657f;
    line-height: 1.3;
}

.pm-dashboard-kpi span {
    font-size: .9rem;
}

.pm-dashboard-kpi strong {
    display: flex;
    align-items: baseline;
    gap: .25rem;
    margin-top: .38rem;
    color: #111827;
    font-size: 1.9rem;
    line-height: 1;
    font-weight: 800;
}

.pm-dashboard-kpi strong small {
    color: inherit;
    font-size: 1rem;
    font-weight: 800;
}

.pm-dashboard-kpi small {
    margin-top: .55rem;
    font-size: .76rem;
}

.pm-dashboard-kpi-success { border-color: #16a34a; }
.pm-dashboard-kpi-success strong { color: #15803d; }
.pm-dashboard-kpi-warning { border-color: #f59e0b; }
.pm-dashboard-kpi-warning strong { color: #b45309; }
.pm-dashboard-kpi-danger { border-color: #ef4444; }
.pm-dashboard-kpi-danger strong { color: #e11d48; }
.pm-dashboard-kpi-primary { border-color: #93c5fd; }
.pm-dashboard-kpi-primary strong { color: #1d4ed8; }
.pm-dashboard-kpi-secondary { border-color: #94a3b8; }
.pm-dashboard-kpi-secondary strong { color: #475569; }

.pm-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.pm-dashboard-card {
    background: #fff;
    border: 1px solid #e3e9f1;
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(15, 23, 42, .045);
    min-height: 260px;
    overflow: hidden;
}

.pm-dashboard-card-wide {
    grid-column: span 2;
}

.pm-dashboard-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .95rem 1rem;
    border-bottom: 1px solid #eef2f7;
}

.pm-dashboard-card h2 {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    color: #344054;
    font-size: .98rem;
    font-weight: 800;
}

.pm-dashboard-card header span {
    color: #64748b;
    font-size: .8rem;
    text-align: right;
}

.pm-dashboard-donut-wrap {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1.4rem;
}

.pm-dashboard-donut {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(#22c55e 0 120deg, #f59e0b 120deg 210deg, #e11d48 210deg 360deg);
    box-shadow: inset 0 0 0 18px #fff, 0 10px 24px rgba(15, 23, 42, .08);
}

.pm-dashboard-donut::after {
    content: attr(data-label);
    width: 106px;
    height: 106px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    color: #111827;
    font-size: 1.45rem;
    font-weight: 900;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .07);
}

.pm-dashboard-list,
.pm-dashboard-legend,
.pm-dashboard-bars,
.pm-dashboard-progress-list,
.pm-dashboard-timeline {
    padding: 1rem;
}

.pm-dashboard-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .48rem 0;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.pm-dashboard-list-row:last-child {
    border-bottom: 0;
}

.pm-dashboard-list-row span {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
}

.pm-dashboard-list-row strong {
    color: #111827;
    font-size: .95rem;
}

.pm-dashboard-dot {
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
    flex: 0 0 auto;
    background: #22c55e;
}

.pm-dashboard-dot-2 { background: #f59e0b; }
.pm-dashboard-dot-3 { background: #e11d48; }
.pm-dashboard-dot-4 { background: #64748b; }
.pm-dashboard-dot-5 { background: #2563eb; }

.pm-dashboard-bar-row,
.pm-dashboard-progress-row {
    margin-bottom: .78rem;
}

.pm-dashboard-bar-label,
.pm-dashboard-progress-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    color: #334155;
    font-size: .86rem;
    margin-bottom: .28rem;
}

.pm-dashboard-bar-label strong,
.pm-dashboard-progress-title strong {
    color: #111827;
}

.pm-dashboard-bar-track,
.pm-dashboard-progress-track {
    height: .48rem;
    background: #e8eef5;
    border-radius: 999px;
    overflow: hidden;
}

.pm-dashboard-bar-track i,
.pm-dashboard-progress-track i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #2563eb);
    border-radius: inherit;
}

.pm-dashboard-progress-track i {
    background: linear-gradient(90deg, #10b981, #22c55e);
}

.pm-dashboard-progress-meta {
    margin-top: .25rem;
    color: #64748b;
    font-size: .76rem;
}

.pm-dashboard-timeline-row {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: .65rem;
    padding: .25rem 0 .85rem;
    color: #334155;
}

.pm-dashboard-timeline-row > span {
    width: .55rem;
    height: .55rem;
    margin-top: .33rem;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.pm-dashboard-timeline-row strong,
.pm-dashboard-timeline-row small {
    display: block;
}

.pm-dashboard-timeline-row small {
    margin-top: .15rem;
    color: #64748b;
}

.pm-dashboard-empty {
    color: #64748b;
    font-size: .86rem;
    padding: .5rem 0;
}

.pm-dashboard-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1rem;
}

@media (max-width: 1199.98px) {
    .pm-dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(130px, 1fr));
    }

    .pm-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .pm-dashboard-kpi-grid,
    .pm-dashboard-grid,
    .pm-dashboard-donut-wrap {
        grid-template-columns: 1fr;
    }

    .pm-dashboard-card-wide {
        grid-column: span 1;
    }

    .pm-dashboard-donut {
        margin: 0 auto;
    }
}
.pm-dashboard-kpi strong span {
    display: inline;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* PM Management Dashboard */
.pm-management-dashboard-shell {
    margin-top: 1rem;
}

.pm-management-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pm-management-grid {
    align-items: stretch;
}

.pm-management-stacked {
    display: grid;
    gap: .85rem;
}

.pm-management-stack-row {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: .75rem;
}

.pm-management-stack-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.pm-management-stack-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .35rem;
    color: #0f172a;
}

.pm-management-stack-head strong {
    font-weight: 800;
}

.pm-management-stack-head span,
.pm-management-stack-meta {
    color: #475569;
    font-size: .82rem;
}

.pm-management-stack-track {
    display: flex;
    width: 100%;
    min-width: 7%;
    height: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
}

.pm-management-stack-track i {
    display: block;
    min-width: 2px;
    height: 100%;
}

.pm-management-seg-ok { background: #22c55e; }
.pm-management-seg-warn { background: #f59e0b; }
.pm-management-seg-bad { background: #e11d48; }

.pm-management-stack-meta {
    margin-top: .3rem;
}

.pm-management-line {
    min-height: 200px;
}

.pm-management-svg {
    width: 100%;
    height: auto;
    min-height: 180px;
}

.pm-management-svg line {
    stroke: #cbd5e1;
    stroke-width: 1.5;
}

.pm-management-svg polyline {
    fill: none;
    stroke: #2563eb;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pm-management-svg circle {
    fill: #2563eb;
    stroke: #fff;
    stroke-width: 2;
}

.pm-management-svg text {
    fill: #334155;
    font-size: 11px;
    font-weight: 700;
}

.pm-management-table-wrap {
    overflow: auto;
    max-height: 520px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.pm-management-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .82rem;
    min-width: 860px;
    background: #fff;
}

.pm-management-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 800;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    padding: .65rem .7rem;
    white-space: nowrap;
}

.pm-management-table td {
    border-bottom: 1px solid #eef2f7;
    color: #334155;
    padding: .55rem .7rem;
    vertical-align: top;
    white-space: nowrap;
}

.pm-management-table tbody tr:hover td {
    background: #f8fbff;
}

.pm-management-table .pm-management-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

@media (max-width: 1200px) {
    .pm-management-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .pm-management-kpi-grid {
        grid-template-columns: 1fr;
    }

    .pm-management-stack-head {
        display: block;
    }
}


.pm-dashboard-scope-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px 0;
    padding: 10px 14px;
    border: 1px solid rgba(245, 158, 11, .35);
    border-left: 5px solid #f59e0b;
    border-radius: 14px;
    background: #fffbeb;
    color: #78350f;
    font-size: .9rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

.pm-dashboard-scope-note i {
    color: #b45309;
    font-size: 1rem;
}

/* Generic runtime quick-view card used by PM dashboards and future runtime pages. */
.runtime-quick-view-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(300px, 2fr);
    gap: 14px;
    align-items: center;
    margin: 0 0 16px 0;
    padding: 14px 16px;
    border: 1px solid rgba(15, 118, 110, .14);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.runtime-quick-view-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.runtime-quick-view-title > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #ecfeff;
    color: #0f766e;
    font-size: 1.2rem;
    flex: 0 0 auto;
}

.runtime-quick-view-title strong {
    display: block;
    color: #0f172a;
    font-size: 1.02rem;
    font-weight: 900;
}

.runtime-quick-view-title small,
.runtime-quick-view-help {
    display: block;
    color: #475569;
    font-size: .85rem;
    line-height: 1.35;
}

.runtime-quick-view-controls {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}

.runtime-quick-view-help {
    grid-column: 2 / -1;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
}

@media (max-width: 980px) {
    .runtime-quick-view-card {
        grid-template-columns: 1fr;
    }

    .runtime-quick-view-controls {
        grid-template-columns: 1fr;
    }

    .runtime-quick-view-help {
        grid-column: auto;
    }
}

/* Smooth dashboard refresh: filters update data without page reload or scroll jump. */
.runtime-filter-card.runtime-filter-card-loading {
    position: relative;
}

.runtime-filter-card.runtime-filter-card-loading::after {
    content: "Updating...";
    position: absolute;
    right: 14px;
    top: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: .78rem;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(37, 99, 235, .12);
}

.pm-dashboard-loading-soft .pm-dashboard-kpi,
.pm-dashboard-loading-soft .pm-dashboard-card,
.pm-dashboard-loading-soft .pm-management-card,
.pm-dashboard-loading-soft .pm-management-kpi {
    transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
    opacity: .74;
}

.runtime-smooth-loading .pm-dashboard-kpi,
.runtime-smooth-loading .pm-management-kpi {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .08), 0 10px 28px rgba(15, 23, 42, .06);
}

.ingq-runtime-toast-host {
    position: fixed;
    top: 76px;
    right: 18px;
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 28px));
}

.ingq-runtime-toast {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 280px;
    padding: 12px 12px;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 16px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 22px 48px rgba(15, 23, 42, .18);
    color: #0f172a;
    opacity: 0;
    transform: translate3d(18px, -8px, 0) scale(.98);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: auto;
    overflow: hidden;
}

.ingq-runtime-toast.show {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.ingq-runtime-toast::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: #2563eb;
}

.ingq-runtime-toast-success::before { background: #16a34a; }
.ingq-runtime-toast-warning::before { background: #f59e0b; }
.ingq-runtime-toast-danger::before,
.ingq-runtime-toast-error::before { background: #dc2626; }
.ingq-runtime-toast-info::before { background: #2563eb; }

.ingq-runtime-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 13px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1rem;
}

.ingq-runtime-toast-success .ingq-runtime-toast-icon {
    background: #ecfdf5;
    color: #16a34a;
}

.ingq-runtime-toast-warning .ingq-runtime-toast-icon {
    background: #fffbeb;
    color: #b45309;
}

.ingq-runtime-toast-danger .ingq-runtime-toast-icon,
.ingq-runtime-toast-error .ingq-runtime-toast-icon {
    background: #fef2f2;
    color: #dc2626;
}

.ingq-runtime-toast-body {
    min-width: 0;
}

.ingq-runtime-toast-body strong,
.ingq-runtime-toast-body span {
    display: block;
}

.ingq-runtime-toast-body strong {
    margin-bottom: 2px;
    font-size: .9rem;
    font-weight: 900;
    color: #0f172a;
}

.ingq-runtime-toast-body span {
    font-size: .83rem;
    line-height: 1.32;
    color: #475569;
}

.ingq-runtime-toast button {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 1.25rem;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 8px;
}

.ingq-runtime-toast button:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.ingq-runtime-toast-loading .ingq-runtime-toast-icon {
    background: #eff6ff;
    color: #2563eb;
}

@media (max-width: 700px) {
    .ingq-runtime-toast-host {
        top: 66px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .ingq-runtime-toast {
        min-width: 0;
        width: 100%;
    }
}


/* Global initial page loader: layout-level loader for all runtime pages without touching every page. */
.ingq-global-page-loader {
    position: fixed;
    inset: 0;
    z-index: 2147482500;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 82px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(15, 23, 42, .12), rgba(15, 23, 42, 0));
    opacity: 1;
    transition: opacity .24s ease, visibility .24s ease;
}

.ingq-global-page-loader-hidden {
    opacity: 0;
    visibility: hidden;
}

.ingq-global-page-loader-panel {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: min(410px, calc(100vw - 28px));
    max-width: min(480px, calc(100vw - 28px));
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(148, 163, 184, .32);
    box-shadow: 0 24px 54px rgba(15, 23, 42, .20);
    color: #0f172a;
    overflow: hidden;
    position: relative;
}

.ingq-global-page-loader-panel::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #0ea5e9, #22c55e, #2563eb);
    background-size: 220% 100%;
    animation: ingqGlobalLoaderBar 1.35s linear infinite;
}

.ingq-global-page-loader-spinner {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
}

.ingq-global-page-loader-text strong,
.ingq-global-page-loader-text span {
    display: block;
}

.ingq-global-page-loader-text strong {
    font-size: .98rem;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 2px;
}

.ingq-global-page-loader-text span {
    font-size: .86rem;
    color: #475569;
    line-height: 1.3;
}

body.ingq-initial-page-loading .perfex-content {
    transition: opacity .2s ease;
}

@keyframes ingqGlobalLoaderBar {
    0% { background-position: 0 0; }
    100% { background-position: 220% 0; }
}

@media (max-width: 700px) {
    .ingq-global-page-loader {
        padding-top: 66px;
        align-items: flex-start;
    }

    .ingq-global-page-loader-panel {
        min-width: 0;
        width: calc(100vw - 20px);
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 12px 13px;
        border-radius: 16px;
    }

    .ingq-global-page-loader-spinner {
        width: 38px;
        height: 38px;
    }
}

/* SHE Live + Management dashboards reuse the PM dashboard shell with SHE colors. */
.she-dashboard-shell .pm-dashboard-donut {
    background: conic-gradient(#22c55e 0 120deg, #f59e0b 120deg 210deg, #e11d48 210deg 360deg);
}

.she-dashboard-shell .pm-dashboard-progress-track i,
.she-dashboard-shell .pm-dashboard-bar-track i {
    background: linear-gradient(90deg, #2563eb, #06b6d4);
}

.she-dashboard-shell .she-dashboard-progress-row .pm-dashboard-progress-track i {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

.she-dashboard-shell .pm-dashboard-card h2 i,
.she-dashboard-shell .pm-dashboard-loading {
    color: #2563eb;
}

.she-dashboard-shell .pm-management-svg polyline,
.she-dashboard-shell .pm-management-svg circle {
    stroke: #2563eb;
}

.she-dashboard-shell .pm-management-svg circle {
    fill: #2563eb;
}

.she-dashboard-shell .pm-dashboard-timeline-row > span {
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.she-dashboard-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1200px) {
    .she-dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .she-dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* Floating non-blocking page information panel.
   This is not a Bootstrap modal: no backdrop, no body scroll lock, and it stays open while jqGrid add/edit/search popups are used. */
.runtime-page-info-button {
    color: #0f172a !important;
    font-weight: 700;
}

.runtime-page-info-modal[hidden] {
    display: none !important;
}

.runtime-page-info-modal {
    position: fixed;
    top: 150px;
    right: 24px;
    width: min(470px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 110px));
    min-width: 310px;
    min-height: 230px;
    z-index: 1095;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    border: 1px solid rgba(15, 23, 42, .18);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 26px 80px rgba(15, 23, 42, .30);
    color: #0f172a;
}

.runtime-page-info-modal.runtime-page-info-minimized {
    height: auto !important;
    min-height: 0;
    resize: none;
}

.runtime-page-info-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #0f172a 0%, var(--runtime-accent) 100%);
    color: #ffffff;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.runtime-page-info-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: .93rem;
    font-weight: 800;
}

.runtime-page-info-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.runtime-page-info-window-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.runtime-page-info-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
    line-height: 1;
}

.runtime-page-info-icon-button:hover,
.runtime-page-info-icon-button:focus {
    background: rgba(255, 255, 255, .25);
    outline: none;
}

.runtime-page-info-body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 13px 14px 14px;
    font-size: .89rem;
    line-height: 1.55;
}

.runtime-page-info-minimized .runtime-page-info-body,
.runtime-page-info-minimized .runtime-page-info-footer {
    display: none;
}

.runtime-page-info-summary {
    padding: 11px 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 12px;
    background: var(--runtime-accent-soft);
    color: #334155;
    font-weight: 650;
}

.runtime-page-info-section {
    padding: 0 0 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.runtime-page-info-section:last-child {
    margin-bottom: 0;
    border-bottom: 0;
}

.runtime-page-info-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 7px;
    font-size: .94rem;
    font-weight: 850;
    color: #0f172a;
}

.runtime-page-info-section h3 i {
    color: var(--runtime-accent);
}

.runtime-page-info-section p {
    margin: 0 0 8px;
    color: #475569;
}

.runtime-page-info-section ol {
    margin: 0;
    padding-left: 1.25rem;
    color: #334155;
}

.runtime-page-info-section li {
    margin-bottom: 7px;
}

.runtime-page-info-footer {
    flex: 0 0 auto;
    padding: 9px 12px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: .78rem;
}

.runtime-page-info-modal .ui-resizable-handle {
    z-index: 3;
}

body.runtime-page-info-dragging {
    cursor: move !important;
    user-select: none;
}

@media (max-width: 640px) {
    .runtime-page-info-modal {
        top: 86px;
        left: 8px;
        right: 8px;
        width: calc(100vw - 16px);
        max-height: calc(100vh - 100px);
        min-width: 0;
    }
}

/* Legal Appointment dashboard additions */
.legal-appointment-dashboard-shell .pm-dashboard-card header h2 i,
.legal-appointment-dashboard-shell .runtime-page-eyebrow i {
    color: #0f766e;
}

.legal-appointment-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.legal-management-seg-orange { background: #fb923c; }
.legal-management-seg-brown { background: #92400e; }

.legal-appointment-progress-row .pm-dashboard-progress-track i {
    background: linear-gradient(90deg, #22c55e, #f59e0b);
}

@media (max-width: 1100px) {
    .legal-appointment-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .legal-appointment-kpi-grid {
        grid-template-columns: 1fr;
    }
}
