:root {
    --bg: #081217;
    --bg-soft: #0d1b22;
    --glass: rgba(255, 255, 255, 0.08);
    --glass-strong: rgba(255, 255, 255, 0.12);
    --border: rgba(255, 255, 255, 0.14);
    --text: #f4fbfc;
    --muted: #9eb3b9;
    --accent: #a8f4e4;
    --accent-2: #83bad7;
    --danger: #ffb0b0;
    --shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 15%, rgba(120, 208, 199, .11), transparent 26%),
        radial-gradient(circle at 85% 20%, rgba(113, 166, 204, .10), transparent 28%),
        linear-gradient(145deg, #061015 0%, #0b171d 50%, #071116 100%);
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.mist-page, .dashboard-page { position: relative; }

.mist-blob {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .22;
    pointer-events: none;
    z-index: 0;
}

.blob-one { top: -140px; left: -120px; background: #77e5d3; }
.blob-two { right: -160px; top: 18%; background: #7aaad6; }
.blob-three { left: 35%; bottom: -220px; background: #b5ddd5; }

.glass-card, .glass-panel {
    background: var(--glass);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 430px);
    border-radius: 30px;
    padding: 38px;
}

.brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: -.04em;
    color: #071116;
    background: linear-gradient(145deg, #d9fff8, #86c8c0);
    box-shadow: inset 0 1px rgba(255,255,255,.8), 0 12px 30px rgba(112, 224, 204, .15);
    margin-bottom: 28px;
}

.brand-mark.small {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    margin: 0;
    font-size: .9rem;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .18em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2rem, 5vw, 2.6rem); letter-spacing: -.045em; }
h2 { margin-bottom: 10px; font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -.04em; }
h3 { margin-bottom: 0; font-size: 1.2rem; }

.muted { color: var(--muted); line-height: 1.7; }

.login-form {
    display: grid;
    gap: 12px;
    margin-top: 30px;
}

label { color: #dce8ea; font-size: .88rem; font-weight: 600; }
.label-row { display: flex; align-items: center; justify-content: space-between; }

input {
    width: 100%;
    border: 1px solid rgba(255,255,255,.12);
    color: var(--text);
    background: rgba(2, 10, 14, .48);
    outline: none;
    border-radius: 15px;
    padding: 14px 15px;
    margin-bottom: 6px;
    transition: .2s ease;
}

input:focus {
    border-color: rgba(168,244,228,.55);
    box-shadow: 0 0 0 4px rgba(168,244,228,.07);
}

.text-button, .ghost-button, .menu-button {
    border: 0;
    color: var(--accent);
    background: transparent;
    cursor: pointer;
}

.primary-button {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    border-radius: 15px;
    padding: 15px 17px;
    color: #061015;
    background: linear-gradient(135deg, #d4fff7, #8bd3c7);
    font-weight: 750;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.primary-button:hover { transform: translateY(-2px); box-shadow: 0 16px 35px rgba(113, 219, 201, .17); }
.button-link { text-align: center; justify-content: center; }

.alert {
    margin: 20px 0 0;
    padding: 12px 14px;
    border-radius: 14px;
    color: #ffd2d2;
    background: rgba(255, 103, 103, .10);
    border: 1px solid rgba(255, 133, 133, .16);
    font-size: .9rem;
    line-height: 1.5;
}

.alert.info, .alert.success { color: #d2fff7; background: rgba(107, 217, 197, .09); border-color: rgba(107,217,197,.16); }
.setup-note { margin: 24px 0 0; color: var(--muted); font-size: .8rem; text-align: center; line-height: 1.5; }
.setup-note code, .setup-card code { color: var(--accent); }
.setup-card .primary-button { margin-top: 24px; }

.dashboard-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 18px;
    padding: 18px;
}

.sidebar {
    position: sticky;
    top: 18px;
    height: calc(100vh - 36px);
    border-radius: 24px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-row strong { display: block; font-size: .95rem; }
.brand-row span, .profile-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: .72rem; }

.nav-menu { display: grid; gap: 8px; margin-top: 42px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border-radius: 13px;
    color: #b9c8cc;
    font-size: .9rem;
    transition: .2s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.08); }
.nav-link span { color: var(--accent); width: 18px; text-align: center; }
.logout-link { margin-top: 20px; }

.dashboard-main { min-width: 0; display: grid; align-content: start; gap: 18px; }

.topbar {
    border-radius: 24px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
}
.topbar h1 { font-size: 1.35rem; margin: 0; letter-spacing: -.025em; }
.topbar .eyebrow { margin-bottom: 5px; }
.menu-button { display: none; font-size: 1.35rem; color: var(--text); }
.profile-pill { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.avatar, .large-avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(211,255,247,.95), rgba(126,199,187,.9));
    color: #071116;
    font-weight: 800;
}
.avatar { width: 40px; height: 40px; }
.large-avatar { width: 76px; height: 76px; margin: 25px auto 14px; font-size: 1.5rem; }
.profile-copy strong { font-size: .82rem; }

.hero-card {
    border-radius: 28px;
    min-height: 220px;
    padding: clamp(26px, 5vw, 46px);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
    position: relative;
}
.hero-card::after {
    content: '';
    position: absolute;
    width: 240px;
    height: 240px;
    right: -80px;
    top: -80px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 0 0 34px rgba(255,255,255,.025), 0 0 0 68px rgba(255,255,255,.018);
}
.hero-card > * { position: relative; z-index: 1; }
.hero-card .muted { max-width: 680px; margin-bottom: 0; }
.status-orb { display: flex; align-items: center; gap: 8px; color: #d9f9f3; font-size: .85rem; white-space: nowrap; }
.status-orb span { width: 9px; height: 9px; border-radius: 50%; background: #9ce7d8; box-shadow: 0 0 18px #9ce7d8; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; }
.stat-card { border-radius: 22px; padding: 22px; }
.stat-icon { color: var(--accent); font-size: 1.25rem; }
.stat-card p { margin: 26px 0 7px; color: var(--muted); font-size: .82rem; }
.stat-card strong { display: block; font-size: 1.85rem; letter-spacing: -.04em; }
.stat-card small { display: block; margin-top: 7px; color: #85aaa8; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(250px, .7fr); gap: 18px; }
.panel-card { border-radius: 24px; padding: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.ghost-button { padding: 8px 11px; border: 1px solid var(--border); border-radius: 11px; }
.activity-list { margin-top: 24px; display: grid; }
.activity-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 13px; align-items: start; padding: 16px 0; border-top: 1px solid rgba(255,255,255,.07); }
.activity-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(168,244,228,.5); }
.activity-item strong { font-size: .9rem; }
.activity-item p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.activity-item time { color: #789196; font-size: .72rem; }
.account-card { text-align: center; }
.account-card h3 { text-align: left; }
.account-card > strong, .account-card > span { display: block; }
.account-card > span { margin-top: 5px; color: var(--muted); font-size: .8rem; word-break: break-all; }
.role-badge { display: inline-flex; margin-top: 18px; padding: 7px 10px; border-radius: 999px; color: var(--accent); background: rgba(168,244,228,.08); border: 1px solid rgba(168,244,228,.13); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

@media (max-width: 1000px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .dashboard-layout { grid-template-columns: 1fr; padding: 10px; }
    .sidebar {
        position: fixed;
        z-index: 20;
        left: 10px;
        top: 10px;
        width: min(78vw, 280px);
        height: calc(100vh - 20px);
        transform: translateX(calc(-100% - 20px));
        transition: transform .25s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .menu-button { display: block; }
    .profile-copy { display: none; }
    .topbar { border-radius: 20px; }
    .hero-card { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
    .login-card { padding: 28px 22px; border-radius: 24px; }
    .stats-grid { grid-template-columns: 1fr; }
    .topbar { padding: 15px; }
    .topbar h1 { font-size: 1.05rem; }
    .hero-card, .panel-card { border-radius: 20px; }
}
