:root {
    --eq-bg: #f4f6fb;
    --eq-surface: #ffffff;
    --eq-border: rgba(15, 23, 42, 0.06);
    --eq-radius: 16px;
    --eq-text: #1e293b;
    --eq-muted: #64748b;
    --eq-faint: #94a3b8;
    --eq-primary: #3949ab;
}

html, body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--eq-bg);
    color: var(--eq-text);
    -webkit-font-smoothing: antialiased;
}

/* ── Page header (shared across all pages) ─────────────────────────── */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-head-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-head-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3949ab, #5c6bc0);
    box-shadow: 0 6px 16px rgba(57, 73, 171, 0.28);
}

.page-head-icon .mud-icon-root {
    color: #fff !important;
}

.page-head h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--eq-text);
    margin: 0;
    line-height: 1.1;
}

.page-head-sub {
    font-size: .85rem;
    color: var(--eq-faint);
    margin-top: 2px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--eq-text);
    margin-bottom: 1.5rem;
}

/* ── Surfaces / cards ──────────────────────────────────────────────── */
.mud-paper {
    border-radius: var(--eq-radius) !important;
    border: 1px solid var(--eq-border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}

.mud-paper.mud-elevation-0 {
    box-shadow: none !important;
}

/* ── Tables ────────────────────────────────────────────────────────── */
.mud-table {
    background: transparent !important;
}

.mud-table-head .mud-table-cell {
    text-transform: uppercase;
    font-size: .7rem !important;
    letter-spacing: .6px;
    font-weight: 700 !important;
    color: var(--eq-faint) !important;
    background: #f8fafc !important;
    border-bottom: 1px solid var(--eq-border) !important;
}

.mud-table-row .mud-table-cell {
    border-bottom: 1px solid #f1f5f9 !important;
    color: var(--eq-text);
    padding-top: 12px;
    padding-bottom: 12px;
}

.mud-table-body .mud-table-row:hover {
    background: #f8faff !important;
}

/* Clickable rows (list pages that navigate to a detail view) */
.clickable-row {
    cursor: pointer;
}

.mud-table-row:last-child .mud-table-cell {
    border-bottom: none !important;
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.mud-button-root {
    border-radius: 10px !important;
    text-transform: none !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

.mud-button-filled {
    box-shadow: 0 4px 12px rgba(57, 73, 171, 0.20) !important;
}

/* ── Chips ─────────────────────────────────────────────────────────── */
.mud-chip {
    border-radius: 8px !important;
    font-weight: 600 !important;
}

/* ── Inputs ────────────────────────────────────────────────────────── */
.mud-input.mud-input-outlined .mud-input-outlined-border {
    border-radius: 10px !important;
}

/* ── App bar ───────────────────────────────────────────────────────── */
.mud-appbar {
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--eq-border);
}

.mud-appbar.mud-appbar-dense {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

/* ── Drawer / navigation ───────────────────────────────────────────── */
.mud-drawer {
    border-right: 1px solid var(--eq-border) !important;
}

.mud-nav-link {
    margin: 2px 12px;
    border-radius: 12px;
    font-weight: 500;
    color: var(--eq-muted) !important;
    transition: background .15s ease, color .15s ease;
}

.mud-nav-link:hover {
    background: #eef1fb !important;
    color: var(--eq-primary) !important;
}

.mud-nav-link.active {
    background: linear-gradient(135deg, #3949ab, #5c6bc0) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(57, 73, 171, 0.28);
}

.mud-nav-link.active .mud-icon-root {
    color: #fff !important;
}

.mud-nav-link .mud-nav-link-icon {
    color: inherit !important;
}

/* ── Misc ──────────────────────────────────────────────────────────── */
#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;
}

.badge-pending  { background: #fff3e0; color: #e65100; }
.badge-review   { background: #e3f2fd; color: #0d47a1; }
.badge-resolved { background: #e8f5e9; color: #1b5e20; }
.badge-rejected { background: #fce4ec; color: #b71c1c; }

/* ── JsonView (deserialized log rendering) ─────────────────────────── */
.jsonview-obj {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.82rem;
    min-width: 0;
}

.jsonview-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 3px 0;
    border-bottom: 1px solid #f0f0f0;
    min-width: 0;
}

.jsonview-row:last-child {
    border-bottom: none;
}

.jsonview-key {
    flex: 0 0 140px;
    max-width: 140px;
    font-weight: 500;
    color: #1a237e;
    word-break: break-word;
}

.jsonview-val {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.jsonview-grid-wrap {
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.jsonview-grid {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.8rem;
}

.jsonview-grid th,
.jsonview-grid td {
    border-bottom: 1px solid #eeeeee;
    border-right: 1px solid #eeeeee;
    padding: 5px 10px;
    vertical-align: top;
    text-align: left;
    white-space: nowrap;
}

.jsonview-grid td .jsonview-obj,
.jsonview-grid td .jsonview-grid-wrap,
.jsonview-grid td .jsonview-list {
    white-space: normal;
}

.jsonview-grid th:last-child,
.jsonview-grid td:last-child {
    border-right: none;
}

.jsonview-grid tbody tr:last-child td {
    border-bottom: none;
}

.jsonview-grid thead th {
    background: #f0f0f5;
    font-weight: 600;
    color: #303f9f;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.jsonview-grid tbody tr:nth-child(even) {
    background: #fafafa;
}

.jsonview-scalar {
    word-break: break-word;
}

.jsonview-empty {
    color: #bdbdbd;
}

.jsonview-list {
    margin: 0;
    padding-left: 1.1rem;
}

.jsonview-raw {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    overflow: auto;
    max-height: 360px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}
