@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500&display=swap');

:root {
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --primary: #0f172a;
    --primary-hover: #1e293b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Impeccable Smooth Shadow Layering */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.04), 0 5px 15px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.04);
    
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Glassmorphism card */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Base button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.875rem;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-color);
    border-color: var(--text-muted);
}

/* Premium Layout Grid */
.page {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

main {
    padding: 2rem;
    overflow-y: auto;
}

h1, h2, h3, h4, h5 {
    font-weight: 700;
    margin-top: 0;
    letter-spacing: -0.025em;
    color: #0f172a;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.035em;
}

.brand-typemark {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

/* Sleek Typography Overrides for Brand Consistency */
.glass-card h2, 
.glass-card .btn,
.nav-link {
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.glass-card h2 {
    font-weight: 400 !important;
}

.glass-card .btn, 
.nav-link {
    font-weight: 500 !important;
    font-size: 0.85rem !important;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}
.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--surface-color);
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

/* Sidebar */
.sidebar {
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}
.sidebar .top-row {
    height: 4rem;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}
.nav-scrollable {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 0;
}
.nav-item {
    margin: 0.25rem 1rem;
}
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}
.nav-link:hover {
    background-color: var(--bg-color);
    color: var(--primary);
}
.nav-link.active {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}
.nav-link .bi {
    margin-right: 0.75rem;
    font-size: 1.125rem;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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;
}

/* -----------------------------------
   IMPECCABLE.STYLE MOBILE ADAPTATION 
-------------------------------------- */
@media (max-width: 768px) {
    .page {
        display: flex;
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        z-index: 1000;
    }
    
    .sidebar .top-row {
        height: 4rem;
        display: flex;
        justify-content: space-between;
    }
    
    .mobile-menu-btn {
        display: flex;
        background: transparent;
        border: none;
        color: var(--primary);
        cursor: pointer;
        padding: 0.5rem;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        min-width: 48px;
        margin-right: -0.5rem;
    }
    
    .nav-scrollable.collapse-mobile {
        display: none;
    }
    
    .nav-scrollable {
        display: block;
        border-top: 1px solid var(--border-color);
    }
    
    main {
        padding: 1.25rem 1rem;
    }
    
    /* Adapt Touch Targets (Min 44x44px impeccable pattern) */
    .btn, .form-control, .nav-link {
        min-height: 48px;
    }
    
    h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .glass-card {
        padding: 1.25rem;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none;
    }
}