:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #eef2f7;
    --text: #111827;
    --muted: #667085;
    --line: #e5e7eb;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    font: inherit;
    background: #fff;
    color: var(--text);
}

label {
    display: block;
    margin: 1rem 0 0.4rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.app-shell {
    width: 100%;
    min-height: 100vh;
}

.app-main {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 1rem 1rem 6rem;
}

.auth-screen {
    min-height: 100vh;
    display: grid;
    align-content: center;
    gap: 1rem;
}

.brand-card,
.auth-card,
.metric-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.brand-card {
    padding: 1.5rem;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.eyebrow {
    margin: 1rem 0 0.35rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 800;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 8vw, 4rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

h2 {
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
}

.muted-text,
.metric-card p,
.panel p {
    color: var(--muted);
    line-height: 1.55;
}

.auth-card {
    padding: 1.25rem;
}

.form-alert,
.message-error {
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    background: var(--danger-bg);
    color: var(--danger-text);
    font-size: 0.9rem;
    font-weight: 600;
}

.primary-button {
    width: 100%;
    margin-top: 1.25rem;
    border: 0;
    border-radius: 999px;
    padding: 0.95rem 1rem;
    background: var(--primary);
    color: white;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.primary-button:hover {
    background: var(--primary-dark);
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0 0.5rem;
}

.dashboard-header h1 {
    margin-bottom: 0.5rem;
}

.user-pill {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.metric-card {
    padding: 1.2rem;
}

.card-label {
    display: inline-block;
    margin-bottom: 0.8rem;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.metric-card strong {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 1.55rem;
    letter-spacing: -0.04em;
}

.panel {
    margin-top: 1rem;
    padding: 1.25rem;
}

.bottom-nav {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    max-width: 620px;
    margin: 0 auto;
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 24px;
    padding: 0.45rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.bottom-nav-item {
    display: grid;
    place-items: center;
    gap: 0.12rem;
    border-radius: 18px;
    padding: 0.55rem 0.25rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.bottom-nav-item.active {
    background: var(--primary);
    color: #fff;
}

.bottom-nav-item.muted {
    opacity: 0.58;
}

.bottom-nav-icon {
    font-size: 1rem;
    line-height: 1;
}

.messages {
    width: min(100% - 2rem, 980px);
    margin: 1rem auto 0;
}

.message {
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

@media (min-width: 720px) {
    .app-main {
        padding-top: 2rem;
    }

    .auth-screen {
        grid-template-columns: 1.1fr 0.9fr;
        align-items: center;
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
