html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

html { overflow-y: auto; }
body { min-height: 100vh; min-height: 100dvh; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.35;
    padding: 14px 16px 4px;
}

.mud-nav-link {
    border-radius: 6px !important;
    margin: 1px 8px !important;
    transition: background 0.15s ease, padding 0.15s ease !important;
}

/* Drawer transition */
.mud-drawer {
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow-x: hidden !important;
}

.mud-drawer-content {
    overflow-x: hidden !important;
}

/* Nav labels fade */
.nav-section-label {
    transition: opacity 0.2s ease 0.05s;
}

/* Nav link text fade */
.mud-nav-link .mud-nav-link-text {
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

/* Main content follows drawer smoothly */
.mud-main-content {
    transition: padding-left 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#blazor-error-ui {
    background: #dc2626;
    color: white;
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    text-align: center;
}

/* ═══ Responsive utility classes ═══════════════════════════════
   Use these instead of inline styles with fixed grids — they
   collapse to a single column on mobile. */

/* Auto-fill responsive grid */
.grid-auto { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-auto-sm { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-auto-xs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* Fixed n-column grids that collapse on mobile */
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr 1fr; }

/* Filter row — horizontal flex that wraps + fills full width on mobile */
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.filter-row > * { flex: 1 1 auto; }

/* Breakpoint: tablets and below */
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* Breakpoint: phones */
@media (max-width: 600px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .filter-row > * { flex: 1 1 100%; min-width: 0 !important; }

    /* Compact MudBlazor components on mobile */
    .mud-main-content { padding: 12px 8px !important; }
    .mud-paper { padding: 12px !important; }

    /* Wide MudSimpleTable inside Paper — enable horizontal scroll */
    .mud-paper > .mud-table-root,
    .mud-paper > .mud-simple-table { overflow-x: auto; }

    /* Shrink dialog paddings on mobile */
    .mud-dialog { margin: 8px !important; }
    .mud-dialog-content { padding: 12px !important; }
}

/* Very narrow phones */
@media (max-width: 400px) {
    .grid-auto { grid-template-columns: 1fr; }
    .mud-chip { font-size: 0.7rem !important; }
}
