/* UA Backend HQ   Components v2 */
/* Replaces site.css (original ref above) */

/* ===== Shared Variables ===== */
:root {
    --lift-translate: translateY(-2px);
}

/* ===== Glass Surface ===== */
.glass-card {
    background: var(--glass-surface);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2), var(--shadow-ambient);
    padding: clamp(var(--space-5), 2vw, var(--space-8));
    transition: transform var(--duration-base) var(--ease-standard), background-color var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard);
    will-change: transform;
}

    .glass-card:hover {
        background: var(--glass-surface-hover);
        transform: var(--lift-translate);
        box-shadow: var(--shadow-3), var(--shadow-ambient);
    }

    .glass-card:focus-within {
        outline: 0;
        box-shadow: var(--shadow-3), 0 0 0 3px var(--glass-ring);
    }


.insetui {
    margin-left: 1rem;
    margin-right: 1rem;
}

/* Button styles moved to buttons.css */

/* ===== Inputs ===== */
.input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--glass-surface);
    color: var(--color-text);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    transition: border-color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}

    .input::placeholder {
        color: var(--color-text-subtle);
    }

    .input:focus {
        outline: none;
        border-color: var(--accent);
        background: var(--glass-surface-hover);
        box-shadow: 0 0 0 3px rgba(227,25,55,0.12);
    }

/* Form bits */
.form-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: rgba(255,255,255,0.82);
}

.form-error {
    font-size: var(--text-sm);
    color: var(--error);
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.28);
    border-radius: var(--radius-md);
}

/* ===== Layout: Dashboard ===== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 248px 1fr;
    height: 100vh;
    overflow: clip; /* Use clip instead of hidden - doesn't break sticky */
    position: relative;
    z-index: 1;
}

.dashboard-layout.with-preview {
    grid-template-columns: 248px 1fr auto;
}


.main-content {
    user-select:none;
    padding: 0;
    padding-top:0;
    /* Make main-content the scroll container for sticky to work */
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0; /* Prevent grid children from overflowing in dashboard-layout grid */
}

/* ===== Navbar ===== */
.navbar {
    --navbar-height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: var(--navbar-height);
    background: linear-gradient(180deg, var(--color-surface) 0%, rgba(var(--color-surface-rgb, 26, 26, 26), 0.95) 100%);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    border-bottom: 1px solid var(--glass-border);
    padding: var(--space-3) clamp(var(--space-4), 3vw, var(--space-8));
    padding-left: 1.0rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: 1rem;
}

/* Navbar actions container */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

/* Form control buttons in navbar */
.navbar-form-controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-left: var(--space-4);
    border-left: 1px solid var(--glass-border);
    margin-left: var(--space-2);
}

/* ===== Badge ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .4ch;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: .03em;
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    color: var(--color-text);
}

.badge-success {
    background: color-mix(in oklab, var(--success), transparent 80%);
    border-color: var(--success);
    color: var(--success);
}

.badge-error {
    background: color-mix(in oklab, var(--error), transparent 80%);
    border-color: var(--error);
    color: var(--error);
}

.badge-warning {
    background: color-mix(in oklab, var(--warning), transparent 82%);
    border-color: var(--warning);
    color: var(--warning);
}

.badge-info {
    background: color-mix(in oklab, var(--info), transparent 82%);
    border-color: var(--info);
    color: var(--info);
}

.badge-muted {
    background: rgba(107, 114, 128, 0.15);
    border-color: rgba(107, 114, 128, 0.4);
    color: #9ca3af;
}

.badge-purple {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    color: #a78bfa;
}

/* ===== Unified Entity Card System ===== */
/* Base class for all lister item cards (stores, zones, displays, devices, etc.) */
.entity-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.card-subtitle {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.card-code {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.6875rem;
    color: var(--color-text-subtle);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    width: fit-content;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.card-badges {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--color-text-subtle);
}

.card-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    line-height: 1.3;
}

.card-meta-label {
    color: var(--color-text-subtle);
}

.card-meta-value {
    color: var(--color-text-muted);
}

.card-footer {
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: var(--color-text-subtle);
}

.card-description {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Entity card with color indicator (for zones) */
.card-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

/* Card header with color dot */
.card-header-with-dot {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.card-header-with-dot .card-color-dot {
    margin-top: 0.25rem;
}

/* ===== Status Badge (unified version) ===== */
/* Use .badge with modifiers instead of separate .status-badge classes */
.badge-sm {
    font-size: 0.625rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-active {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.badge-inactive {
    background: rgba(107, 114, 128, 0.15);
    border-color: rgba(107, 114, 128, 0.4);
    color: #9ca3af;
}

.badge-pending {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fbbf24;
}

.badge-approved {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

/* ===== Spinner ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.24);
    border-top-color: var(--accent-contrast);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Common Page States ===== */
/* Reusable loading, error, and empty states for all pages */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1.25rem;
    text-align: center;
}

.loading-state .loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-state p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 450px;
    margin: 2rem auto;
}

.error-state .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.error-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--error);
    margin: 0 0 0.75rem 0;
}

.error-state p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--color-text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    font-size: 0.875rem;
    margin: 0;
    max-width: 300px;
}

/* ===== Responsive ===== */
/* Sidebar responsive styles moved to Sidebar.razor.css */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 220px 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: var(--space-8);
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Focus Rings (unified) ===== */
:where(.glass-card, .btn, .input, .navbar, .badge):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 8px;
}

/* ===== Density Helpers ===== */
.stack-tight > * + * {
    margin-block-start: var(--space-2);
}

.stack > * + * {
    margin-block-start: var(--space-3);
}

.stack-loose > * + * {
    margin-block-start: var(--space-5);
}

/* ===== Blazor Error UI ===== */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Blazor error boundary */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);    
}

/* Fixed column counts */
.stats-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.stats-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.stats-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }
.stats-grid.columns-5 { grid-template-columns: repeat(5, 1fr); }
.stats-grid.columns-6 { grid-template-columns: repeat(6, 1fr); }
.stats-grid.columns-8 { grid-template-columns: repeat(8, 1fr); }

/* Compact mode */
.stats-grid.compact {
    gap: var(--space-3);
}

@media (min-width: 1200px) {
    .stats-grid:not([class*="columns-"]) {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .stats-grid:not([class*="columns-"]) {
        grid-template-columns: repeat(3, 1fr);
    }
    .stats-grid.columns-4,
    .stats-grid.columns-5,
    .stats-grid.columns-6,
    .stats-grid.columns-8 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .stats-grid,
    .stats-grid[class*="columns-"] {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Actions Grid (Quick Actions) */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    gap: var(--space-3);
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--color-text);
    transition: transform var(--duration-base) var(--ease-standard), background var(--duration-base) var(--ease-standard);
}

.action-card:hover {
    transform: translateY(-2px);
    background: var(--glass-surface);
}

.action-card svg {
    width: 32px;
    height: 32px;
}

.action-card span {
    font-size: var(--text-sm);
    font-weight: 600;
}

.entity-form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.entity-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6) var(--space-8);
    background: linear-gradient(135deg, var(--glass-surface) 0%, transparent 100%);
    border-bottom: 1px solid var(--glass-border);
}

.entity-form-title h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.entity-form-content {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    height: auto;
    gap: var(--space-2);
}

.entity-form-sections {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.entity-form-section {
    background: linear-gradient(135deg, var(--glass-surface) 0%, transparent 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    isolation: isolate;
    scroll-margin-top: var(--space-5);
}

.entity-form-section.collapsed .section-fields {
    display: none;
}

.section-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    padding: var(--space-6);
}

.entity-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5) var(--space-8);
    border-top: 1px solid var(--glass-border);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%);
}

.footer-left, .footer-right {
    display: flex;
    gap: var(--space-3);
}

/* Form Fields */
.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0; /* Allow shrinking in grid */
}

.form-field-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
}

.required-marker {
    color: var(--error);
    font-weight: 700;
}

/* Modern Inputs */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    font-family: inherit;
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: all var(--duration-base) var(--ease-standard);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-subtle);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px var(--glass-ring);
}

.form-input:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled),
.form-textarea:hover:not(:focus):not(:disabled) {
    border-color: var(--glass-border);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background: rgba(0, 0, 0, 0.15);
    color: var(--color-text-subtle);
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
}

.form-input.form-readonly {
    background: rgba(0, 0, 0, 0.15);
    color: var(--color-text);
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    padding-right: 44px;
    cursor: pointer;
}

/* Dark mode dropdown options - applies to all selects */
select option,
.form-select option,
.filter-select option,
.vpe-select option {
    background: var(--gray-850, #1a1a2e);
    color: var(--color-text, #fff);
    padding: var(--space-2);
}

/* Ensure native select elements have dark background in dark mode */
select {
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--color-text, #fff);
}

/* Modern Checkbox */
.form-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-standard);
    position: relative;
}

.form-checkbox:checked {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-color: transparent;
}

.form-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid var(--accent-contrast);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Modern Switch */
.form-switch {
    position: relative;
    width: 52px;
    height: 28px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--glass-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-slow) var(--ease-standard);
    border: none;
}

.form-switch:checked {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
}

.form-switch::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--ua-white);
    border-radius: var(--radius-full);
    transition: transform var(--duration-slow) var(--ease-standard);
    box-shadow: var(--shadow-2);
}

.form-switch:checked::before {
    transform: translateX(24px);
}

/* Toggle Wrapper */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    padding: var(--space-2) 0;
}

.toggle-label {
    font-size: var(--text-sm);
    color: var(--color-text);
    font-weight: 500;
}

/* Field Errors */
.form-field-error {
    font-size: var(--text-sm);
    color: var(--error);
}

.form-field-help {
    font-size: var(--text-sm);
    color: var(--color-text-subtle);
}

/* View Mode Values */
.form-value {
    padding: var(--space-3) 0;
    font-size: var(--text-base);
    color: var(--color-text);
    min-height: 24px;
    line-height: 1.5;
    user-select: text;
    cursor: text;
}

.form-value-empty {
    color: var(--color-text-subtle);
    font-style: italic;
}

/* ===== Image Field and Gallery ===== */
.image-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.image-preview {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-3);
    width: 100%;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    transition: all var(--duration-base) var(--ease-standard);
    position: relative;
    display: block;
    cursor: pointer;
    text-decoration: none;
}

.gallery-item:hover {
    border-color: var(--glass-border);
    transform: scale(1.03);
    box-shadow: var(--shadow-3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--duration-base) var(--ease-standard);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-expand-icon {
    font-size: var(--text-2xl);
}

.gallery-empty {
    padding: var(--space-5);
    text-align: center;
    color: var(--color-text-subtle);
    font-size: var(--text-sm);
    grid-column: 1 / -1;
}

/* ===== Collection Tags ===== */
.collection-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.collection-tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    background: color-mix(in oklab, var(--info), transparent 85%);
    border: 1px solid color-mix(in oklab, var(--info), transparent 70%);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--info);
}

.collection-empty {
    color: var(--color-text-subtle);
    font-size: var(--text-sm);
    font-style: italic;
}

/* ===== Tags Input (FormTagsInput component) ===== */
.tags-input-wrapper {
    width: 100%;
}

.tags-input-wrapper.has-error .tags-container {
    border-color: var(--error);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: var(--space-2) var(--space-3);
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tags-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(204, 163, 128, 0.1);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: color-mix(in oklab, var(--info), transparent 85%);
    border: 1px solid color-mix(in oklab, var(--info), transparent 70%);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--info);
    white-space: nowrap;
}

.tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 50%;
    font-size: var(--text-sm);
    color: var(--info);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.tag-remove:hover {
    background: color-mix(in oklab, var(--info), transparent 60%);
    color: var(--color-text);
}

.tags-input {
    flex: 1;
    min-width: 80px;
    padding: var(--space-1) 0;
    background: none;
    border: none;
    outline: none;
    font-size: var(--text-base);
    color: var(--color-text);
}

.tags-input::placeholder {
    color: var(--color-text-subtle);
}

/* ===== Collection Table (Complex Objects) ===== */
.collection-table {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.collection-summary {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    padding: var(--space-2) 0;
}

.collection-preview {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.collection-preview-item {
    padding: var(--space-3) var(--space-4);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.collection-more {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text-subtle);
    text-align: center;
}

.sync-message {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

.sync-message.success {
    background: color-mix(in oklab, var(--success), transparent 85%);
    border: 1px solid color-mix(in oklab, var(--success), transparent 70%);
    color: var(--success);
}

.sync-message.error {
    background: color-mix(in oklab, var(--error), transparent 85%);
    border: 1px solid color-mix(in oklab, var(--error), transparent 70%);
    color: var(--error);
}

.price-cell {
    font-variant-numeric: tabular-nums;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.in-stock {
    background: color-mix(in oklab, var(--success), transparent 85%);
    color: var(--success);
}

.status-badge.low-stock {
    background: color-mix(in oklab, var(--warning), transparent 85%);
    color: var(--warning);
}

.status-badge.out-of-stock {
    background: color-mix(in oklab, var(--error), transparent 85%);
    color: var(--error);
}

.status-badge.inactive {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-subtle);
}

/* ===== Dictionary Field ===== */
.dictionary-field {
    width: 100%;
}

.dictionary-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.dictionary-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

.dict-key {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    min-width: 120px;
    flex-shrink: 0;
}

.dict-value {
    font-size: var(--text-sm);
    color: var(--color-text);
    word-break: break-word;
}

.dictionary-empty {
    color: var(--color-text-subtle);
    font-size: var(--text-sm);
    font-style: italic;
    padding: var(--space-2) 0;
}

/* ===== Fix Textarea and Input Widths ===== */
.form-field-input-wrapper {
    width: 100%;
}

/* Number Input with Prefix/Suffix */
.number-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix,
.input-suffix {
    position: absolute;
    font-size: var(--text-base);
    color: var(--color-text-subtle);
    pointer-events: none;
    font-weight: 500;
    z-index: 1;
}

.input-prefix {
    left: var(--space-4);
}

.input-suffix {
    right: var(--space-4);
}

.form-input.has-prefix {
    padding-left: 36px;
}

.form-input.has-suffix {
    padding-right: 36px;
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.form-color-input {
    width: 48px;
    height: 48px;
    padding: var(--space-1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
}

.color-text-input {
    flex: 1;
}

/* HTML Field Toggle styles moved to EntityForm.razor.css */

/* HTML Content Renderer */
.form-html-content {
    padding: var(--space-4) var(--space-5);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--text-base);
    line-height: 1.6;
    min-height: 60px;
}

.form-html-content p {
    margin: 0 0 0.75em 0;
}

.form-html-content p:last-child {
    margin-bottom: 0;
}

.form-html-content ul,
.form-html-content ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.form-html-content li {
    margin-bottom: 0.25em;
}

.form-html-content h1, .form-html-content h2, .form-html-content h3,
.form-html-content h4, .form-html-content h5, .form-html-content h6 {
    margin: 0.5em 0;
    font-weight: 600;
}

.form-html-content a {
    color: var(--accent);
    text-decoration: underline;
}

.form-html-content a:hover {
    color: var(--accent-hover);
}

.form-html-content blockquote {
    border-left: 3px solid var(--glass-border);
    padding-left: 1em;
    margin: 0.5em 0;
    color: var(--color-text-muted);
}

.form-html-content pre,
.form-html-content code {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.form-html-content code {
    padding: 2px var(--space-2);
}

.form-html-content pre {
    padding: var(--space-3);
    overflow-x: auto;
}

.form-html-content pre code {
    padding: 0;
    background: none;
}

/* ===== Entity Multi-Selector ===== */
.entity-multi-selector {
    width: 100%;
}

.multi-selector-items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.multi-selector-item {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: #60a5fa;
}

.multi-selector-more {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ===== JSON Field ===== */
.json-field {
    width: 100%;
}

.json-content {
    padding: var(--space-3);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: #4ade80;
    overflow-x: auto;
    white-space: pre;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.json-editor {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

/* ===== Rich Text Field ===== */
.rich-text-field {
    width: 100%;
}

.html-source {
    padding: var(--space-3);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

/* ===== File Upload Field ===== */
.file-upload-field {
    width: 100%;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

.file-icon {
    font-size: var(--text-base);
}

.file-name {
    font-size: var(--text-sm);
    color: var(--color-text);
    word-break: break-all;
}

.file-upload-hint {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-style: italic;
}

/* ===== Section Tabs - Horizontal Sticky Navigation ===== */
.section-tabs {
    position: sticky;
    top: 86px; /* Offset for sticky navbar height */
    z-index: 90; /* Below navbar (100) */
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-4);

    background: linear-gradient(0deg, rgba(0,0,0,0) 0%, var(--color-surface) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius:0.5rem;
    margin-bottom: 1rem;
    margin-top: 0;
}

.section-tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0px 8px 6px 6px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-standard);
    white-space: nowrap;
}

.section-tab:hover {
    color: var(--color-text);
    background: var(--glass-surface);
    border-color: var(--glass-border);
}

.section-tab.active {
    color: var(--accent);
    background: var(--glass-ring);
    border-color: var(--accent);
}

.section-tab .tab-icon {
    font-size: var(--text-base);
}

.section-tab .tab-text {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-tab .tab-error-dot {
    width: 6px;
    height: 6px;
    background: var(--error);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* Hide old sidebar nav */
.section-nav {
    display: none;
}

.section-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.section-nav-item {
    margin: 0;
}

.section-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--duration-base) var(--ease-standard);
    position: relative;
    /* Button reset styles */
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.section-nav-link:hover {
    background: var(--glass-surface);
    color: var(--color-text);
}

.section-nav-item.active .section-nav-link {
    background: var(--glass-ring);
    color: var(--accent);
    border-left: 3px solid var(--accent);
    margin-left: -3px;
}

.nav-icon {
    font-size: var(--text-base);
    flex-shrink: 0;
}

.nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-error-dot {
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* Responsive - adjust nav on smaller screens */
@media (max-width: 1200px) {
    .entity-form-wrapper.has-nav {
        grid-template-columns: 180px 1fr;
    }

    .section-nav {
        width: auto;
    }

    .nav-text {
        font-size: var(--text-sm);
    }
}

@media (max-width: 1024px) {
    .entity-form-layout,
    .entity-form-wrapper.has-nav {
        grid-template-columns: 1fr;
    }

    .section-nav {
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: var(--space-4);
    }

    .section-nav-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .section-nav-link {
        padding: var(--space-2) var(--space-3);
    }

    .section-nav-item.active .section-nav-link {
        border-left: none;
        margin-left: 0;
        border-bottom: 2px solid var(--accent);
        margin-bottom: -2px;
    }
}

@media (max-width: 768px) {
    .section-nav {
        display: none;
    }
}

/* ===== Section Header Styling ===== */
.section-header {
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-5);
    background: linear-gradient(135deg, var(--glass-surface) 0%, transparent 100%);
}

.section-header.collapsible {
    cursor: pointer;
    transition: background var(--duration-base) var(--ease-standard);
}

.section-header.collapsible:hover {
    background: linear-gradient(135deg, var(--glass-surface-hover) 0%, var(--glass-surface) 100%);
}

.section-icon {
    font-size: var(--text-lg);
    flex-shrink: 0;
}

.section-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    flex: 1;
}

/* ===== Page Header Title/Subtitle (Navbar) ===== */
.page-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin: 0;
    color: var(--color-text);
}

.page-subtitle {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight:200;
    margin: 0;
}

/* ===== Store Selector Section (Consolidated) ===== */
.store-selector-section {
    margin-bottom: var(--space-4);
}

.store-selector-card {
    padding: var(--space-2) var(--space-4);
}

.store-selector-compact {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
}

.store-selector-compact .store-selector {
    min-width: 200px;
}

.section-description {
    font-size: var(--text-xs);
    color: var(--color-text-subtle);
    margin: 0;
}

.section-collapse-icon {
    color: var(--color-text-subtle);
    font-size: var(--text-xs);
    transition: transform var(--duration-base) var(--ease-standard);
}

.entity-form-section.collapsed .section-collapse-icon {
    transform: rotate(-90deg);
}

/* Responsive */
@media (max-width: 768px) {
    .section-fields {
        grid-template-columns: 1fr !important;
    }

    .entity-form-header,
    .entity-form-content,
    .entity-form-footer {
        padding-left: var(--space-5);
        padding-right: var(--space-5);
    }

    .entity-form-footer {
        flex-direction: column;
        gap: var(--space-3);
    }

    .footer-left, .footer-right {
        width: 100%;
        justify-content: center;
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* ===== Lister Item Hover Effects (Global) ===== */
/* Must be global - RenderTreeBuilder elements may not get scoping attributes */
.lister-item {
    position: relative;
    padding:0.5rem;
    transition:
        background var(--duration-base) var(--ease-standard),
        border-color var(--duration-base) var(--ease-standard),
        transform var(--duration-base) var(--ease-standard),
        box-shadow var(--duration-base) var(--ease-standard);
}

.lister-item:hover {
    background: var(--glass-surface-hover);
    border-color: var(--glass-border);
    border-radius: 0.875rem;
    transform: translateY(-4px) scale(1.02);
    backdrop-filter: blur(12px) saturate(1.5);
    -webkit-backdrop-filter: blur(12px) saturate(1.5);
    box-shadow:
        var(--shadow-3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 20px var(--glass-ring);
}

/* Gradient overlay for action button visibility */
.lister-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 70%,
        rgba(0, 0, 0, 0.4) 100%
    );
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    border-radius: inherit;
}

.lister-item:hover::after {
    opacity: 1;
}

/* ===== Lister Item Actions (Global) ===== */
.lister-item-actions {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.375rem;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

@media (min-width: 768px) {
    .lister-item-actions {
        bottom: 0.625rem;
        right: 0.625rem;
    }
}

.lister-item:hover .lister-item-actions,
.lister-item:focus-within .lister-item-actions {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: none) {
    .lister-item-actions {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Lister Table Hover Effects (Global) ===== */
/* Note: Button styles now use unified .btn system from buttons.css */
.lister-table tbody tr {
    position: relative;
    transition:
        background var(--duration-fast) var(--ease-standard),
        box-shadow var(--duration-fast) var(--ease-standard);
}

.lister-table tbody tr:hover {
    background: var(--glass-surface);
    box-shadow: inset 4px 0 0 var(--accent);
}

.lister-table tbody tr:hover td {
    color: var(--color-text);
}

/* Table row gradient overlay for actions */
.lister-table tbody tr::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        transparent 60%,
        rgba(0, 0, 0, 0.3) 100%
    );
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.lister-table tbody tr:hover::after {
    opacity: 1;
}

/* Table cells above gradient */
.lister-table tbody tr td {
    position: relative;
    z-index: 1;
}

/* Hide actions by default, show on hover */
.lister-table tbody tr td:last-child .btn {
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.2s ease;
}

.lister-table tbody tr:hover td:last-child .btn {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Shared Component Patterns ===== */

/* Category Tabs - used in Devices, Playlists, MediaAssets */
.category-tabs {
    display: flex;
    gap: var(--space-2);
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
    margin-top:1rem;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-standard);
    white-space: nowrap;
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
}

.category-tab.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60A5FA;
}

.tab-icon {
    font-size: var(--text-base);
}

.tab-label {
    font-weight: 500;
}

.tab-count {
    padding: var(--space-1) var(--space-2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
}

.category-tab.active .tab-count {
    background: rgba(59, 130, 246, 0.3);
}

/* Filter Bar - used in Playlists, MediaAssets */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-4) var(--space-5);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.filter-group label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.filter-select {
    background: var(--gray-850, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    color: white;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    min-width: 120px;
    cursor: pointer;
}

.filter-select option {
    background: var(--gray-850, #1a1a2e);
    color: white;
    padding: var(--space-2);
}

.filter-select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
    }

    .filter-group {
        justify-content: space-between;
    }
}

/* Button styles moved to buttons.css */

/* ===== UA Brand Typography - Neue Plak Interim Styles ===== */
/* Based on UA Brand Playbook 2025 - Typography page 65 */

/* E1: Headline - SemiBold Stretch 190% */
.ua-type-e1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-stretch: 190%;
    text-transform: lowercase;
}

/* E2: Headline - SemiBold Stretch 90% */
.ua-type-e2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-stretch: 90%;
    text-transform: lowercase;
}

/* E3: Headline - SemiBold Stretch 65% */
.ua-type-e3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-stretch: 65%;
    text-transform: lowercase;
}

/* E4: Headline - SemiBold Stretch 45% */
.ua-type-e4 {
    font-family: var(--font-display);
    font-weight: 600;
    font-stretch: 45%;
    text-transform: lowercase;
}

/* E5: Headline - SemiBold Stretch 30% */
.ua-type-e5 {
    font-family: var(--font-display);
    font-weight: 600;
    font-stretch: 30%;
    text-transform: lowercase;
}

/* E6: Product Info - SemiBold Compress 60% (UPPERCASE) */
.ua-type-e6 {
    font-family: var(--font-display);
    font-weight: 600;
    font-stretch: 60%;
    text-transform: uppercase;
    letter-spacing: -0.02em; /* -2% */
}

/* E7: Body Copy - Regular Stretch 105% */
.ua-type-e7 {
    font-family: var(--font-display);
    font-weight: 400;
    font-stretch: 105%;
}

/* ===== MediaGridItem Drag Handle (Global for cross-component CSS) ===== */
.mgi-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 32px;
    cursor: grab;
    color: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    transition: color 0.15s ease;
    margin-left: -6px;
}

.mgi-drag-handle:hover {
    color: rgba(255, 255, 255, 0.6);
}

.mgi-drag-handle:active {
    cursor: grabbing;
    color: #E31937;
}

/* Disabled asset overlay */
.mgi-disabled-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: inherit;
    color: rgba(255, 255, 255, 0.7);
}

.media-grid-item.disabled {
    opacity: 0.5;
}

.media-grid-item.disabled .mgi-thumb-wrapper {
    filter: grayscale(50%);
}

/* Drag-over state */
.media-grid-item.drag-over {
    background: rgba(227, 25, 55, 0.2) !important;
    border-top: 2px solid #E31937;
    margin-top: -2px;
}

/* Prevent scrolling during drag operations */
body.drag-in-progress {
    overflow: hidden !important;
    touch-action: none;
    user-select: none;
}

body.drag-in-progress * {
    scroll-behavior: auto !important;
}

.pmg-grid.is-dragging {
    overflow: hidden !important;
    scroll-behavior: auto;
    touch-action: none;
}

/* ===== ProductMediaGallery Hover Actions (Global for cross-component CSS) ===== */
.pmg-hover-actions {
    display: flex;
    gap: 4px;
}

.pmg-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.15s ease;
}

.pmg-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

.pmg-action-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(227, 25, 55, 0.4);
}

.pmg-action-btn.active {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #F87171;
}

.pmg-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #F87171;
}

/* ===== Utility Classes ===== */
/* Button styles (.btn-warning, .btn-danger-ghost) moved to buttons.css */

/* Text Utility Classes */
.text-warning {
    color: var(--warning, #ffc107);
}

.text-danger {
    color: var(--error, #dc3545);
}

.text-success {
    color: var(--success, #22c55e);
}

.text-muted {
    color: var(--color-text-muted);
}

/* Info Grid (Settings, Detail Pages) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.info-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.info-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.info-label {
    font-size: var(--text-xs);
    color: var(--color-text-subtle);
}

.info-value {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
}

/* Button spinner moved to buttons.css (.btn-loading) */

@media (max-width: 768px) {
    .info-grid,
    .info-grid.columns-3,
    .info-grid.columns-4 {
        grid-template-columns: 1fr;
    }
}
