/* ── Base ───────────────────────────────────────────────── */
html, body {
    font-family: Roboto, Helvetica, Arial, sans-serif;
}

#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;
}

/* ── Drawer ─────────────────────────────────────────────── */
.drawer-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem 1rem;
}

.drawer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(21, 101, 192, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

.nav-menu-full {
    height: 100%;
    flex-direction: column;
}

.nav-bottom {
    margin-top: auto;
}

.mud-nav-link {
    text-decoration: none !important;
}

.mud-nav-link-form {
    margin: 0;
}

/* ── Stat Cards ─────────────────────────────────────────── */
.stat-card {
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    border-radius: 10px !important;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important;
}

.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon--primary   { background: rgba(21, 101, 192, 0.1); }
.stat-card-icon--secondary { background: rgba(0, 131, 143, 0.1); }
.stat-card-icon--success   { background: rgba(46, 125, 50, 0.1); }
.stat-card-icon--warning   { background: rgba(230, 81, 0, 0.1); }
.stat-card-icon--error     { background: rgba(198, 40, 40, 0.1); }
.stat-card-icon--info      { background: rgba(2, 119, 189, 0.1); }

/* ── Live Badge ─────────────────────────────────────────── */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid currentColor;
}

.live-badge--live {
    color: #2E7D32;
    background: rgba(46, 125, 50, 0.08);
    border-color: rgba(46, 125, 50, 0.3);
}

.live-badge--static {
    color: #E65100;
    background: rgba(230, 81, 0, 0.08);
    border-color: rgba(230, 81, 0, 0.3);
}

.live-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.live-badge--live .live-badge-dot {
    animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* ── Well visualization ──────────────────────────────────── */
.history-chart {
    height: 220px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    overflow-x: auto;
    background: var(--mud-palette-surface);
}

.history-bar {
    width: 8px;
    border-radius: 2px 2px 0 0;
    background: var(--mud-palette-primary);
}

.token-code {
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.well-viz-shell {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.well-viz-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.well-viz-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: min(220px, 40%);
}

.well-viz-bar {
    flex: 1;
    min-width: 72px;
}

.well-viz-frame {
    position: relative;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    overflow: hidden;
    background: #FBFCFF;
}

.well-viz-canvas {
    display: block;
    width: 100%;
    height: min(52vh, 460px);
    min-height: 340px;
}

.well-viz-mode {
    flex-shrink: 0;
}

.well-viz-hint {
    position: absolute;
    left: 0.75rem;
    bottom: 0.5rem;
    margin: 0;
    pointer-events: none;
    opacity: 0.85;
}

/* ── Auth layout ─────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mud-palette-background-grey, #f5f5f5);
    padding: 1.5rem 1rem;
}

.auth-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.25rem;
}

.auth-card {
    width: 100%;
    border-radius: 12px !important;
}

.auth-card .mud-input-outlined .mud-input {
    background: transparent;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.auth-field label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--mud-palette-text-primary, #1a1a1a);
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--mud-palette-lines-inputs, #cfcfcf);
    border-radius: 6px;
    background: #fff;
    color: var(--mud-palette-text-primary, #1a1a1a);
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.4;
}

.auth-input:focus {
    outline: none;
    border-color: var(--mud-palette-primary, #1565c0);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.auth-error {
    display: block;
    margin-top: 0.15rem;
    color: var(--mud-palette-error, #c62828);
    font-size: 0.75rem;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--mud-palette-text-primary, #1a1a1a);
    user-select: none;
}

.auth-check input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--mud-palette-primary, #1565c0);
}

.auth-passkey-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 8px 16px;
    border: 1px solid var(--mud-palette-primary);
    border-radius: 4px;
    background: transparent;
    color: var(--mud-palette-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.02857em;
    transition: background 0.2s;
    font-family: inherit;
}

.auth-passkey-btn:hover {
    background: rgba(21, 101, 192, 0.06);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 0.75rem 0;
    color: var(--mud-palette-text-secondary, #666);
    font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--mud-palette-divider, #e0e0e0);
}

.auth-divider span {
    padding: 0 0.75rem;
}
