/* ── Hub pages (Command Center home, Settings & Configuration) ──
   A quiet header followed by grouped, compact action tiles. Tokens fall
   back to the theme so the same styles work inside and outside the
   command-center shell. */

.orch-home {
    --orch-ink: var(--oc-cc-ink, var(--text-primary, #1f2937));
    --orch-muted: var(--oc-cc-muted, var(--text-light, #64748b));
    --orch-line: var(--border-color, #e2e8f0);
    --orch-surface: var(--card-background, #ffffff);
    --orch-accent: var(--primary-color, #2563eb);
    --orch-radius: var(--radius-md, 10px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 16px 32px;
    color: var(--orch-ink);
}

@media (prefers-reduced-motion: no-preference) {
    .orch-home {
        animation: orch-home-enter 0.25s ease-out both;
    }
}

@keyframes orch-home-enter {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ── Header ── */
.orch-home__header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--orch-line);
}

.orch-home__logo {
    width: clamp(170px, 16vw, 210px);
    height: auto;
    max-height: 63px;
    flex-shrink: 0;
    object-fit: contain;
    padding-inline-end: 20px;
    border-inline-end: 1px solid var(--orch-line);
}

.orch-home__header-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.orch-home__header-actions {
    flex: 0 0 auto;
    margin-inline-start: auto;
}

.orch-home__eyebrow {
    margin: 0 0 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--orch-muted);
}

.orch-home__eyebrow-sep {
    margin-inline: 6px;
    opacity: 0.6;
}

.orch-home__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--orch-ink);
}

.orch-home__title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: var(--orch-radius);
    background: color-mix(in srgb, var(--orch-accent) 10%, transparent);
    color: var(--orch-accent);
    font-size: 1.1rem;
}

/* ── Sections ── */
.orch-section {
    margin-top: 24px;
}

.orch-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--orch-muted);
}

.orch-section__title::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--orch-line);
}

/* ── Tile grid ── */
.orch-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

/* Keep the Bootstrap .card hook for template compatibility, restyle fully
   (the shell's global .card padding/margin would otherwise inflate tiles). */
.card.orch-card {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 1px solid var(--orch-line);
    border-radius: var(--orch-radius);
    background: var(--orch-surface);
    box-shadow: var(--shadow-xs, 0 1px 2px rgba(15, 23, 42, 0.04));
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.card.orch-card:hover,
.card.orch-card:focus-within {
    border-color: color-mix(in srgb, var(--orch-accent) 45%, var(--orch-line));
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.07));
}

@media (prefers-reduced-motion: no-preference) {
    .card.orch-card:hover {
        transform: translateY(-1px);
    }
}

.card.orch-card>a {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    min-height: 68px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--orch-ink);
    border-radius: var(--orch-radius);
}

/* Visible keyboard focus ring */
.card.orch-card>a:focus-visible {
    outline: 2px solid var(--orch-accent);
    outline-offset: 2px;
}

/* Icon chip: the icon's own color utility (text-primary, text-success, …)
   tints its background, so each tile keeps its category color. */
.orch-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: var(--radius-sm, 8px);
    background: color-mix(in srgb, currentColor 11%, transparent);
    font-size: 1.05rem;
}

.orch-card__label {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.orch-card__arrow {
    margin-inline-start: auto;
    font-size: 0.85rem;
    color: var(--orch-muted);
    opacity: 0.35;
    transition: opacity 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

[dir="rtl"] .orch-card__arrow {
    transform: scaleX(-1);
}

.card.orch-card:hover .orch-card__arrow,
.card.orch-card:focus-within .orch-card__arrow {
    opacity: 1;
    color: var(--orch-accent);
}

/* ── Responsive ── */
@media (max-width: 576px) {
    .orch-home {
        padding-inline: 4px;
    }

    .orch-home__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .orch-home__logo {
        width: 170px;
        padding-inline-end: 0;
        border-inline-end: 0;
    }

    .orch-home__header-actions {
        margin-inline-start: 0;
    }

    .orch-tile-grid {
        grid-template-columns: 1fr;
    }

    .orch-home__title {
        font-size: 1.3rem;
    }
}
