/* Backward-compatible variables for legacy markup.
   The active component styles are compiled from app.css.
   Palette comes exclusively from app.css; no second theme or button override. */
:root {
    --primary-from-override: var(--ui-primary);
    --primary-to-override: var(--ui-primary);
}

input[type="file"]::file-selector-button {
    min-height: 40px;
    margin-right: 0.75rem;
    border: 0;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--ui-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    background: var(--ui-primary-hover);
}

/*
 * Compatibility layer for Razor views that still use legacy Tailwind utility
 * groups. app.css/ui-* remains the component contract; these scoped rules make
 * legacy screens follow the same typography, form, card and table treatment
 * while their markup is migrated in small, reviewable batches.
 */
.ui-page-surface {
    color: var(--ui-text);
}

.ui-page-surface h1 {
    color: var(--ui-primary-hover);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 2rem;
    letter-spacing: -0.025em;
}

.ui-page-surface h2 {
    color: var(--ui-primary-hover);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.75rem;
    letter-spacing: -0.015em;
}

.ui-page-surface h3 {
    color: #111827;
}

.ui-page-surface label:not(.sr-only, .ui-btn, .ui-delete-noscript label) {
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
}

.ui-page-surface input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.ui-page-surface select,
.ui-page-surface textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    color: #0f172a;
    font-size: 0.875rem;
    line-height: 1.25rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
}

.ui-page-surface input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):hover,
.ui-page-surface select:hover,
.ui-page-surface textarea:hover {
    border-color: #94a3b8;
}

.ui-page-surface input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):focus,
.ui-page-surface select:focus,
.ui-page-surface textarea:focus {
    border-color: var(--ui-focus);
    outline: 2px solid transparent;
    box-shadow: 0 0 0 2px var(--ui-focus);
}

.ui-page-surface textarea {
    min-height: 7rem;
    resize: vertical;
}

.ui-page-surface :is(div, section, article)[class~="bg-white"][class~="border"][class*="shadow"] {
    border-color: #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
}

.ui-page-surface table:not(.ui-table) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    color: #374151;
    font-size: 0.875rem;
}

.ui-page-surface table:not(.ui-table) thead {
    background: #f8fafc;
}

.ui-page-surface table:not(.ui-table) th {
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1rem;
    text-transform: uppercase;
}

.ui-page-surface table:not(.ui-table) td {
    border-bottom-color: #f1f5f9;
    color: #374151;
    font-size: 0.875rem;
}

.ui-page-surface table:not(.ui-table) tbody tr {
    transition: background-color 150ms ease;
}

.ui-page-surface table:not(.ui-table) tbody tr:hover {
    background: #f8fafc;
}

@media (max-width: 639px) {
    .ui-page-surface input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
    .ui-page-surface select {
        min-height: 44px;
    }
}
