:root {
    --bg-0: #08111f;
    --bg-1: #0d1b2a;
    --bg-2: #10233d;
    --card: rgba(15, 25, 41, 0.82);
    --card-strong: rgba(12, 20, 34, 0.96);
    --line: rgba(255, 255, 255, 0.09);
    --text: #edf4ff;
    --muted: #a9bdd9;
    --muted-2: #7d91ad;
    --accent: #57d6c1;
    --accent-2: #89a7ff;
    --danger: #ff6b6b;
    --warning: #ffd166;
    --shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(87, 214, 193, 0.17), transparent 28%),
        radial-gradient(circle at 80% 10%, rgba(137, 167, 255, 0.17), transparent 22%),
        linear-gradient(180deg, var(--bg-0), var(--bg-1) 32%, #081423 100%);
    color: var(--text);
}

body {
    overflow-x: hidden;
}

button, input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 14px 16px;
    outline: none;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

input:focus {
    border-color: rgba(87, 214, 193, 0.6);
    background: rgba(255, 255, 255, 0.06);
}

label {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hidden {
    display: none !important;
}

.shell {
    position: relative;
    width: min(100%, 720px);
    margin: 0 auto;
    min-height: 100vh;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
}

.backdrop {
    position: fixed;
    inset: auto;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    filter: blur(18px);
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
}

.backdrop-a {
    top: -80px;
    left: -120px;
    background: rgba(87, 214, 193, 0.24);
}

.backdrop-b {
    right: -100px;
    top: 160px;
    background: rgba(137, 167, 255, 0.22);
}

.auth-card, .app-card {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, rgba(18, 31, 50, 0.92), rgba(8, 15, 27, 0.95));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.auth-card {
    padding: 28px 20px 22px;
    margin-top: 18px;
}

.app-card {
    min-height: calc(100vh - 40px);
    padding: 18px 18px 100px;
}

.brand-lockup {
    display: flex;
    gap: 14px;
    align-items: center;
}

.brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: #0a1524;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 18px 40px rgba(87, 214, 193, 0.25);
}

.eyebrow {
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    font-size: 0.72rem;
}

h1, h2, h3, p {
    margin: 0;
}

h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 5vw, 2.6rem);
    line-height: 0.96;
}

h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.6rem;
}

.lead {
    margin-top: 16px;
    color: var(--muted);
    line-height: 1.55;
}

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

.login-form label {
    margin-top: 8px;
}

.primary-btn, .ghost-btn, .stamp-btn, .nav-item {
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.primary-btn {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #071321;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 18px 36px rgba(87, 214, 193, 0.25);
}

.primary-btn:hover, .ghost-btn:hover, .stamp-btn:hover, .nav-item:hover {
    transform: translateY(-1px);
}

.primary-btn:disabled, .ghost-btn:disabled, .stamp-btn:disabled {
    opacity: 0.65;
    cursor: progress;
}

.btn-arrow {
    font-size: 1.2rem;
}

.footnote {
    margin-top: 18px;
    color: var(--muted-2);
    font-size: 0.84rem;
    line-height: 1.5;
}

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

.topbar-actions {
    display: flex;
    gap: 10px;
}

.ghost-btn {
    padding: 11px 14px;
    border-radius: 14px;
    color: var(--text);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.ghost-btn.danger {
    border-color: rgba(255, 107, 107, 0.28);
    color: #ffd2d2;
}

.status-strip {
    margin-top: 18px;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(87, 214, 193, 0.12), rgba(137, 167, 255, 0.08));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.status-label {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 6px;
}

.status-chip {
    white-space: nowrap;
    padding: 10px 12px;
    border-radius: 999px;
    color: #071321;
    background: linear-gradient(135deg, var(--warning), #f7a93b);
    font-weight: 700;
    font-size: 0.86rem;
}

.tab-panel {
    display: none;
    margin-top: 18px;
    animation: fadeIn 240ms ease;
}

.tab-panel.active {
    display: block;
}

.hero-card, .section-card, .list-item, .chip, .metric-card {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.hero-card {
    padding: 18px;
    border-radius: 24px;
}

.hero-title {
    font-size: 1.7rem;
    font-family: Georgia, "Times New Roman", serif;
    margin-top: 8px;
}

.hero-text {
    margin-top: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.hero-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.metric-card {
    border-radius: 18px;
    padding: 14px;
}

.metric-label {
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.metric-hint {
    margin-top: 8px;
    color: var(--muted-2);
    font-size: 0.82rem;
    line-height: 1.35;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.section-header {
    margin: 18px 0 12px;
}

.section-header h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.section-header p {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.stamp-btn {
    width: 100%;
    padding: 18px 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffe66d, #ff8f5a);
    color: #201400;
    font-weight: 800;
    font-size: 1.08rem;
    box-shadow: 0 18px 36px rgba(255, 145, 90, 0.2);
}

.list-stack {
    display: grid;
    gap: 12px;
}

.list-item {
    border-radius: 18px;
    padding: 15px;
}

.list-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.list-title {
    font-weight: 700;
    margin-bottom: 5px;
}

.list-meta {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    padding: 10px 12px;
    border-radius: 999px;
    color: var(--text);
    font-size: 0.84rem;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(calc(100% - 24px), 720px);
    padding: 10px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(5, 12, 21, 0.94);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    z-index: 5;
}

.nav-item {
    padding: 12px 10px;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(87, 214, 193, 0.18), rgba(137, 167, 255, 0.18));
    color: var(--text);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(104px + env(safe-area-inset-bottom));
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    pointer-events: none;
    z-index: 20;
    min-width: min(92vw, 420px);
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(8, 15, 27, 0.96);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    transition: transform 220ms ease, opacity 220ms ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    border-color: rgba(255, 107, 107, 0.35);
}

.toast.success {
    border-color: rgba(87, 214, 193, 0.35);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 720px) {
    .shell {
        padding-top: 32px;
    }

    .auth-card, .app-card {
        padding-left: 24px;
        padding-right: 24px;
    }

    .hero-grid, .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
