:root {
    /* ~1rem on mobile (375px), scales to 1.25rem (125%) on desktop (≥1200px) */
    font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
}

/* Responsive table wrapper — wraps RadzenDataGrid for horizontal scroll on small screens */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Hide role-preview switcher on very small screens to prevent header overflow */
@media (max-width: 575.98px) {
    .header-role-switcher {
        display: none !important;
    }

    /* Sidebar overlay mode on mobile: body always takes full width */
    .rz-layout {
        grid-template-columns: 0 1fr !important;
    }

    /* Sidebar slides in as a fixed overlay */
    .rz-sidebar {
        position: fixed !important;
        z-index: 1050 !important;
        top: var(--rz-header-height, 56px) !important;
        left: 0 !important;
        bottom: 0 !important;
        height: calc(100dvh - var(--rz-header-height, 56px)) !important;
        width: var(--rz-sidebar-width, 250px) !important;
        min-width: 0 !important;
        overflow-y: auto !important;
        transform: translateX(-100%) !important;
        transition: transform 0.25s ease-in-out !important;
    }

    .rz-sidebar.rz-sidebar-expanded {
        transform: translateX(0) !important;
    }

    /* Semi-transparent backdrop behind the open sidebar */
    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1049;
        cursor: pointer;
    }
}
@media (max-width: 767.98px) {
    .rz-button, .rz-sidebar-toggle {
        min-height: 44px;
        min-width: 44px;
    }

    .rz-button:not(.rz-primary) [class*="rz-button-icon"] + .rz-button-text {
        display: none;
    }

    /* Reduce body padding on mobile */
    .rz-body > div {
        padding: 0.5rem !important;
    }

    /* Stack page heading stacks on very narrow screens */
    .page-header-actions {
        width: 100%;
        justify-content: flex-start !important;
    }
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--rz-primary);
}

.btn-primary {
    color: var(--rz-base-50);
    background-color: var(--rz-primary);
    border-color: var(--rz-primary-dark);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--rz-base-100), 0 0 0 0.25rem var(--rz-primary);
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--rz-success);
}

.invalid {
    outline: 1px solid var(--rz-danger);
}

.validation-message {
    color: var(--rz-danger);
}

#blazor-error-ui {
    color-scheme: light dark;
    background: var(--rz-warning-lighter);
    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 {
    background: var(--rz-danger-dark);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--rz-base-50);
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

code {
    color: var(--rz-primary-dark);
}

.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rz-base-200);
    padding: 1.5rem;
}

.auth-content {
    width: min(420px, 100%);
}

.auth-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.auth-progress-card {
    background: var(--rz-base-100);
    color: var(--rz-text-color, inherit);
    border: 1px solid var(--rz-base-300);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 300px;
}

.auth-progress-icon {
    color: var(--rz-primary);
    margin-bottom: 1rem;
}

.auth-progress-title {
    color: var(--rz-primary);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.auth-progress-track {
    position: relative;
    width: 100%;
    height: 4px;
    background: var(--rz-base-300);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.auth-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--rz-primary), var(--rz-secondary));
    animation: loading 1.5s ease-in-out infinite;
}

.auth-progress-text {
    color: var(--rz-text-secondary-color);
    font-size: 0.875rem;
    margin: 0;
}

.empty-state-icon {
    color: var(--rz-base-500);
}

html[data-theme="dark"] body .rz-color-secondary,
html[data-theme="dark"] body .rz-text-secondary {
    color: var(--rz-text-secondary-color) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] small.text-muted {
    color: var(--rz-text-secondary-color) !important;
}
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Request Progress Timeline Styles */
.request-progress-timeline {
    --rz-timeline-axis-size: 72px;
    max-width: 100%;
}

.request-progress-timeline .rz-timeline-item {
    flex: 1 1 0;  /* Equal flex basis for all items */
    min-width: 0;  /* Allow flex items to shrink below content size */
    max-width: 25%;  /* Each of 4 items takes max 25% */
}

/* Hide the content-start area (grey boxes) */
.request-progress-timeline .rz-timeline-content-start {
    display: none !important;
}

.request-progress-timeline .rz-timeline-content-end {
    text-align: center !important;
    padding: 0.5rem 0.25rem;
    max-width: 100%;
}

.request-progress-timeline .rz-timeline-content-end > div {
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
}

/* Workflow Diagram Styles - GLOBAL OVERRIDES */
/* Target the custom class applied to PortRenderer */
.custom-port {
    width: 16px !important;
    height: 16px !important;
    background-color: var(--rz-base-600) !important;
    border-radius: 50% !important;
    position: absolute !important;
    z-index: 9999 !important; /* Super high Z-index */
    cursor: crosshair !important;
    border: 2px solid var(--rz-base-100) !important;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.35) !important;
    display: block !important; /* Force display */
    opacity: 1 !important; /* Force opacity */
}

/* Hide dynamic side ports when requested by node widgets */
.custom-port.dynamic-port-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hover state */
.custom-port:hover {
    background-color: var(--rz-primary) !important;
    transform: scale(1.3) !important;
}

/* Positioning helpers - THESE DEPEND ON Z.Blazor.Diagrams applying 'top', 'bottom', etc. classes */
.custom-port.top {
    top: -8px !important;
    left: 50% !important;
    margin-left: -8px !important; /* Center using margin since width is 16px */
}

.custom-port.bottom {
    bottom: -8px !important;
    left: 50% !important;
    margin-left: -8px !important;
}

.custom-port.left {
    left: -8px !important;
    top: 50% !important;
    margin-top: -8px !important;
}

.custom-port.right {
    right: -8px !important;
    top: 50% !important;
    margin-top: -8px !important;
}
