/* Portal pages and shell, following the Enterprise UI Design Guidelines (Claude.md at the repo root).
   The palette is defined once here as --pd-* variables, so everything below changes from one place. Only the
   portal's own pages use these classes (ph- = portal home); add-on pages keep their own styles. */

:root {
    --pd-bg: #eef1f5;
    --pd-surface: #ffffff;
    --pd-fill: #f4f6f9;
    --pd-border: #c8d0db;
    --pd-text: #1f2a37;
    --pd-text-2: #5c6b7d;
    --pd-accent: #0b5cad;
    --pd-accent-tint: #e6f0fb;
    --pd-on-accent: #ffffff;
    --pd-link: #0b5cad;
    --pd-radius: 6px;
    --pd-font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Shell: one font, and a plain footer (the theme's bg-light is a gradient; guidelines: no gradients) */

body > .card,
footer.footer {
    font-family: var(--pd-font);
}

footer.footer.bg-light {
    background-color: var(--pd-surface) !important;
    background-image: none !important;
    border-top: 1px solid var(--pd-border);
}

    footer.footer p {
        font-size: 12px;
    }

/* Home page */

body:has(.portal-home) {
    background-color: var(--pd-bg);
}

    /* The home page lists the apps itself, so the top menu row is hidden here (other pages keep it) */
    body:has(.portal-home) > .card {
        display: none;
    }

.ph-logo {
    flex: 0 0 auto;
    margin-right: -12px;
}

.portal-home {
    padding-bottom: 24px;
    color: var(--pd-text);
    font-family: var(--pd-font);
    font-size: 13px;
}

/* Title bar: surface with a bottom border, title and key status on one row */
.ph-titlebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    margin: 0 -0.5rem 24px;
    padding: 12px 16px;
    background: var(--pd-surface);
    border-bottom: 1px solid var(--pd-border);
}

/* Content lines up with the title above it */
.portal-home > section,
.portal-home > .ph-empty {
    margin: 0 8px;
}

.ph-title {
    margin: 0;
    color: var(--pd-text);
    font-size: 18px;
    font-weight: 600;
}

.ph-status {
    margin-left: auto;
    color: var(--pd-text-2);
    font-size: 13px;
}

    .ph-status strong {
        color: var(--pd-text);
        font-weight: 600;
    }

.ph-titlebar-action {
    margin: 0;
}

/* Buttons: one primary (filled accent); secondary outlined */
.ph-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--pd-radius);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

    .ph-btn:hover {
        text-decoration: none;
    }

    .ph-btn:focus-visible,
    .ph-app-list a:focus-visible {
        outline: 2px solid var(--pd-accent);
        outline-offset: 2px;
    }

.ph-btn-lg {
    min-height: 40px;
    padding: 0 24px;
    font-size: 14px;
}

.ph-btn-primary,
.ph-btn-primary:hover {
    background: var(--pd-accent);
    border-color: var(--pd-accent);
    color: var(--pd-on-accent);
}

.ph-btn-secondary {
    background: var(--pd-surface);
    border-color: var(--pd-border);
    color: var(--pd-text);
}

    .ph-btn-secondary:hover {
        background: var(--pd-fill);
        color: var(--pd-text);
    }

/* Apps: the same groups and items as the top menu, as the page's next step */
.ph-section-title {
    margin: 0 0 8px;
    color: var(--pd-text);
    font-size: 14px;
    font-weight: 600;
}

.ph-apps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    align-items: start;
}

.ph-app-group {
    overflow: hidden;
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius);
}

.ph-app-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 16px;
    background: var(--pd-fill);
    border-bottom: 1px solid var(--pd-border);
    color: var(--pd-text);
    font-size: 14px;
    font-weight: 600;
}

.ph-app-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .ph-app-list li + li {
        border-top: 1px solid var(--pd-border);
    }

    .ph-app-list a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 40px;
        padding: 8px 16px;
        color: var(--pd-text);
        text-decoration: none;
    }

        .ph-app-list a:hover {
            background: var(--pd-accent-tint);
            color: var(--pd-accent);
            text-decoration: none;
        }

        .ph-app-list a i {
            color: var(--pd-text-2);
            font-size: 11px;
        }

/* Signed out: one line saying why, and the one action */
.ph-empty {
    padding: 32px 16px;
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius);
    text-align: center;
}

    .ph-empty p {
        margin: 0 0 16px;
        color: var(--pd-text-2);
        font-size: 14px;
    }

/* Signed out: the apps that don't need signing in follow the log-in prompt */
.ph-empty + .ph-apps-section {
    margin-top: 24px;
}
