/* Platform admin site — layout only. Every color, radius and font is a token from
   _content/EzInventory.App.Shared/app.css (docs/cymansys-style-guide.md: swap the
   palette there, never restyle structure here). */

.admin-topbar .topbar-inner { gap: 14px; }

.admin-brand { gap: 10px; color: var(--steel); }
.admin-brand-sep { color: var(--steel-dim); }
.admin-brand-word {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    color: var(--paper);
}

.admin-env { margin-right: auto; }
.tag-prod { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); }

.admin-operator { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-operator-email { font-size: 12px; color: var(--steel-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }

/* Rail + page: the rail is a sticky column of pills under the floating top bar. */
.admin-body {
    display: flex;
    gap: 24px;
    width: 100%;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 20px 28px;
    flex: 1;
}

.admin-rail {
    position: sticky;
    top: 92px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 196px;
    flex-shrink: 0;
    padding: 8px;
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    border: 1px solid var(--edge);
    border-radius: var(--radius-lg);
}

.admin-rail-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 999px;
    color: var(--steel);
    font-size: 13.5px;
    font-weight: 500;
    transition: color 120ms ease, background 120ms ease;
}
.admin-rail-link:hover { color: var(--paper); background: var(--panel-2); }
.admin-rail-link.active {
    color: var(--ink);
    background: var(--panel-2);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--plasma-a) 55%, transparent);
}

.admin-content { padding: 0; max-width: none; min-width: 0; flex: 1; }

/* The gate states (loading, not authorised, API down) center one card. */
.admin-gate { display: flex; align-items: flex-start; justify-content: center; padding-top: 8dvh; }
.admin-gate-card { max-width: 520px; display: flex; flex-direction: column; gap: 10px; }
.admin-gate-card .actions { margin-top: 6px; }
.admin-forbidden .page-title { color: var(--critical); }

/* Rail badge: new ideas since the operator last opened the page. */
.rail-badge {
    margin-left: auto;
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-align: center;
    color: var(--paper);
    background: var(--plasma-grad);
}

/* A long page-sub must not push the head's actions onto their own row. */
.admin-content .page-head > :first-child { flex: 1 1 360px; min-width: 0; }

/* Dashboard */
.dash-kpis { grid-template-columns: repeat(3, 1fr); }
.dash-internal { font-size: 13px; color: var(--steel); gap: 6px; display: inline-flex; align-items: center; }
.dash-stamp { margin-top: 10px; font-size: 11.5px; }
.signups-strip { width: 100%; height: auto; display: block; }
.signups-bar rect { cursor: default; }
.signups-bar:hover rect { filter: brightness(1.25); }

/* Tenants */
.tenants-chips { gap: 14px; }
.tenants-search { min-width: 300px; }
.tenant-row { cursor: pointer; }
table.tenants td.email { min-width: 200px; }
.tenant-kpis { grid-template-columns: repeat(3, 1fr); }
.tenant-kpis .tenant-seen { font-size: 22px; white-space: nowrap; }
.tenant-row .origin { margin-left: 6px; }
.backfill-result { font-size: 12.5px; }
.tenant-owner { word-break: break-all; }
.facts { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--steel); }
.facts dd { margin: 0; }

/* Ideas */
.ideas-search { min-width: 240px; }
table.ideas .idea-cell { min-width: 240px; max-width: 420px; }
table.ideas .idea-author { min-width: 180px; }
table.ideas .idea-title { font-weight: 600; }
table.ideas .idea-desc { font-size: 12.5px; white-space: normal; max-height: 3.2em; overflow: hidden; }
table.ideas .idea-status-select { width: auto; min-width: 120px; padding: 5px 10px; }
table.ideas .idea-score { font-weight: 600; }

@media (max-width: 820px) {
    .admin-body { flex-direction: column; gap: 14px; padding: 0 14px 20px; }
    .admin-rail {
        position: static;
        align-self: stretch; /* the column layout's flex-start would size it to its content and overflow the page */
        flex-direction: row;
        width: auto;
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .admin-rail::-webkit-scrollbar { display: none; }
    .admin-rail-link span { white-space: nowrap; }
    .admin-operator-email { display: none; }
    .facts { grid-template-columns: 1fr; }
    .dash-panels { grid-template-columns: 1fr; }
    .dash-kpis, .tenant-kpis { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
    .dash-kpis, .tenant-kpis { grid-template-columns: 1fr; }
    .tenants-search { min-width: 0; width: 100%; }
}
