:root {
    --bg: #f1f4f9;
    --bg-soft: #ecf0f6;
    --bg-soft-2: #e2e8f0;
    --bg-elevated: rgba(255, 255, 255, 0.84);
    --card: #ffffff;
    --line: #cfd7e2;
    --line-strong: #bac4d3;
    --line-soft: rgba(186, 196, 211, 0.58);
    --text: #10172a;
    --muted: #5a6677;
    --glow: rgba(6, 111, 224, 0.14);
    --accent: #066fe0;
    --accent-glow: #1ab1ff;
    --accent-soft: rgba(6, 111, 224, 0.08);
    --warm: #f59a0a;
    --success: #24a86c;
    --success-soft: rgba(36, 168, 108, 0.12);
    --danger: #df2a2a;
    --danger-soft: rgba(223, 42, 42, 0.08);
    --shadow-sm: 0 10px 30px rgba(16, 23, 42, 0.08);
    --shadow-lg: 0 24px 60px rgba(16, 23, 42, 0.12);
    --panel-radius: 18px;
}

@font-face {
    font-family: "Inter";
    src: url("/fonts/Inter.ttf") format("truetype");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Space Grotesk";
    src: url("/fonts/SpaceGrotesk.ttf") format("truetype");
    font-weight: 300 700;
    font-display: swap;
}

html,
body {
    margin: 0;
    min-height: 100%;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 8% 2%, rgba(213, 234, 255, 0.7), transparent 36%),
        radial-gradient(circle at 96% 96%, rgba(26, 177, 255, 0.2), transparent 30%),
        linear-gradient(180deg, #fafcfe 0%, #f1f4f9 100%);
    color: var(--text);
    font-family: "Inter", "Segoe UI", sans-serif;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

body::before {
    background:
        radial-gradient(circle at 10% 6%, rgba(213, 234, 255, 0.78), transparent 30%),
        radial-gradient(circle at 92% 92%, rgba(26, 177, 255, 0.16), transparent 24%);
}

body::after {
    background-image:
        linear-gradient(rgba(207, 215, 226, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(207, 215, 226, 0.2) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 80%);
}

a {
    color: var(--accent);
}

h1:focus {
    outline: none;
}

.text-muted {
    color: var(--muted);
}

.glass-panel {
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 240, 246, 0.92));
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    border-radius: var(--panel-radius);
}

.auth-shell,
.dashboard-shell {
    position: relative;
    min-height: 100vh;
}

.dashboard-shell .mud-drawer {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(236, 240, 246, 0.94));
    border-right: 1px solid rgba(207, 215, 226, 0.9);
    backdrop-filter: blur(18px);
}

.dashboard-shell .mud-main-content {
    background: transparent;
}

.dashboard-appbar {
    padding: 0;
    background: rgba(250, 252, 254, 0.72);
    border-bottom: 1px solid rgba(207, 215, 226, 0.72);
    backdrop-filter: blur(18px);
}

.dashboard-appbar .mud-toolbar-appbar {
    padding: 0 1rem;
}

.dashboard-main-wrap {
    overflow-x: clip;
}

.dashboard-appbar-inner {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-nav-toggle {
    display: none !important;
    color: var(--text) !important;
}

.dashboard-nav-toggle.mud-icon-button {
    color: var(--text) !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid var(--line) !important;
    box-shadow: 0 6px 14px rgba(16, 23, 42, 0.12);
}

.dashboard-nav-toggle .mud-icon-root {
    color: var(--text) !important;
    opacity: 1 !important;
}

.dashboard-brand-link {
    display: inline-flex;
    align-items: center;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.brand-lockup-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(6, 111, 224, 0.24);
}

.brand-lockup-text {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
    color: var(--text);
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1;
}

.brand-lockup-accent {
    color: var(--accent);
}

.dashboard-user-chip {
    margin-right: 0;
}

.dashboard-drawer {
    max-width: calc(100vw - 1rem);
}

.dashboard-mobile-userbar {
    display: none;
    overflow: visible;
}

.dashboard-mobile-userbar .mud-typography {
    line-height: 1.4;
}

.dashboard-mobile-user-email {
    word-break: break-word;
}

.integration-chip-list {
    flex-wrap: wrap;
}

.integration-chip-list .mud-chip {
    min-width: 0;
    max-width: 100%;
}

.hero-panel,
.metrics-panel,
.timeline-panel,
.pricing-card,
.settings-card,
.sidebar-card,
.auth-card {
    animation: rise-in 420ms ease-out;
}

.metric-card {
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--panel-radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 240, 246, 0.92));
    box-shadow: var(--shadow-sm);
}

.metric-card strong,
.token-value {
    display: block;
    margin-top: 0.35rem;
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    word-break: break-all;
}

.signal-feed-card {
    border: 1px solid var(--line-soft);
    border-radius: var(--panel-radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-sm);
}

.signal-feed-payload {
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--panel-radius);
    background: rgba(236, 240, 246, 0.86);
    color: var(--text);
    font-family: "Inter", "Cascadia Mono", monospace;
    font-size: 0.98rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.signal-feed-time {
    flex-shrink: 0;
}

.metric-label {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.token-shell,
.empty-state,
.sidebar-card {
    border: 1px solid var(--line-soft);
    background: rgba(236, 240, 246, 0.72);
}

.page-header-wrap,
.wrap-actions {
    gap: 1rem;
}

/* --- ������������ ���� ������� --- */
.dashboard-top-panels {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

.dashboard-top-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ���������� ���������� ������ ������������� �� ������ � ������������ ������� ����� h-100 �� MudBlazor */
.dashboard-top-panel .glass-panel {
    flex-grow: 1;
    height: auto !important;
}

.dashboard-top-panel-primary {
    flex: 1 1 auto;
}

.dashboard-top-panel-secondary {
    flex: 0 0 auto;
    width: 420px;
    max-width: 100%;
}

.dashboard-status-chip {
    margin-left: auto;
}

.dashboard-hero-title .dashboard-brand-title,
.dashboard-hero-title .dashboard-brand-line,
.dashboard-hero-title .dashboard-title-suffix {
    display: inline;
}

.dashboard-hero-title .dashboard-brand-title {
    white-space: nowrap;
}

.dashboard-hero-title .dashboard-title-suffix::before {
    content: " ";
}

.token-row {
    gap: 1rem;
    min-width: 0;
}

.dashboard-nav-title {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.dashboard-nav-menu .mud-nav-link {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.auth-card {
    width: min(100%, 490px);
}

.session-expired-card {
    width: min(100%, 520px);
    border-radius: var(--panel-radius);
}

.session-expired-copy {
    max-width: 420px;
}

.auth-layout-stack {
    max-width: 520px;
    margin-inline: auto;
}

.auth-logo-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.brand-lockup-auth {
    gap: 0.9rem;
}

.brand-lockup-icon-auth {
    width: 52px;
    height: 52px;
    border-radius: 12px;
}

.brand-lockup-text-auth {
    font-size: clamp(1.35rem, 3.6vw, 1.85rem);
}

.auth-brand {
    max-width: 560px;
}

.google-button-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
}

.google-button-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.shell-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid rgba(6, 111, 224, 0.18);
    border-radius: var(--panel-radius);
    background: rgba(6, 111, 224, 0.08);
    color: var(--accent);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nav-link-active {
    border-color: rgba(6, 111, 224, 0.18) !important;
    background: rgba(6, 111, 224, 0.08) !important;
    color: var(--accent) !important;
}

.mud-chip {
    border-radius: var(--panel-radius) !important;
}

.mud-chip-outlined,
.mud-chip-filled,
.mud-paper,
.mud-button-root,
.mud-alert,
.mud-table,
.mud-nav-link {
    border-radius: var(--panel-radius) !important;
}

.admin-table .mud-table-cell,
.admin-table .mud-table-cell * {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.validation-message {
    color: var(--danger);
}

input[type="password"],
.mud-input-slot input[type="password"],
.mud-input-root input[type="password"],
.mud-input-root-outlined input[type="password"] {
    color-scheme: light;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    filter: none;
}

#blazor-error-ui {
    display: none;
}

.dashboard-brand-accent {
    color: var(--accent);
}

.dashboard-hero-title {
    letter-spacing: -0.03em;
}

.dashboard-brand-line + .dashboard-brand-line {
    margin-left: 0.18em;
}

.auth-shell,
.dashboard-main-wrap {
    position: relative;
}

.auth-shell::before,
.dashboard-main-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at top left, rgba(6, 111, 224, 0.05), transparent 28%),
        radial-gradient(circle at bottom right, rgba(26, 177, 255, 0.08), transparent 24%);
}

.mud-button-root {
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

.mud-button-filled.mud-button-filled-primary,
.mud-button-filled.mud-button-filled-info {
    background: linear-gradient(135deg, var(--accent), var(--accent-glow)) !important;
    box-shadow: 0 14px 32px rgba(6, 111, 224, 0.24);
    color: #fff !important;
}

.mud-button-filled.mud-button-filled-warning {
    box-shadow: 0 14px 32px rgba(245, 154, 10, 0.22);
}

.mud-button-outlined {
    border-color: var(--line) !important;
    background: rgba(255, 255, 255, 0.58);
}

.mud-button-text {
    color: var(--accent) !important;
}

.mud-input-control > .mud-input-control-input-container > .mud-input-outlined {
    background: rgba(255, 255, 255, 0.84);
    border-radius: var(--panel-radius);
}

.mud-input-outlined-border {
    border-color: var(--line) !important;
}

.mud-input-label,
.mud-input-slot,
.mud-select-input {
    color: var(--text) !important;
}

.mud-popover,
.mud-menu,
.mud-select-item {
    color: var(--text);
}

.mud-select-item {
    background: #fff;
}

.mud-alert-outlined {
    background: rgba(255, 255, 255, 0.72);
}

.mud-table {
    background: rgba(255, 255, 255, 0.9);
}

.mud-divider {
    border-color: rgba(207, 215, 226, 0.78) !important;
}

.integration-status-chip-linked,
.plan-current-chip {
    background: var(--success-soft) !important;
    color: #176847 !important;
    border: 1px solid rgba(36, 168, 108, 0.32) !important;
}

.auth-card .mud-button-outlined,
.auth-card .mud-button-text,
.auth-card .mud-paper {
    box-shadow: none;
}

.user-login-input,
.user-register-input {
    width: 100%;
    min-height: 64px;
    padding: 0.95rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 1.08rem;
    font-weight: 500;
    line-height: 1.35;
    box-sizing: border-box;
    outline: none;
    appearance: none;
    color-scheme: light;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.user-login-input:focus,
.user-register-input:focus {
    border-color: rgba(6, 111, 224, 0.55);
    box-shadow: 0 0 0 1px rgba(6, 111, 224, 0.14), 0 0 0 4px rgba(6, 111, 224, 0.08);
    background: #fff;
}

.user-login-input:-webkit-autofill,
.user-login-input:-webkit-autofill:hover,
.user-login-input:-webkit-autofill:focus,
.user-login-input:-webkit-autofill:active,
.user-register-input:-webkit-autofill,
.user-register-input:-webkit-autofill:hover,
.user-register-input:-webkit-autofill:focus,
.user-register-input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text) !important;
    font-family: "Inter", "Segoe UI", sans-serif !important;
    font-size: 1.08rem !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.9) inset !important;
    box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.9) inset !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    transition: background-color 99999s ease-in-out 0s;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- ����� ����� ��� ������������ ������������� --- */
.hero-stack {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

@media (max-width: 960px) {
    .dashboard-appbar .mud-toolbar-appbar {
        width: 100%;
        min-height: 72px;
        padding: 0.45rem 1rem 0.2rem;
    }

    .dashboard-nav-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 42px;
        min-height: 42px;
    }

    .dashboard-appbar-inner {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0.75rem;
        width: 100%;
        align-items: center;
    }

    .dashboard-appbar-inner .mud-spacer {
        display: none;
    }

    .dashboard-brand-link {
        margin-left: 0 !important;
        display: flex;
        justify-content: flex-end;
        justify-self: end;
        width: auto;
        min-width: 0;
        max-width: calc(100vw - 4.5rem);
    }

    .dashboard-user-chip {
        display: none !important;
    }

    .dashboard-mobile-userbar {
        display: block;
        margin-top: 0.45rem;
        padding-top: 0.9rem !important;
        padding-bottom: 0.9rem !important;
    }

    .dashboard-drawer {
        width: min(290px, calc(100vw - 1rem)) !important;
    }

    .dashboard-main-wrap {
        padding-top: 1.35rem !important;
    }

    .brand-lockup {
        gap: 0.55rem;
        max-width: 100%;
    }

    .brand-lockup-icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .brand-lockup-text {
        font-size: clamp(0.9rem, 4.2vw, 1.15rem);
    }

    .dashboard-top-panels {
        flex-direction: column;
    }

    .dashboard-top-panel-secondary {
        width: 100%;
    }

    .dashboard-status-chip {
        margin-left: 0;
    }

    .dashboard-hero-title {
        font-size: 1.9rem !important;
        line-height: 1.05;
    }

    .dashboard-hero-title .dashboard-brand-title,
    .dashboard-hero-title .dashboard-brand-line {
        display: inline;
    }

    .dashboard-hero-title .dashboard-title-suffix {
        display: none;
    }

    .dashboard-hero-title .dashboard-title-suffix::before {
        content: none;
    }

    .page-header-wrap,
    .wrap-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .mobile-actions-first {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .mobile-actions-first > :first-child {
        order: 2;
    }

    .mobile-actions-first > :last-child {
        order: 1;
    }

    .mobile-actions-first > * {
        width: 100%;
    }

    .mobile-actions-first .mud-button-root,
    .mobile-actions-first .mud-chip {
        width: 100%;
        justify-content: center;
    }

    .dashboard-status-chip {
        width: 100%;
        justify-content: center;
    }

    .mobile-actions-first .wrap-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
    }

    .mobile-actions-first .wrap-actions > * {
        width: 100%;
    }

    .token-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .token-row .mud-button-root {
        width: 100%;
        justify-content: center;
    }

    .integration-chip-list {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .integration-chip-list .mud-chip {
        width: 100%;
        justify-content: flex-start;
    }

    .auth-card {
        width: 100%;
    }

    .brand-lockup-icon-auth {
        width: 42px;
        height: 42px;
        border-radius: 10px;
    }

    .brand-lockup-text-auth {
        font-size: clamp(1.1rem, 6vw, 1.45rem);
    }

    .signal-feed-time {
        align-self: flex-start;
    }
}

@media (min-width: 960px) {
    .dashboard-appbar .mud-toolbar-appbar {
        padding-inline: 1.5rem;
    }
}

.mud-snackbar-content-success {
    background-color: #edf9f2 !important;
    color: #176847 !important;
    border: 1px solid rgba(36, 168, 108, 0.32) !important;
}
