/* ===== rc_header_html (HTML form, scoped) =====
   Loaded eagerly from anvil.yaml native_deps.head_html. Anvil strips a template's <style> text, so
   these rules cannot live in form_template.html.

   .rc-header is the form root and is already private: it is declared nowhere else in the app, so it
   is kept as the root class rather than a private one being added beside a shared one. The root rule
   stays a BARE class so it outranks the scoped descendant rules; every other rule is scoped
   :where(.rc-header), which adds no specificity and so cannot change which rule wins.

   No second class is needed anywhere in this file.

   DESIGNER LIMIT, as recorded in rc_lateness_html.css: this asset styles the canvas, but the --px-*
   colour tokens are injected at runtime by the dependency's ensure_theme_injected(), so the canvas
   shows this layout with unresolved colours. Runtime is unaffected. */

.rc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--px-border);
}

:where(.rc-header) .rc-title-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

:where(.rc-header) .rc-title {
    font-family: var(--px-font-display);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--px-text-primary) 0%, var(--px-chart-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

:where(.rc-header) .rc-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

:where(.rc-header) .rc-view-toggle {
    display: flex;
    background: var(--px-bg-elevated);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--px-border);
}

:where(.rc-header) .rc-toggle-btn {
    font-family: var(--px-font-display);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--px-text-muted);
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

:where(.rc-header) .rc-toggle-btn:hover {
    color: var(--px-text-secondary);
}

:where(.rc-header) .rc-toggle-btn.active {
    background: var(--px-chart-cyan);
    color: var(--px-chart-btn-text);
    box-shadow: 0 2px 8px rgba(8,145,178,0.3);
}

:where(.rc-header) .rc-date-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--px-chart-input-bg);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--px-border);
}

:where(.rc-header) .rc-date-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--px-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 0.5rem;
    white-space: nowrap;
}

:where(.rc-header) .rc-date-input {
    font-family: 'Space Mono', monospace;
    font-size: 0.875rem;
    padding: 0.625rem 0.75rem;
    background: var(--px-bg-card);
    border: 1px solid var(--px-border);
    border-radius: 8px;
    color: var(--px-text-primary);
    outline: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    min-width: 140px;
    width: auto;
}

:where(.rc-header) .rc-date-input:focus {
    border-color: var(--px-chart-cyan);
    outline: 2px solid var(--px-focus-ring);
    outline-offset: 1px;
}

:where(.rc-header) .rc-date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

:where(.rc-header) .rc-date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .rc-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    :where(.rc-header) .rc-title-block {
        justify-content: space-between;
        width: 100%;
    }

    :where(.rc-header) .rc-controls {
        flex-direction: column;
        width: 100%;
    }

    :where(.rc-header) .rc-view-toggle {
        width: 100%;
        justify-content: center;
    }

    :where(.rc-header) .rc-date-group {
        width: 100%;
    }

    :where(.rc-header) .rc-date-input {
        flex: 1;
    }
}
