/* ============================================================================
   CATCHME CRM — THEME FAMILY CONTROL
   ----------------------------------------------------------------------------
   Header control that switches between Theme 1 (classic) and Theme 2. Loaded
   for every family; the control itself keeps the shared topbar geometry.
   ============================================================================ */

.app-theme-family-toggle {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 0 10px;
    border: 1px solid var(--cm-border);
    border-radius: 10.4px;
    background: var(--cm-surface);
    color: var(--cm-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.app-theme-family-toggle i {
    font-size: 18px;
}

.app-theme-family-toggle:hover {
    background: var(--cm-bg);
}

.app-theme-family-toggle:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 3px;
}

.app-theme-family-menu {
    min-width: 220px;
    padding: 6px;
}

.app-theme-family-menu-title {
    padding: 6px 10px 8px;
    color: var(--cm-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-theme-family-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--cm-text);
    text-align: left;
}

.app-theme-family-option + .app-theme-family-option {
    margin-top: 2px;
}

.app-theme-family-option .app-theme-family-check {
    width: 18px;
    min-width: 18px;
    color: transparent;
    font-size: 16px;
}

.app-theme-family-option .app-theme-family-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.app-theme-family-option .app-theme-family-copy b {
    font-size: 13px;
    font-weight: 700;
}

.app-theme-family-option .app-theme-family-copy small {
    color: var(--cm-muted);
    font-size: 11px;
}

.app-theme-family-option:hover,
.app-theme-family-option:focus-visible {
    background: var(--cm-bg);
    outline: none;
}

.app-theme-family-option.is-active {
    background: color-mix(in srgb, var(--cm-primary) 10%, transparent);
    color: var(--cm-primary);
}

.app-theme-family-option.is-active .app-theme-family-check {
    color: var(--cm-primary);
}

.app-theme-family-option.is-active .app-theme-family-copy small {
    color: inherit;
    opacity: 0.75;
}

/* Theme 2 keeps the switcher in the Topbar language (translucent, rounded). */
html[data-cm-theme="theme-2"] .app-theme-family-toggle {
    border-color: var(--t2-border);
    border-radius: var(--t2-radius-sm);
    background: var(--t2-surface);
    color: var(--t2-text);
}

html[data-cm-theme="theme-2"] .app-theme-family-toggle:hover {
    border-color: var(--t2-border-2);
    background: var(--t2-surface-2);
}

html[data-cm-theme="theme-2"] .app-theme-family-option.is-active {
    background: var(--t2-selected-bg);
    color: var(--t2-selected-text);
}

/* The night-mode toggle inherits the same Theme 2 geometry. */
html[data-cm-theme="theme-2"] .app-theme-toggle {
    border-color: var(--t2-border);
    border-radius: var(--t2-radius-sm);
    background: var(--t2-surface);
    color: var(--t2-text);
}

html[data-cm-theme="theme-2"] .app-theme-toggle:hover {
    background: var(--t2-surface-2);
}

html[data-cm-theme="theme-2"] .app-theme-toggle[aria-pressed="true"] {
    background: var(--t2-selected-bg);
    color: var(--t2-selected-text);
    border-color: var(--t2-selected-border);
}

@media (max-width: 575.98px) {
    .app-theme-family-toggle .app-theme-family-label {
        display: none;
    }
}
