/* Shared type, chrome, and controls. Global on purpose so every page can use them. */

.compyl-page-title,
.heading h1 {
    font-family: var(--font-family-title), "Poppins", sans-serif;
    font-size: 32px;
    font-weight: 300;
    line-height: 32px;
    letter-spacing: -0.24px;
    color: var(--body-text);
    margin: 0 0 0.25rem;
}

.compyl-h3-text {
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.75rem;
    margin: 0;
}

.compyl-h4-text {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.75rem;
    margin: 0;
}

.compyl-body-text {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.5rem;
    margin: 0;
}

.compyl-small-text {
    font-size: 0.875rem;
    font-weight: 300;
    line-height: 1.25rem;
    margin: 0;
}

.compyl-tiny-text {
    font-size: 0.75rem;
    font-weight: 300;
    line-height: 1rem;
    margin: 0;
}

.compyl-text-muted {
    color: var(--text-muted);
    margin: 0;
}

.compyl-text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.summary,
.status,
.allow-list-note,
.note,
.links {
    margin: 0;
    color: var(--text-muted);
    font-weight: 300;
}

.allow-list-note {
    font-size: 0.875rem;
}

.status.error {
    color: var(--error);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1rem;
    align-items: end;
}

.filters label,
.lookup label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 14rem;
    color: var(--body-text);
    font-size: 0.875rem;
    font-weight: 400;
}

.hub-card {
    background: var(--surface-low);
    border-radius: 0.625rem;
    border: 1px solid color-mix(in srgb, var(--border-primary) var(--thin-border), transparent);
    box-shadow: var(--surface-raised-shadow);
}

.hub-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex: 1 1 auto;
    min-width: 0;
}

.hub-filter-card {
    display: flex;
    flex: 1 1 8rem;
    max-width: 12rem;
    height: 6.32rem;
    padding: 0.75rem 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.625rem;
    border: 1px solid color-mix(in srgb, var(--border-primary) var(--thin-border), transparent);
    background-color: var(--surface-low);
    color: var(--body-text);
    font-family: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.hub-filter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.hub-filter-card.active::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--filter-overlay-color, var(--action));
    opacity: 0.15;
    pointer-events: none;
}

.hub-filter-card .filter-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hub-filter-card .filter-header {
    display: flex;
    width: 100%;
    padding: 0 1rem;
    justify-content: flex-start;
    align-items: center;
}

.hub-filter-card .filter-blip {
    width: 0.75rem;
    height: 0.75rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--filter-overlay-color, var(--action));
}

.hub-filter-card .filter-count {
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 2rem;
    color: var(--body-text);
    font-variant-numeric: tabular-nums;
}

.hub-filter-card .filter-label {
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1rem;
    color: var(--text-muted);
}

.hub-filter-card.tone-action {
    --filter-overlay-color: var(--action);
}

.hub-filter-card.tone-action.active {
    border-color: var(--action);
}

.hub-filter-card.tone-warning {
    --filter-overlay-color: var(--warning);
}

.hub-filter-card.tone-warning.active {
    border-color: var(--warning);
}

.hub-filter-card.tone-info {
    --filter-overlay-color: var(--info);
}

.hub-filter-card.tone-info.active {
    border-color: var(--info);
}

.hub-chip,
.chip,
.state,
.approx,
.marker {
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--border-primary);
    background: var(--fill-neutral);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25rem;
    white-space: nowrap;
}

.hub-chip-success,
.chip-succeeded,
.chip-completed,
.state-done {
    background: var(--fill-success);
    border-color: var(--border-success);
    color: var(--success-text);
}

.hub-chip-warning,
.chip-threads {
    background: var(--fill-warning);
    border-color: var(--border-warning);
    color: var(--warning-text);
}

.hub-chip-error,
.chip-failed,
.chip-warning,
.state-removed {
    background: var(--fill-error);
    border-color: var(--error);
    color: var(--error-text);
}

.hub-chip-info,
.chip-draft,
.state-open,
.marker {
    background: var(--info-translucent);
    border-color: var(--info);
    color: var(--info-text);
}

.hub-chip-neutral,
.chip-missed,
.chip-abandoned,
.chip-threads-resolved,
.approx {
    background: var(--fill-neutral);
    border-color: var(--border-primary);
    color: var(--text-secondary);
}

.hub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--body-text);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.25rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hub-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.hub-btn-primary {
    background: var(--action);
    border-color: var(--action);
    color: var(--button-text);
}

.hub-btn-primary:hover:not(:disabled) {
    background: var(--action-hover);
    border-color: var(--action-hover);
    color: var(--button-text);
}

.hub-btn-secondary {
    background: transparent;
    border-color: var(--border-primary);
    color: var(--body-text);
}

.hub-btn-secondary:hover:not(:disabled) {
    background: var(--segmented-hover);
    color: var(--body-text);
}

.hub-btn-tertiary {
    border-color: transparent;
    padding-inline: 0.5rem;
}

.hub-btn-tertiary:hover:not(:disabled) {
    background: rgba(var(--brand-tint-rgb), 0.1);
    color: var(--body-text);
}

.search,
.hub-search {
    min-width: 16rem;
    max-width: 100%;
    height: 2.5rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-primary);
    border-radius: 1.5rem;
    background: var(--body);
    color: var(--body-text);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 300;
}

.search:focus,
.hub-search:focus {
    outline: none;
    border-color: var(--action);
    box-shadow: 0 0 0 0.125rem color-mix(in srgb, var(--action) 25%, transparent);
}

.hub-table {
    width: 100%;
    border-collapse: collapse;
}

.hub-table th,
.hub-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-secondary);
    text-align: left;
    vertical-align: top;
}

.hub-table thead th {
    background: var(--surface-raised);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.hub-table tbody tr:hover {
    background: var(--row-hover);
}

.hub-table tbody tr:last-child td,
.hub-table tbody tr:last-child th {
    border-bottom: 0;
}

.hub-icon-box {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--surface-raised);
    box-shadow: var(--surface-raised-shadow);
    color: var(--text-muted);
}

.hub-icon-box .material-icons {
    font-size: 1.125rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.theme-toggle .icon-when-dark {
    display: none;
}

.theme-dark .theme-toggle .icon-when-light {
    display: none;
}

.theme-dark .theme-toggle .icon-when-dark {
    display: inline-flex;
}

/* The menu checkbox lives outside NavMenu, so this rule stays global. */
.nav-scrollable {
    display: none;
}

.navbar-toggler:checked ~ .nav-scrollable {
    display: block;
}

@media (min-width: 641px) {
    .nav-scrollable {
        display: block;
        height: 100%;
        overflow-y: auto;
    }
}
