/* =============================================================================
   HYVE Labs AI Studio — Master Stylesheet
   Monochromatic dark theme. Built for MudBlazor.
   ============================================================================= */

* { box-sizing: border-box; }

html, body, #app {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg, #0a0a0a);
    color: var(--text-primary, rgba(255,255,255,0.87));
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Classification Banner --- */
.hyve-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 26px;
    background: var(--bg-banner, #070707);
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1400;
    user-select: none;
}

.hyve-banner span {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-label, rgba(255,255,255,0.3));
}

/* --- App Shell --- */
.hyve-shell {
    display: flex;
    margin-top: 26px;
    height: calc(100vh - 26px);
    overflow: hidden;
}

/* --- Sidebar --- */
.hyve-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg-sidebar, #0e0e0e);
    border-right: 1px solid var(--border-subtle, rgba(255,255,255,0.04));
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.hyve-sidebar-brand {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hyve-sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--logo-gradient, linear-gradient(135deg, #e0e0e0, #888));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    color: var(--bg, #0a0a0a);
    flex-shrink: 0;
}

.hyve-sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    letter-spacing: -0.01em;
}

.hyve-sidebar-subtitle {
    font-size: 9px;
    font-weight: 600;
    color: var(--accent-subtle, rgba(255,255,255,0.5));
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 1px;
}

.hyve-sidebar-section {
    padding: 4px 10px;
}

.hyve-sidebar-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted, rgba(255,255,255,0.2));
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 16px 12px 6px;
}

.hyve-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-secondary, rgba(255,255,255,0.45));
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    margin-bottom: 2px;
}

.hyve-nav-item:hover {
    background: var(--bg-hover, rgba(255,255,255,0.04));
    color: rgba(255,255,255,0.75);
}

.hyve-nav-item.active {
    background: var(--bg-active, rgba(255,255,255,0.06));
    color: rgba(255,255,255,0.9);
}

.hyve-nav-item .nav-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5) !important;
}

.hyve-nav-item .nav-icon svg,
.hyve-nav-item .nav-icon .mud-icon-root {
    fill: currentColor !important;
    color: inherit !important;
}

.hyve-nav-item:hover .nav-icon {
    color: rgba(255,255,255,0.75) !important;
}

.hyve-nav-item.active .nav-icon {
    color: rgba(255,255,255,0.9) !important;
}

.hyve-sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.04));
}

.hyve-sidebar-footer-text {
    font-size: 10px;
    color: rgba(255,255,255,0.15);
    line-height: 1.5;
}

.hyve-sidebar-footer-version {
    font-size: 9px;
    color: var(--text-muted, rgba(255,255,255,0.2));
    opacity: 0.5;
}

/* --- Main Area --- */
.hyve-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hyve-topbar {
    height: 56px;
    min-height: 56px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.04));
    background: var(--bg-topbar, #0c0c0c);
}

.hyve-topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
}

.hyve-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hyve-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--logo-gradient, linear-gradient(135deg, #e0e0e0, #888));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--bg, #0a0a0a);
}

.hyve-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success, #10b981);
    border: 2px solid var(--bg-topbar, #0c0c0c);
    position: absolute;
    bottom: -1px;
    right: -1px;
}

.hyve-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

/* --- Cards --- */
.hyve-card {
    background: var(--bg-surface, #121212);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.04));
    border-radius: 12px;
    padding: 20px;
}

.hyve-card-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-subtle, rgba(255,255,255,0.5));
    margin-bottom: 16px;
}

/* --- Metric Cards --- */
.hyve-metric {
    background: var(--bg-surface, #121212);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.04));
    border-radius: 12px;
    padding: 18px 20px;
    transition: border-color 0.2s;
}

.hyve-metric:hover {
    border-color: var(--border-hover, rgba(255,255,255,0.1));
}

.hyve-metric-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hyve-metric-value {
    font-size: 28px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    line-height: 1;
    margin-bottom: 4px;
}

.hyve-metric-sub {
    font-size: 11px;
    color: var(--text-muted, rgba(255,255,255,0.2));
}

/* --- MudBlazor Overrides --- */
.mud-table-root {
    background: transparent !important;
}

.mud-table-head .mud-table-cell {
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: rgba(255,255,255,0.3) !important;
    border-bottom-color: rgba(255,255,255,0.04) !important;
}

.mud-table-body .mud-table-row:hover {
    background: rgba(255,255,255,0.03) !important;
}

.mud-table-body .mud-table-cell {
    border-bottom-color: rgba(255,255,255,0.03) !important;
    font-size: 13px !important;
}

.mud-chip {
    font-size: 11px !important;
    font-weight: 600 !important;
}

.mud-input-label {
    font-size: 12px !important;
}

.mud-select .mud-input-control {
    font-size: 13px !important;
}

.mud-dialog {
    background: var(--bg-surface, #121212) !important;
    border: 1px solid var(--border, rgba(255,255,255,0.06)) !important;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* --- Blazor Error UI --- */
#blazor-error-ui {
    background: #8b0000;
    color: white;
    bottom: 0;
    left: 0;
    padding: 0.5rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    display: none;
}
