@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;700&display=swap');

:root {
    color-scheme: dark;
    --elma-bg: #07131f;
    --elma-bg-soft: #0d1d2d;
    --elma-panel: rgba(9, 19, 31, 0.78);
    --elma-panel-strong: rgba(10, 23, 38, 0.92);
    --elma-border: rgba(126, 164, 210, 0.22);
    --elma-border-strong: rgba(147, 189, 241, 0.36);
    --elma-text: #f1f7ff;
    --elma-text-soft: #b1c6dd;
    --elma-accent: #36c4ff;
    --elma-accent-strong: #00a6ff;
    --elma-highlight: #ffd166;
    --elma-success: #40d39c;
    --elma-danger: #ff6b6b;
    --elma-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
    --elma-radius-xl: 28px;
    --elma-radius-lg: 22px;
    --elma-radius-md: 16px;
    --elma-font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
    --elma-font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(54, 196, 255, 0.18), transparent 30%),
        radial-gradient(circle at right 12%, rgba(255, 209, 102, 0.16), transparent 24%),
        linear-gradient(135deg, #07131f 0%, #0a1726 42%, #13273a 100%);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--elma-text);
    font-family: var(--elma-font-body);
    line-height: 1.5;
    background: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-shell,
.app-shell {
    position: relative;
    min-height: 100vh;
}

.auth-shell::before,
.app-shell::before,
body.legacy-shell::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 35%),
        linear-gradient(300deg, rgba(0, 166, 255, 0.08), transparent 28%);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(340px, 1.1fr) minmax(320px, 0.9fr);
    gap: 28px;
    padding: 32px;
    align-items: stretch;
}

.auth-shell__panel,
.auth-shell__card,
.app-shell__frame,
.legacy-shell #content {
    border: 1px solid var(--elma-border);
    border-radius: var(--elma-radius-xl);
    background: var(--elma-panel);
    backdrop-filter: blur(18px);
    box-shadow: var(--elma-shadow);
}

.auth-shell__panel {
    position: relative;
    overflow: hidden;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-shell__panel::after {
    content: '';
    position: absolute;
    inset: auto -10% -18% auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 209, 102, 0.4), transparent 65%);
    filter: blur(10px);
}

.auth-shell__eyebrow,
.app-shell__eyebrow,
.dashboard-card__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.76rem;
    color: var(--elma-text-soft);
}

.auth-shell__title,
.app-shell__title,
.dashboard-hero__title {
    margin: 18px 0 14px;
    font-family: var(--elma-font-display);
    font-size: clamp(2.4rem, 4vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.auth-shell__copy,
.dashboard-hero__copy {
    max-width: 42rem;
    color: var(--elma-text-soft);
    font-size: 1.05rem;
}

.auth-shell__meta {
    display: grid;
    gap: 14px;
    margin-top: 32px;
}

.auth-shell__meta-card,
.dashboard-hero__stat,
.app-shell__status,
.dashboard-card {
    border: 1px solid rgba(147, 189, 241, 0.16);
    border-radius: var(--elma-radius-lg);
    background: rgba(8, 18, 30, 0.62);
}

.auth-shell__meta-card {
    padding: 18px 20px;
}

.auth-shell__card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.auth-card {
    width: min(100%, 440px);
}

.auth-card__title {
    margin: 0 0 10px;
    font-family: var(--elma-font-display);
    font-size: 2rem;
}

.auth-card__copy,
.auth-card__message,
.app-shell__subtitle,
.dashboard-card__copy {
    color: var(--elma-text-soft);
}

.auth-card__message {
    min-height: 1.5rem;
    margin: 0 0 18px;
}

.auth-card__message--error {
    color: #ffb5b5;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form__field {
    display: grid;
    gap: 8px;
}

.auth-form__label,
.dashboard-card__title,
.app-shell__nav-title {
    font-weight: 600;
}

.auth-form__control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(147, 189, 241, 0.22);
    border-radius: 14px;
    background: rgba(5, 14, 24, 0.75);
    color: var(--elma-text);
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-form__control:focus {
    outline: none;
    border-color: rgba(54, 196, 255, 0.72);
    box-shadow: 0 0 0 4px rgba(54, 196, 255, 0.16);
    transform: translateY(-1px);
}

.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    color: #06121e;
    font-weight: 700;
    background: linear-gradient(135deg, var(--elma-highlight), #ffb703);
    box-shadow: 0 20px 40px rgba(255, 183, 3, 0.18);
}

.button-primary:hover {
    transform: translateY(-1px);
}

.button-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(147, 189, 241, 0.22);
    border-radius: 14px;
    color: var(--elma-text);
    background: rgba(5, 14, 24, 0.4);
}

.app-shell {
    padding: 24px;
}

.app-shell__frame {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.app-shell__topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.app-shell__brand {
    display: flex;
    gap: 18px;
    align-items: center;
}

.app-shell__logo {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    object-fit: cover;
    border: 1px solid rgba(147, 189, 241, 0.18);
    background: rgba(255, 255, 255, 0.06);
    padding: 10px;
}

.app-shell__title {
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.app-shell__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.app-shell__status {
    min-width: 180px;
    padding: 16px 18px;
}

.app-shell__status-label {
    display: block;
    color: var(--elma-text-soft);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.app-shell__status-value {
    display: block;
    margin-top: 6px;
    font-size: 1.15rem;
    font-weight: 600;
}

.app-shell__body {
    display: grid;
    grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
    gap: 24px;
}

.app-shell__nav {
    padding: 20px;
    border: 1px solid rgba(147, 189, 241, 0.14);
    border-radius: var(--elma-radius-lg);
    background: rgba(8, 18, 30, 0.62);
}

.app-shell__nav-list {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.app-shell__nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    color: var(--elma-text-soft);
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.app-shell__nav-link:hover,
.app-shell__nav-link.is-active {
    color: var(--elma-text);
    background: rgba(54, 196, 255, 0.12);
    transform: translateX(3px);
}

.app-shell__content {
    min-width: 0;
}

.dashboard-hero {
    display: grid;
    gap: 24px;
    margin-bottom: 28px;
}

.dashboard-hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-hero__stat {
    padding: 18px 20px;
}

.dashboard-hero__stat-value {
    display: block;
    margin-top: 8px;
    font-family: var(--elma-font-display);
    font-size: 1.8rem;
    letter-spacing: -0.04em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.dashboard-card {
    height: 100%;
    padding: 22px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    border-color: var(--elma-border-strong);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.24);
}

.dashboard-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 66px;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    color: #08131f;
    font-family: var(--elma-font-display);
    font-size: 0.86rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.95), rgba(54, 196, 255, 0.95));
}

.dashboard-card__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    color: #08131f;
    font-weight: 700;
    background: var(--elma-highlight);
}

.dashboard-card__title {
    margin: 18px 0 8px;
    font-size: 1.15rem;
}

body.legacy-shell {
    color: var(--elma-text);
    background: transparent !important;
}

.legacy-shell .navigation-bar {
    max-width: 1400px;
    margin: 24px auto 0;
    border: 1px solid var(--elma-border) !important;
    border-radius: var(--elma-radius-xl);
    background: rgba(8, 18, 30, 0.74) !important;
    box-shadow: var(--elma-shadow);
}

.legacy-shell .navigation-bar-content.container,
.legacy-shell .navigation-bar-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    min-height: 96px;
    padding: 16px 22px !important;
}

.legacy-shell .navigation-bar .element,
.legacy-shell .navigation-bar .element-divider {
    color: var(--elma-text) !important;
}

.legacy-shell .navigation-bar .element:hover {
    color: #ffffff !important;
    background: rgba(54, 196, 255, 0.12) !important;
    border-radius: 999px;
}

.legacy-shell #content {
    max-width: 1400px;
    margin: 24px auto 48px;
    padding: 26px;
}

.legacy-shell .table,
.legacy-shell table {
    color: var(--elma-text);
}

.legacy-shell .table.bordered,
.legacy-shell .table td,
.legacy-shell .table th {
    border-color: rgba(147, 189, 241, 0.12) !important;
}

.legacy-shell .tile {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.legacy-shell input,
.legacy-shell select,
.legacy-shell textarea {
    border-radius: 12px !important;
}

@media (max-width: 1100px) {
    .auth-shell,
    .app-shell__body,
    .dashboard-hero__stats {
        grid-template-columns: 1fr;
    }

    .app-shell__frame,
    .legacy-shell #content,
    .auth-shell__panel,
    .auth-shell__card {
        padding: 22px;
    }
}

@media (max-width: 720px) {
    .auth-shell,
    .app-shell {
        padding: 16px;
    }

    .auth-shell__title,
    .app-shell__title,
    .dashboard-hero__title {
        font-size: clamp(2rem, 10vw, 2.8rem);
    }

    .app-shell__brand {
        align-items: flex-start;
    }

    .app-shell__logo {
        width: 68px;
        height: 68px;
    }
}
