:root {
    --brand: #333;
    --bg: #f4f5f7;
    --card-bg: #fff;
    --text: #1f2430;
    --muted: #6b7280;
    --border: #e5e7eb;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Header */
.portal-header {
    background: var(--brand);
    color: #fff;
    padding: 28px 20px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1080px;
    margin: 0 auto;
}
.brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    flex: 0 0 auto;
}
.brand-logo--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .18);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: .5px;
}
.portal-header h1 { margin: 0; font-size: 22px; }
.subtitle { margin: 2px 0 0; opacity: .85; font-size: 14px; }

/* Announcement banner */
.announcement {
    border-bottom: 1px solid var(--border);
}
.announcement__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.announcement__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
}
.announcement--info    { background: #eef4ff; color: #1e3a8a; }
.announcement--info    .announcement__dot { background: #3b82f6; }
.announcement--success { background: #ecfdf3; color: #14532d; }
.announcement--success .announcement__dot { background: #22c55e; }
.announcement--warning { background: #fff7ed; color: #7c2d12; }
.announcement--warning .announcement__dot { background: #f59e0b; }

/* Library grid */
.library {
    max-width: 1080px;
    margin: 28px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Cards */
.app-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: transform .12s ease, box-shadow .12s ease;
}
.app-card.is-licensed:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .1), 0 14px 32px rgba(0, 0, 0, .08);
}
.app-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.app-card__icon { font-size: 34px; line-height: 1; }

/* Status indicator */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.status__dot { width: 8px; height: 8px; border-radius: 50%; }

/* Lifecycle badge (catalog availability) */
.lifecycle {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    white-space: nowrap;
}
.lifecycle--coming_soon { background: #eef2ff; color: #4338ca; }
.lifecycle--beta        { background: #ecfeff; color: #0e7490; }
.lifecycle--retired     { background: #f3f4f6; color: #6b7280; }
.status--operational { background: #ecfdf3; color: #15803d; }
.status--operational .status__dot { background: #22c55e; }
.status--maintenance { background: #fff7ed; color: #b45309; }
.status--maintenance .status__dot { background: #f59e0b; }
.status--down        { background: #fef2f2; color: #b91c1c; }
.status--down        .status__dot { background: #ef4444; }
.app-card__name { margin: 12px 0 4px; font-size: 18px; }
.app-card__tagline { margin: 0 0 10px; color: var(--muted); font-weight: 600; font-size: 14px; }
.app-card__desc { margin: 0; font-size: 14px; color: #374151; flex: 1 1 auto; }
.app-card__footer { margin-top: 18px; }

/* Locked (unsubscribed) state — greyed out */
.app-card.is-locked {
    background: #fafafa;
    box-shadow: none;
}
.app-card.is-locked .app-card__icon,
.app-card.is-locked .app-card__name,
.app-card.is-locked .app-card__tagline,
.app-card.is-locked .app-card__desc {
    filter: grayscale(1);
    opacity: .55;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--border);
}
.btn--ghost:hover { background: #f0f0f0; }

.badge {
    display: inline-block;
    margin-right: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eceef1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.poc { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.poc a { color: var(--brand); }

/* Support card — distinct accent so it reads as "us", not an app */
.support-card {
    background: linear-gradient(180deg, #fff, #fbfaff);
    border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
}
.support-card .btn--primary { background: var(--brand); }

/* Give the footer buttons room to sit side by side */
.app-card__footer .btn + .btn { margin-left: 8px; }

/* Footer */
.portal-footer {
    max-width: 1080px;
    margin: 40px auto 24px;
    padding: 0 20px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}
.portal-footer p { margin: 4px 0; }
.portal-footer__admin a {
    color: var(--muted);
    text-decoration: none;
    opacity: .7;
}
.portal-footer__admin a:hover { opacity: 1; text-decoration: underline; }
