html, body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background-color: #f5f5f5;
}

/* Top bar */
.top-bar {
    height: 3.5rem;
    background-color: #0d47a1;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.top-bar-brand {
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.top-bar-link {
    margin-left: auto;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.875rem;
}

.top-bar-link:hover {
    color: white;
}

/* Layout body */
.layout-body {
    margin-top: 3.5rem;
    display: flex;
    min-height: calc(100vh - 3.5rem);
}

/* Sidebar */
.sidebar {
    width: 14rem;
    background: #263238;
    position: fixed;
    top: 3.5rem;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
    padding-top: 0.5rem;
}

.sidebar .rz-panel-menu {
    background: transparent;
}

.sidebar .rz-navigation-item-link {
    color: rgba(255,255,255,0.85) !important;
    text-decoration: none;
}

.sidebar .rz-navigation-item-link:hover {
    background: rgba(255,255,255,0.08) !important;
    color: white !important;
}

.sidebar .rz-navigation-item-icon {
    color: rgba(255,255,255,0.65) !important;
}

.sidebar .rz-navigation-item-link:hover .rz-navigation-item-icon {
    color: white !important;
}

/* Main content */
.main-content {
    margin-left: 14rem;
    padding: 1.5rem 2rem;
    flex: 1;
    min-width: 0;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    margin: 0;
    font-weight: 400;
    color: #333;
}

/* Section cards */
.section-card {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #444;
}

/* State badges */
.state-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.state-success  { background: #c8e6c9; color: #2e7d32; }
.state-pending  { background: #fff3e0; color: #e65100; }
.state-error    { background: #ffcdd2; color: #c62828; }

/* Detail grid (label-value pairs) */
.detail-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 16px;
    align-items: baseline;
}

.detail-label {
    font-size: 0.85em;
    color: var(--rz-text-secondary-color, #666);
    font-weight: 500;
}

.detail-value {
    font-size: 0.95em;
}

/* Monospace text */
.mono {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.875em;
}

/* GUID cells */
.guid-cell {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85em;
    cursor: default;
    border-bottom: 1px dashed var(--rz-text-disabled-color, #bbb);
}

/* Event type badges */
.event-type-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 500;
}

.event-type-ObjectEvent         { background: #e3f2fd; color: #1565c0; }
.event-type-AggregationEvent    { background: #f3e5f5; color: #6a1b9a; }
.event-type-TransactionEvent    { background: #e8f5e9; color: #2e7d32; }
.event-type-TransformationEvent { background: #fff8e1; color: #f57f17; }
.event-type-AssociationEvent    { background: #fce4ec; color: #c62828; }

/* JSON display */
.json-display {
    background: #263238;
    color: #e0e0e0;
    padding: 1rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 400px;
    overflow-y: auto;
}

/* Blazor error UI */
#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;
}

/* EPC tag */
.epc-tag {
    display: inline-block;
    background: #e8eaf6;
    color: #283593;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    margin: 2px;
}

/* Result message */
.result-message {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.result-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.result-error   { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
