html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

/* Isolate Telerik Report Viewer from RTL layout */
.telerik-report-viewer-container,
.telerik-report-viewer-container * {
    direction: ltr !important;
    text-align: left !important;
}
.telerik-report-viewer-container .trv-report-page * {
    direction: inherit !important;
    text-align: inherit !important;
}

/* Skip navigation link for accessibility */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s;
}

.skip-nav:focus {
    top: 0;
}

h1:focus {
    outline: none;
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.sidebar {
    background-color: #f8f9fa;
}

.top-row {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.top-row a {
    margin-left: 1.5rem;
    text-decoration: none;
}

.content {
    padding-top: 1.1rem;
}

.nav-menu {
    padding: 1rem;
}

.nav-item {
    padding: 0.5rem 0;
}

.nav-link {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav-link:hover {
    background-color: #e9ecef;
}

.nav-link.active {
    background-color: #0d6efd;
    color: white;
}

.card {
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }
}

/* ===== Login Page Styles ===== */

.login-background {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    margin: 0;
    box-sizing: border-box;
    transition: background 0.4s ease;
}

/* Two-panel card */
.login-panel {
    display: flex;
    width: 100%;
    max-width: 960px;
    min-height: 560px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Left: branding panel */
.login-brand {
    position: relative;
    width: 42%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 40px;
    overflow: hidden;
}

.login-brand-content {
    position: relative;
    z-index: 1;
}

.login-brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
}

.login-brand-divider {
    width: 48px;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    margin: 24px 0;
}

.login-brand-footer {
    position: relative;
    z-index: 1;
}

/* Decorative circles */
.login-brand-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.login-brand-circle-1 {
    width: 200px;
    height: 200px;
    bottom: -60px;
    right: -60px;
}

.login-brand-circle-2 {
    width: 120px;
    height: 120px;
    top: -30px;
    right: 40px;
}

/* Right: form panel */
.login-form-side {
    flex: 1;
    background: var(--mud-palette-surface, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.login-form-inner {
    width: 100%;
    max-width: 380px;
}

.login-button {
    text-transform: none !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px;
    border-radius: 10px !important;
    height: 50px !important;
}

/* Tablet */
@media (max-width: 768px) {
    .login-panel {
        flex-direction: column;
        max-width: 480px;
        min-height: auto;
    }

    .login-brand {
        width: 100%;
        padding: 32px 32px 24px;
    }

    .login-brand-circle-1,
    .login-brand-circle-2 {
        display: none;
    }

    .login-form-side {
        padding: 32px;
    }
}

/* ===== Blazor Reconnect Modal ===== */

#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

#components-reconnect-modal.show {
    display: flex;
}

.toledo-reconnect-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 48px;
    border-radius: 16px;
    background: var(--mud-palette-surface, #fff);
    color: var(--mud-palette-text-primary, #333);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.toledo-reconnect-text {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
}

.toledo-reconnect-spinner {
    width: 40px;
    height: 40px;
    color: var(--mud-palette-primary, #1976d2);
    animation: toledo-spin 1s linear infinite;
}

@keyframes toledo-spin {
    100% { transform: rotate(360deg); }
}

/* Mobile */
@media (max-width: 480px) {
    .login-background {
        padding: 0;
    }

    .login-panel {
        border-radius: 0;
        min-height: 100vh;
        min-height: 100dvh;
        max-width: 100%;
    }

    .login-brand {
        padding: 24px 20px 20px;
    }

    .login-form-side {
        padding: 24px 20px;
    }
}
