:root {
    --ink: #13211f;
    --ink-soft: #31423f;
    --muted: #6d7a76;
    --surface: #fbfdf9;
    --surface-strong: #ffffff;
    --line: #dde7df;
    --mint: #2fbf8f;
    --mint-dark: #0f8f70;
    --blue: #2f6fed;
    --amber: #d99a28;
    --coral: #e56f5d;
    --lavender: #7367d9;
    --shadow: 0 18px 48px rgba(19, 33, 31, 0.12);
}

* {
    letter-spacing: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(180deg, #eef4ef 0%, #f7faf7 48%, #edf2ef 100%);
    color: var(--ink);
}

.app-shell {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    background: var(--surface);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.app-shell.with-bottom-action {
    padding-bottom: 104px;
}

.app-header {
    background: linear-gradient(145deg, #13211f 0%, #1c3732 58%, #1d4b42 100%);
    color: #f8fff8;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.app-title {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.1;
}

.app-subtitle {
    color: rgba(248, 255, 248, 0.78);
    font-size: 0.88rem;
    margin-top: 10px;
}

.icon-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    transition: transform 160ms ease, background 160ms ease;
}

.icon-button:active {
    transform: scale(0.96);
}

.streak-pill,
.soft-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ecfff7;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.streak-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(217, 154, 40, 0.18);
}

.content {
    padding: 22px;
}

.content-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.wellness-card {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(19, 33, 31, 0.06);
    padding: 18px;
}

.wellness-card.tone-move {
    border-left: 4px solid var(--coral);
}

.wellness-card.tone-water {
    border-left: 4px solid var(--blue);
}

.wellness-card.tone-sleep {
    border-left: 4px solid var(--lavender);
}

.section-title {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 850;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.section-kicker {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.premium-input,
.premium-select {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d9e3dc;
    background: #fbfdfb;
    color: var(--ink);
    padding: 13px 14px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.premium-input:focus,
.premium-select:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 4px rgba(47, 191, 143, 0.12);
    background: #ffffff;
}

.primary-action,
.secondary-action,
.chip-action {
    border-radius: 8px;
    font-weight: 850;
    transition: transform 160ms ease, filter 160ms ease, background 160ms ease;
}

.primary-action {
    width: 100%;
    background: linear-gradient(135deg, var(--mint-dark), var(--mint));
    color: white;
    padding: 15px 18px;
    box-shadow: 0 14px 28px rgba(15, 143, 112, 0.26);
}

.primary-action:active,
.secondary-action:active,
.chip-action:active {
    transform: scale(0.98);
}

.secondary-action {
    background: #eef6f2;
    color: var(--ink);
    padding: 11px 14px;
    border: 1px solid #d7e6dd;
}

.chip-action {
    background: #edf7f4;
    color: var(--mint-dark);
    border: 1px solid #cfe7dd;
    padding: 10px 14px;
}

.water-minus {
    background: #fff4ef !important;
    color: #b55343 !important;
    border-color: #f0d5cc !important;
}

.bottom-action {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 22px 20px;
    background: rgba(251, 253, 249, 0.92);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

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

.metric-card {
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #ffffff;
    padding: 14px 10px;
    text-align: center;
}

.metric-label {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-value {
    color: var(--ink);
    font-size: 1.32rem;
    font-weight: 900;
    margin-top: 4px;
}

.accent-move .metric-value { color: var(--coral); }
.accent-water .metric-value { color: var(--blue); }
.accent-sleep .metric-value { color: var(--lavender); }

.progress-track {
    height: 8px;
    width: 100%;
    border-radius: 999px;
    overflow: hidden;
    background: #dce9f7;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2f6fed, #41c3d6);
    transition: width 400ms ease;
}

.sidebar-panel {
    background: #fbfdf9;
    border-right: 1px solid var(--line);
}

.sidebar-brand {
    background: var(--ink);
    color: #f8fff8;
}

.nav-link,
.nav-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: var(--ink-soft);
    font-weight: 760;
    transition: background 160ms ease, color 160ms ease;
    width: 100%;
}

.nav-link:hover,
.nav-button:hover {
    background: #edf6f2;
    color: var(--mint-dark);
}

.nav-link.active {
    background: #e9f6f0;
    color: var(--mint-dark);
    border-left: 4px solid var(--mint);
}

.nav-mark {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.7;
}

.auth-overlay {
    background:
        linear-gradient(160deg, rgba(19, 33, 31, 0.96), rgba(27, 76, 67, 0.94)),
        url("icone_v2.png") center 12% / 180px auto no-repeat;
}

.auth-card {
    width: 100%;
    max-width: 360px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}

.oauth-actions {
    display: grid;
    gap: 10px;
}

.oauth-button {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 8px;
    border: 1px solid #d9e3dc;
    background: #ffffff;
    color: var(--ink);
    font-weight: 900;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.oauth-button:active {
    transform: scale(0.98);
}

.oauth-mark {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.google-mark {
    color: #ffffff;
    background: #4285f4;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    text-align: center;
}

.badge-token {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-weight: 900;
}

.rank-row,
.history-row {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(19, 33, 31, 0.06);
}

.history-metric {
    min-width: 0;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fbfdfb;
    padding: 10px 8px;
    text-align: center;
}

.history-metric-label {
    display: block;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 6px;
}

.history-metric-value {
    display: block;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.rank-row.current {
    border-color: rgba(47, 191, 143, 0.64);
    box-shadow: 0 0 0 3px rgba(47, 191, 143, 0.12);
}

.avatar {
    object-fit: cover;
    border: 2px solid #dce7df;
}

.profile-photo-wrap {
    position: relative;
    width: 106px;
    margin: 0 auto 14px;
}

.profile-photo {
    width: 104px;
    height: 104px;
    border-radius: 999px;
}

.photo-edit-button {
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid #cfe7dd;
    background: #ffffff;
    color: var(--mint-dark);
    font-size: 0.72rem;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(19, 33, 31, 0.14);
    cursor: pointer;
}

html.dark body {
    background: linear-gradient(180deg, #0f1514 0%, #121c1a 100%);
    color: #eef8f2;
}

html.dark .app-shell,
html.dark .sidebar-panel,
html.dark .wellness-card,
html.dark .metric-card,
html.dark .history-metric,
html.dark .badge-token,
html.dark .rank-row,
html.dark .history-row,
html.dark .auth-card {
    background: #14211e !important;
    border-color: #314a43 !important;
    color: #f4fff9 !important;
}

html.dark .app-header,
html.dark .sidebar-brand {
    background: linear-gradient(145deg, #10201d 0%, #173b34 100%) !important;
    border-color: #314a43 !important;
}

html.dark .app-title,
html.dark .section-title,
html.dark .metric-value,
html.dark .history-metric-value,
html.dark .rank-row,
html.dark .history-row,
html.dark .font-black,
html.dark h1,
html.dark h2,
html.dark h3 {
    color: #f6fff8 !important;
}

html.dark .app-subtitle,
html.dark .section-kicker,
html.dark .metric-label,
html.dark .history-metric-label,
html.dark .text-gray-500,
html.dark .text-gray-600,
html.dark .text-gray-700,
html.dark .text-gray-800 {
    color: #a9bab4 !important;
}

html.dark .premium-input,
html.dark .premium-select {
    background: #0e1a17 !important;
    border-color: #3b5951 !important;
    color: #f6fff8 !important;
}

html.dark .premium-input::placeholder {
    color: #9eb0aa !important;
}

html.dark .primary-action {
    background: linear-gradient(135deg, #139674, #30c596) !important;
    color: #ffffff !important;
    box-shadow: 0 16px 32px rgba(18, 151, 115, 0.24) !important;
}

html.dark .secondary-action,
html.dark .chip-action,
html.dark .photo-edit-button,
html.dark .oauth-button {
    background: #eaf7f1 !important;
    border-color: #cce6db !important;
    color: #0c6f57 !important;
}

html.dark .water-minus {
    background: #3a2420 !important;
    border-color: #704239 !important;
    color: #ff9a85 !important;
}

html.dark .soft-pill,
html.dark .streak-pill {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #f6fff8 !important;
}

html.dark .bottom-action {
    background: rgba(14, 26, 23, 0.94) !important;
    border-color: #314a43 !important;
}

html.dark .progress-track {
    background: #dce8f5 !important;
}

html.dark .progress-fill {
    background: linear-gradient(90deg, #326cff, #40c4d6) !important;
}

html.dark .nav-link,
html.dark .nav-button {
    color: #b7c8c2 !important;
    border-color: #314a43 !important;
}

html.dark .nav-link:hover,
html.dark .nav-button:hover {
    background: #1a2b27 !important;
    color: #7de0bd !important;
}

html.dark .nav-link.active {
    background: #dff4eb !important;
    color: #0c6f57 !important;
    border-left-color: #35c99a !important;
}

html.dark .rank-row.current {
    border-color: rgba(47, 191, 143, 0.72) !important;
    box-shadow: 0 0 0 3px rgba(47, 191, 143, 0.16) !important;
}

html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-t,
html.dark .border-b {
    border-color: #314a43 !important;
}

html.dark .bg-amber-50 {
    background: #fff7df !important;
}

html.dark .text-amber-700 {
    color: #7a4d00 !important;
}

html.dark .accent-move .metric-value {
    color: #ff8374 !important;
}

html.dark .accent-water .metric-value,
html.dark .text-blue-700,
html.dark .text-blue-500 {
    color: #4f80ff !important;
}

html.dark .accent-sleep .metric-value {
    color: #9188ff !important;
}

html.dark .text-red-600,
html.dark .text-red-500 {
    color: #ff5f5f !important;
}

html.dark .text-emerald-700,
html.dark .text-emerald-800 {
    color: #0c6f57 !important;
}

html.dark .bg-yellow-100.text-yellow-600,
html.dark .bg-yellow-100 {
    background: #fef3c7 !important;
    color: #ca8a04 !important;
    border-color: #facc15 !important;
}

html.dark .bg-gray-200.text-gray-600,
html.dark .bg-gray-200 {
    background: #e5e7eb !important;
    color: #4b5563 !important;
    border-color: #9ca3af !important;
}

html.dark .bg-orange-100.text-orange-700,
html.dark .bg-orange-100 {
    background: #ffedd5 !important;
    color: #c2410c !important;
    border-color: #fdba74 !important;
}
