@import url("ordavant-brand.css");
/* ordavant-spa.css — shared chrome for Ordavant product SPAs.
 * Served at https://ordavant.com/static/ordavant-spa.css.
 * Product-specific overrides live in each product's own /static/css/style.css,
 * which should be linked AFTER this file so overrides take effect.
 * Canonical standard: handbook/SPA_dashboard_standards.md */

/* ---- Base alert (pre-placed [role=alert] inline alerts) ---- */
[role="alert"] {
    padding: 1rem;
    border-radius: var(--pico-border-radius);
    background: var(--pico-card-background-color);
    margin-top: 1rem;
}

/* ---- Header nav: two-line user block (email above, links below) ---- */
.nav-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}
.nav-user-email {
    font-size: 0.8rem;
    color: var(--pico-muted-color);
}
.nav-user-links {
    font-size: 0.8rem;
}
.nav-user-links a {
    color: var(--pico-primary);
}
.nav-sep {
    color: var(--pico-muted-color);
    margin: 0 0.2rem;
}

/* ---- Product switcher — pill overlays a ghost placeholder ---- */
.suite-brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
}
.suite-brand-lockup > .wordmark {
    flex: 0 0 auto;
    margin-left: 0;
}
.suite-brand-lockup > .western-mark {
    flex: 0 0 auto;
    margin-left: 0.15rem;
}
.product-switcher-wrap {
    position: relative;
    display: inline-block;
}
.product-switcher-ghost {
    display: inline-block;
    visibility: hidden;
    border: 1px solid transparent;
    border-radius: var(--pico-border-radius);
    padding: 0.15rem 0.5rem;
    white-space: nowrap;
}
.product-switcher {
    position: absolute;
    top: 0;
    left: 0;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 0.15rem 0.5rem;
    cursor: pointer;
    background: var(--pico-background-color, #fff);
    z-index: 10;
}
.product-switcher:hover,
.product-switcher.open {
    border-color: var(--pico-primary);
    z-index: 100;
}
.product-switcher-current {
    display: block;
    white-space: nowrap;
}
.suite-brand-lockup button.product-switcher-current {
    appearance: none;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
}
.product-switcher-link {
    display: none;
    text-decoration: none;
    font-size: inherit;
    color: var(--pico-color);
    white-space: nowrap;
}
.product-switcher-link:hover {
    color: var(--pico-primary);
}
.product-switcher.open .product-switcher-link {
    display: block;
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--pico-muted-border-color);
}
.link-button {
    appearance: none;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--pico-primary);
    font: inherit;
    text-decoration: underline;
}

/* ---- Mobile: stack header nav vertically, left-aligned ---- */
@media (max-width: 576px) {
    body > header {
        padding-block: 0.75rem;
    }
    header nav {
        flex-direction: column;
        align-items: flex-start;
    }
    header nav ul,
    header nav ul:first-of-type,
    header nav ul:last-of-type {
        padding: 0;
        margin: 0;
    }
    header nav li {
        padding: 0.25rem 0;
    }
    .nav-user {
        align-items: flex-start;
    }
}

/* ---- Admin dashboard layout (sidebar + panels) ---- */
.admin-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.admin-sidebar {
    width: 180px;
    flex-shrink: 0;
    position: sticky;
    top: 1rem;
}

.admin-sidebar nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    border-radius: var(--pico-border-radius);
    margin-bottom: 0.25rem;
    color: var(--pico-color);
}

.admin-sidebar nav a:hover {
    background: var(--pico-card-background-color);
}

.admin-sidebar-header {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    padding: 0.6rem 0.75rem 0.2rem;
    margin-top: 0.25rem;
}

.admin-sidebar nav a.active {
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
}

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

.admin-content > .admin-panel {
    display: none !important;
}

.admin-content > .admin-panel.active {
    display: block !important;
}

/* ---- Responsive: stack sidebar above content on narrow screens ---- */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        position: static;
    }
    .admin-sidebar nav {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.35rem;
    }
    .admin-sidebar nav a {
        text-align: center;
        white-space: nowrap;
        padding: 0.4rem 0.65rem;
        font-size: 0.85rem;
        border: 1px solid var(--pico-muted-border-color);
    }
    .admin-sidebar nav a.active {
        border-color: var(--pico-primary-background);
    }
    .admin-sidebar-header {
        display: none;
    }
}

/* ---- Landing page cards (three-hero grid) ---- */
.landing-card {
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1.5rem;
    text-align: center;
}

.landing-card svg {
    display: block;
    margin: 0 auto 0.75rem;
}

.landing-card strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.landing-card p {
    font-size: 0.95rem;
    color: var(--pico-muted-color);
    margin: 0;
}

.landing-section-heading {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2.5rem 0 1.5rem;
    color: var(--pico-muted-color);
}

.landing-tagline {
    text-align: center;
    font-size: 1.15rem;
    color: var(--pico-muted-color);
    margin: 0.5rem 0 2rem;
}

/* Product landing page layout (design_standards §15): centered hero, the
 * Start Here / Dashboard button row, and the two-up Stay-in-the-loop /
 * Ready-to-get-started row. Products use these classes, never inline styles. */
.landing-hero {
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 6rem;
}

.landing-actions {
    margin-top: 0;
    margin-bottom: 2.5rem;
}

.landing-cta-row {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.landing-cta {
    text-align: center;
    padding: 1.5rem;
}

.landing-cta-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.landing-cta .landing-cta-text {
    margin-bottom: 1rem;
}

/* ---- Spacing utilities (design_standards §12 "Spacing utilities") ----
 * A fixed scale, so products stop inventing per-element margins inline.
 * 0=0, 1=0.25rem, 2=0.5rem, 3=0.75rem, 4=1rem, 5=1.5rem, 6=2rem.
 * !important so they win over Pico's element margins, as the inline styles
 * they replace did. Visibility needs no class: use the `hidden` attribute.
 */
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-5 { margin-top: 1.5rem !important; }
.mt-6 { margin-top: 2rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.5rem !important; }
.mb-6 { margin-bottom: 2rem !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 0.75rem !important; }
.ml-4 { margin-left: 1rem !important; }

/* ---- Utility classes (design_standards §12; added in 0.6.0) ----
 * Single-property utilities that replace one-off inline styles. Each is exact
 * (no snapping to a nearby value), so converting an inline style to these
 * classes leaves the rendering unchanged. Generated from the table in
 * handbook/scripts/inline_style_codemod.py, which also does the conversion.
 *
 * Naming: spacing continues the 0..6 scale above; off-scale values use hundredths
 * of a rem (px-50 = 0.5rem, gap-40 = 0.4rem, fs-85 = 0.85rem). !important, like the
 * spacing set, so they win exactly where the inline style used to. The display
 * utilities are :not([hidden])-guarded so Pico's [hidden]{display:none !important}
 * still hides an element that also carries a display class.
 */
/* Display */
.flex:not([hidden]) { display: flex !important; }
.inline-flex:not([hidden]) { display: inline-flex !important; }
.block:not([hidden]) { display: block !important; }
.inline-block:not([hidden]) { display: inline-block !important; }
.inline:not([hidden]) { display: inline !important; }

/* Flex layout */
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }
.items-baseline { align-items: baseline !important; }
.items-stretch { align-items: stretch !important; }
.justify-between { justify-content: space-between !important; }
.justify-end { justify-content: flex-end !important; }
.justify-center { justify-content: center !important; }
.justify-start { justify-content: flex-start !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-col { flex-direction: column !important; }
.flex-1 { flex: 1 !important; }
.flex-none { flex: 0 0 auto !important; }
.shrink-0 { flex-shrink: 0 !important; }
.flex-auto { flex: 1 1 auto !important; }
.gap-20 { gap: 0.2rem !important; }
.gap-25 { gap: 0.25rem !important; }
.gap-30 { gap: 0.3rem !important; }
.gap-40 { gap: 0.4rem !important; }
.gap-50 { gap: 0.5rem !important; }
.gap-60 { gap: 0.6rem !important; }
.gap-75 { gap: 0.75rem !important; }
.gap-100 { gap: 1rem !important; }
.gap-150 { gap: 1.5rem !important; }
.gap-200 { gap: 2rem !important; }

/* Typography */
.fs-65 { font-size: 0.65rem !important; }
.fs-70 { font-size: 0.7rem !important; }
.fs-75 { font-size: 0.75rem !important; }
.fs-78 { font-size: 0.78rem !important; }
.fs-80 { font-size: 0.8rem !important; }
.fs-82 { font-size: 0.82rem !important; }
.fs-85 { font-size: 0.85rem !important; }
.fs-88 { font-size: 0.88rem !important; }
.fs-90 { font-size: 0.9rem !important; }
.fs-95 { font-size: 0.95rem !important; }
.fs-110 { font-size: 1.1rem !important; }
.fs-120 { font-size: 1.2rem !important; }
.fs-125 { font-size: 1.25rem !important; }
.fs-150 { font-size: 1.5rem !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-normal { font-weight: normal !important; }
.italic { font-style: italic !important; }
.lh-1 { line-height: 1 !important; }
.lh-14 { line-height: 1.4 !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.nowrap { white-space: nowrap !important; }
.pre-wrap { white-space: pre-wrap !important; }
.no-underline { text-decoration: none !important; }
.underline { text-decoration: underline !important; }
.pointer { cursor: pointer !important; }
.break-word { overflow-wrap: anywhere !important; }
.text-ellipsis { text-overflow: ellipsis !important; }
.text-muted-color { color: var(--pico-muted-color) !important; }
.text-del { color: var(--pico-del-color) !important; }
.text-body { color: var(--pico-color) !important; }
.fs-87 { font-size: 0.875rem !important; }
.fs-87em { font-size: 0.875em !important; }
.text-inherit { color: inherit !important; }
.break-all { word-break: break-all !important; }

/* Sizing */
.overflow-hidden { overflow: hidden !important; }
.overflow-x-auto { overflow-x: auto !important; }
.w-full { width: 100% !important; }
.w-auto { width: auto !important; }
.h-auto { height: auto !important; }
.min-w-0 { min-width: 0 !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.max-w-320 { max-width: 320px !important; }
.max-w-360 { max-width: 360px !important; }
.max-w-400 { max-width: 400px !important; }
.max-w-420 { max-width: 420px !important; }
.max-w-480 { max-width: 480px !important; }
.max-w-500 { max-width: 500px !important; }
.max-w-520 { max-width: 520px !important; }
.max-w-560 { max-width: 560px !important; }
.max-w-600 { max-width: 600px !important; }
.max-w-640 { max-width: 640px !important; }
.max-w-720 { max-width: 720px !important; }
.max-w-800 { max-width: 800px !important; }
.align-middle { vertical-align: middle !important; }

/* Surface */
.bg-card { background: var(--pico-card-background-color) !important; }
.rounded { border-radius: var(--pico-border-radius) !important; }
.rounded-3 { border-radius: 3px !important; }
.rounded-6 { border-radius: 6px !important; }
.border-muted { border: 1px solid var(--pico-muted-border-color) !important; }
.opacity-70 { opacity: 0.7 !important; }
.opacity-60 { opacity: 0.6 !important; }
.opacity-80 { opacity: 0.8 !important; }
.rounded-4 { border-radius: 4px !important; }

/* Margin (off-scale and right) */
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 0.75rem !important; }
.mr-4 { margin-right: 1rem !important; }
.mt-10 { margin-top: 0.1rem !important; }
.mb-10 { margin-bottom: 0.1rem !important; }
.ml-10 { margin-left: 0.1rem !important; }
.mr-10 { margin-right: 0.1rem !important; }
.mt-15 { margin-top: 0.15rem !important; }
.mb-15 { margin-bottom: 0.15rem !important; }
.ml-15 { margin-left: 0.15rem !important; }
.mr-15 { margin-right: 0.15rem !important; }
.mt-20 { margin-top: 0.2rem !important; }
.mb-20 { margin-bottom: 0.2rem !important; }
.ml-20 { margin-left: 0.2rem !important; }
.mr-20 { margin-right: 0.2rem !important; }
.mt-30 { margin-top: 0.3rem !important; }
.mb-30 { margin-bottom: 0.3rem !important; }
.ml-30 { margin-left: 0.3rem !important; }
.mr-30 { margin-right: 0.3rem !important; }
.mt-40 { margin-top: 0.4rem !important; }
.mb-40 { margin-bottom: 0.4rem !important; }
.ml-40 { margin-left: 0.4rem !important; }
.mr-40 { margin-right: 0.4rem !important; }
.mt-60 { margin-top: 0.6rem !important; }
.mb-60 { margin-bottom: 0.6rem !important; }
.ml-60 { margin-left: 0.6rem !important; }
.mr-60 { margin-right: 0.6rem !important; }
.mt-80 { margin-top: 0.8rem !important; }
.mb-80 { margin-bottom: 0.8rem !important; }
.ml-80 { margin-left: 0.8rem !important; }
.mr-80 { margin-right: 0.8rem !important; }
.mt-125 { margin-top: 1.25rem !important; }
.mb-125 { margin-bottom: 1.25rem !important; }
.ml-125 { margin-left: 1.25rem !important; }
.mr-125 { margin-right: 1.25rem !important; }
.mt-300 { margin-top: 3rem !important; }
.mb-300 { margin-bottom: 3rem !important; }
.ml-300 { margin-left: 3rem !important; }
.mr-300 { margin-right: 3rem !important; }

/* Padding */
.p-0 { padding: 0 !important; }
.pl-15 { padding-left: 0.15rem !important; }
.pr-15 { padding-right: 0.15rem !important; }
.pt-15 { padding-top: 0.15rem !important; }
.pb-15 { padding-bottom: 0.15rem !important; }
.p-15 { padding: 0.15rem !important; }
.pl-20 { padding-left: 0.2rem !important; }
.pr-20 { padding-right: 0.2rem !important; }
.pt-20 { padding-top: 0.2rem !important; }
.pb-20 { padding-bottom: 0.2rem !important; }
.p-20 { padding: 0.2rem !important; }
.pl-25 { padding-left: 0.25rem !important; }
.pr-25 { padding-right: 0.25rem !important; }
.pt-25 { padding-top: 0.25rem !important; }
.pb-25 { padding-bottom: 0.25rem !important; }
.p-25 { padding: 0.25rem !important; }
.pl-30 { padding-left: 0.3rem !important; }
.pr-30 { padding-right: 0.3rem !important; }
.pt-30 { padding-top: 0.3rem !important; }
.pb-30 { padding-bottom: 0.3rem !important; }
.p-30 { padding: 0.3rem !important; }
.pl-40 { padding-left: 0.4rem !important; }
.pr-40 { padding-right: 0.4rem !important; }
.pt-40 { padding-top: 0.4rem !important; }
.pb-40 { padding-bottom: 0.4rem !important; }
.p-40 { padding: 0.4rem !important; }
.pl-50 { padding-left: 0.5rem !important; }
.pr-50 { padding-right: 0.5rem !important; }
.pt-50 { padding-top: 0.5rem !important; }
.pb-50 { padding-bottom: 0.5rem !important; }
.p-50 { padding: 0.5rem !important; }
.pl-55 { padding-left: 0.55rem !important; }
.pr-55 { padding-right: 0.55rem !important; }
.pt-55 { padding-top: 0.55rem !important; }
.pb-55 { padding-bottom: 0.55rem !important; }
.p-55 { padding: 0.55rem !important; }
.pl-60 { padding-left: 0.6rem !important; }
.pr-60 { padding-right: 0.6rem !important; }
.pt-60 { padding-top: 0.6rem !important; }
.pb-60 { padding-bottom: 0.6rem !important; }
.p-60 { padding: 0.6rem !important; }
.pl-75 { padding-left: 0.75rem !important; }
.pr-75 { padding-right: 0.75rem !important; }
.pt-75 { padding-top: 0.75rem !important; }
.pb-75 { padding-bottom: 0.75rem !important; }
.p-75 { padding: 0.75rem !important; }
.pl-90 { padding-left: 0.9rem !important; }
.pr-90 { padding-right: 0.9rem !important; }
.pt-90 { padding-top: 0.9rem !important; }
.pb-90 { padding-bottom: 0.9rem !important; }
.p-90 { padding: 0.9rem !important; }
.pl-100 { padding-left: 1rem !important; }
.pr-100 { padding-right: 1rem !important; }
.pt-100 { padding-top: 1rem !important; }
.pb-100 { padding-bottom: 1rem !important; }
.p-100 { padding: 1rem !important; }
.pl-125 { padding-left: 1.25rem !important; }
.pr-125 { padding-right: 1.25rem !important; }
.pt-125 { padding-top: 1.25rem !important; }
.pb-125 { padding-bottom: 1.25rem !important; }
.p-125 { padding: 1.25rem !important; }
.pl-150 { padding-left: 1.5rem !important; }
.pr-150 { padding-right: 1.5rem !important; }
.pt-150 { padding-top: 1.5rem !important; }
.pb-150 { padding-bottom: 1.5rem !important; }
.p-150 { padding: 1.5rem !important; }
.pl-200 { padding-left: 2rem !important; }
.pr-200 { padding-right: 2rem !important; }
.pt-200 { padding-top: 2rem !important; }
.pb-200 { padding-bottom: 2rem !important; }
.p-200 { padding: 2rem !important; }

/* ---- Entity switcher (`<select>` + adjacent action buttons at panel top) ----
 * Pattern: panels that manage one of many instances of an entity
 * (newsletters, events, groups) lead with a dropdown to pick which one
 * is being configured, optionally followed by "New X" / "Delete" buttons.
 * Used by Convene's events-panel and Collate's newsletter switcher.
 * Documented in SPA_dashboard_standards.md §21.
 */
.entity-switcher-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.entity-switcher {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0.2rem 0.4rem;
    font-weight: bold;
}
.entity-switcher-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}
/* Buttons inside the actions slot auto-size to match .btn-sm (see
 * design_standards.md §2). Applying this via the parent instead of
 * requiring products to add .btn-sm keeps the switcher visually
 * balanced against the compact .entity-switcher <select> and
 * prevents per-product drift.
 *
 * margin: 0 strips Pico's default [type=button] margin-bottom, which
 * otherwise enlarges the button's flex margin box and vertically
 * misaligns it against the .entity-switcher <select> under the row's
 * align-items: center. */
.entity-switcher-actions button,
.entity-switcher-actions a[role="button"] {
    margin: 0;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

/* ---- Sub-navigation within a panel ----
 * Tile-style horizontal bar that hosts either:
 *   - sub-tabs: links carrying data-sub-panel="..." that toggle .sub-panel
 *     siblings (wired by narratory.subNavInit)
 *   - action buttons: <button> elements that perform side-effecting actions
 *     (no data-sub-panel; click handlers stay product-local)
 *
 * Visual language is identical to the collapsed-mobile main menu (see
 * @media block below) — bordered tile buttons in a responsive grid.
 * Documented in SPA_dashboard_standards.md §20.
 */
.sub-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.35rem;
    margin: 1rem 0;
}
.sub-nav a,
.sub-nav button {
    display: block;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--pico-muted-color);
    background: transparent;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    /* Pico's <button> defaults shove margin-bottom; reset for grid layout */
    margin: 0;
}
.sub-nav a:hover,
.sub-nav button:hover:not(:disabled),
.sub-nav button:focus:not(:disabled) {
    /* Hard-code the body-text token instead of var(--pico-color): Pico v2's
     * [type=button]:is(:hover,:active,:focus) rule (specificity 0,2,0) wins
     * over any reset we could declare here at .sub-nav-button scope (0,1,1)
     * and would flip --pico-color to --pico-primary-inverse (white), making
     * the buttons vanish on hover. Sidestep the whole cascade. */
    color: var(--pico-h1-color);
    background: transparent;
    border-color: var(--pico-h1-color);
    box-shadow: none;
}
.sub-nav a.active,
.sub-nav button.active {
    border-color: var(--pico-primary);
    color: var(--pico-primary);
    font-weight: 600;
}
.sub-nav button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sub-panel {
    display: none !important;
}
.sub-panel.active {
    display: block !important;
}

/* Sub-nav narrows to fixed 3 columns on small screens — matches the
 * collapsed-mobile main menu so the visual rhythm is consistent.
 */
@media (max-width: 768px) {
    .sub-nav {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================================================
 * Design-system primitives — see handbook/design_standards.md
 * ========================================================= */

/* ---- Status-color tokens (semantic variants) ----
 * Five semantic buckets every product's status vocabulary maps into.
 * Use via <span class="badge" data-variant="success">Delivered</span>,
 * or via a product-local status→variant CSS table for legacy
 * domain-specific data-status names. See design_standards.md §11.
 */
:root {
    --status-success:  #059669;
    --status-info:     #2563eb;
    --status-warning:  #d97706;
    --status-danger:   #dc2626;
    --status-neutral:  #6b7280;
}

/* ---- Badge (status pill) ---- */
.badge {
    display: inline-block;
    padding: 0.15em 0.5em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
    background: var(--status-neutral);
    color: #fff;
}
.badge[data-variant="success"]  { background: var(--status-success); }
.badge[data-variant="info"]     { background: var(--status-info); }
.badge[data-variant="warning"]  { background: var(--status-warning); }
.badge[data-variant="danger"]   { background: var(--status-danger); }
.badge[data-variant="neutral"]  { background: var(--status-neutral); }


/* ---- Buttons — 3 sizes (default via Pico, .btn-sm, .btn-xs) ----
 * See design_standards.md §2. Applies to both <button> and <a role="button">.
 * Does not touch color/variant — combine with Pico's `outline`,
 * `outline secondary`, `contrast` classes as needed.
 */
.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}
.btn-xs {
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    /* Pico applies a default margin-bottom to <button> that disrupts
     * inline table-row actions; reset it at the xs size where rows
     * routinely need tight vertical rhythm. */
    margin: 0;
}
a.btn-sm,
a.btn-xs {
    /* Links-as-buttons need text-decoration off and Pico's outline
     * border to match native buttons at these sizes. */
    text-decoration: none;
}

/* ---- Help text (muted captions, hints below form fields) ----
 * Sets font-size AND color. For inline muted text inside <small>, <span>,
 * or a line of body copy where you just want the color de-emphasis and
 * NOT a font-size change, use the .muted utility below instead.
 */
.help-text {
    font-size: 0.8rem;
    color: var(--pico-muted-color);
    line-height: 1.4;
}

/* ---- Muted color only (no font-size change) ---- */
.muted {
    color: var(--pico-muted-color);
}

/* ---- Empty state (list panels with no items yet) ---- */
.empty-state {
    padding: 2rem 0;
    text-align: center;
    color: var(--pico-muted-color);
}
.empty-state > p:first-child {
    margin-bottom: 1rem;
}

/* ---- Table default spacing (tighter than Pico default) ----
 * Global — applies to every <table> on every product. Compact variant
 * below for high-row-count auxiliary tables.
 */
table td,
table th {
    padding: 0.5rem 0.75rem;
}
.table-compact td,
.table-compact th {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

/* ---- Dialog default + wide variant ---- */
dialog article {
    max-width: 500px;
}
dialog.dialog-wide article {
    max-width: 800px;
}

/* ---- SortableJS ghost placeholder (drag-and-drop lists) ---- */
.sortable-ghost {
    opacity: 0.4;
}

/* ---- Sort card shell — horizontal card for SortableJS lists ----
 * Three-zone row: drag handle + body + actions. The canonical simple
 * pattern — products extend with their own body content (titles, tags,
 * metadata). For expandable/collapsible cards (Collate's work-card
 * uses <details>), design a product-local extension; this shell is for
 * the single-row case.
 * See design_standards.md §13.
 */
.sort-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--pico-card-background-color);
    padding: 0.75rem;
    border-radius: var(--pico-border-radius);
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.sort-card:last-child {
    margin-bottom: 0;
}

.sort-card-handle {
    cursor: grab;
    color: var(--pico-muted-color);
    font-size: 1.2rem;
    line-height: 1;
    user-select: none;
    flex-shrink: 0;
}
.sort-card-handle:hover {
    color: var(--pico-color);
}

.sort-card-body {
    flex: 1;
    min-width: 0;
}

.sort-card-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* ---- Inline row — flex container for aligned controls ----
 * Horizontal strip of <input>/<select>/<button>/<label>/<span> aligned on
 * a baseline, with no margin-bottom cascading from Pico's form element
 * defaults. Replaces the brittle attribute-selector hack in Convene's
 * local style.css. See design_standards.md §12.
 *
 * Variants: add .inline-row--end (align-items: flex-end) for rows whose
 * controls have labels above them, or .inline-row--stretch (stretch)
 * for fill-height rows.
 */
.inline-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-block: 0.75rem;
}
.inline-row--end {
    align-items: flex-end;
}
.inline-row--stretch {
    align-items: stretch;
}
.inline-row > input,
.inline-row > select,
.inline-row > button,
.inline-row > label,
.inline-row > [role="button"] {
    margin-bottom: 0;
}

/* ---- Toast container + toast (narratory.showAlert) ---- */
.narratory-toast-stack {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10000;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 2.5rem));
}
.narratory-toast {
    pointer-events: auto;
    padding: 0.75rem 1rem;
    border-radius: var(--pico-border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    font-size: 0.9rem;
    line-height: 1.35;
    background: #333;
    color: #fff;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 180ms ease-out, transform 180ms ease-out;
}
.narratory-toast.visible {
    opacity: 1;
    transform: translateY(0);
}
.narratory-toast.success {
    background: #1f7a3a;
}
.narratory-toast.error {
    background: #9a2a2a;
}
.narratory-toast.info {
    background: #2a5a9a;
}

/* ---- Connect — cross-product Connections home (Connect_standards.md §9) ----
 * Shared so the panel renders identically in every product's Ordavant section.
 * Replaces inline styles in each product's dashboard Connect JS. */
.connect-card {
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}
.connect-card.current {
    border-color: var(--pico-primary);
}
.connect-card-title {
    margin: 0 0 0.5rem;
}
.connect-card fieldset {
    margin: 0 0 0.5rem;
}
.connect-cap {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.connect-cap > input {
    margin: 0.2rem 0 0;
    flex-shrink: 0;
}
.connect-cap-status {
    margin-left: auto;
    padding-left: 0.5rem;
    font-size: 0.8rem;
    color: var(--status-success);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}
.connect-cap-status.saved {
    opacity: 1;
}
.connect-section-head {
    font-weight: 600;
    margin: 0.75rem 0 0.5rem;
}

/* Open Beta pill — used in every product's base.html wordmark. */
.admin-sidebar-header .wordmark { text-transform: none; font-size: 1.15rem; letter-spacing: .02em; color: inherit; }

.beta-pill {
    font-size: 0.5rem;
    vertical-align: top;
    position: relative;
    top: -0.15em;
    background: #f0c040;
    color: #333;
    padding: 0.1em 0.35em;
    border-radius: 2px;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-left: 0.2rem;
}
