* {
    box-sizing: border-box;
}

body {
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.08), transparent 35%),
        linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.tracker-shell {
    width: 100%;
    min-height: 100vh;
    padding: 28px 20px 80px;
    color: #111827;
}

.tracker-screen {
    display: none;
}

.tracker-screen.active-screen {
    display: block;
}

.tracker-top {
    width: min(430px, 100%);
    margin: 0 auto 28px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.tracker-top h1 {
    font-size: 30px;
    font-weight: 800;
    margin: 0;
    color: #101827;
}

.tracker-top p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 15px;
}

.tracker-top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn,
.menu-btn,
.back-btn {
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: #111827;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #6d5dfc, #4f46e5);
    color: white;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.25);
}

.tracker-tabs {
    width: min(430px, 100%);
    margin: 0 auto 24px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.tracker-tab {
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-weight: 700;
    color: #475569;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.tracker-tab.active {
    color: #5b4cff;
    border-color: #5b4cff;
}

.section-title-row {
    width: min(430px, 100%);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-row h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
    color: #111827;
}

.section-title-row span {
    background: #eef2ff;
    color: #4f46e5;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

/* DASHBOARD */

.goal-list {
    width: min(430px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.goal-card {
    position: relative;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    padding: 18px;
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.08),
        0 2px 8px rgba(15, 23, 42, 0.03);
    overflow: hidden;
    transition: 0.22s ease;
}

.goal-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 24px 55px rgba(15, 23, 42, 0.12),
        0 2px 8px rgba(15, 23, 42, 0.04);
}

.goal-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 5px;
    border-radius: 0 999px 999px 0;
}

.goal-blue::before {
    background: #4f6df5;
}

.goal-green::before {
    background: #16c79a;
}

.goal-orange::before {
    background: #f59e0b;
}

.goal-card-header {
    display: flex;
    gap: 14px;
    align-items: center;
    padding-right: 74px;
}

.goal-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 22px;
    flex: 0 0 auto;
}

.blue-icon {
    background: linear-gradient(135deg, #4f6df5, #6da3ff);
}

.green-icon {
    background: linear-gradient(135deg, #14b8a6, #34d399);
}

.orange-icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.goal-card h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.goal-card p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
}

.goal-percent-big {
    position: absolute;
    right: 20px;
    top: 56px;
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
}

.progress-track {
    height: 8px;
    margin-top: 24px;
    border-radius: 999px;
    background: #e8ebf0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
}

.blue-fill {
    background: linear-gradient(90deg, #4f6df5, #3478ff);
}

.green-fill {
    background: linear-gradient(90deg, #10b981, #22c55e);
}

.orange-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.goal-meta {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    color: #64748b;
    font-size: 14px;
}

.goal-meta strong {
    color: #3478ff;
    font-weight: 700;
}

.goal-actions {
    margin-top: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.goal-actions button {
    height: 44px;
    border-radius: 13px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.goal-actions button:first-child {
    color: #111827;
}

.goal-actions button:last-child {
    color: #111827;
}

/* DETAIL COMMON */

.detail-screen {
    width: min(470px, 100%);
    margin: 0 auto;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.14);
}

.dark-detail {
    background:
        radial-gradient(circle at 50% 0%, rgba(67, 97, 238, 0.25), transparent 34%),
        linear-gradient(180deg, #07111f 0%, #0b1220 38%, #f8fafc 38%, #ffffff 100%);
    color: white;
}

.light-detail {
    background: #ffffff;
    color: #0f172a;
    padding-bottom: 20px;
}

.detail-top {
    height: 116px;
    padding: 24px 18px 10px;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: start;
    text-align: center;
}

.detail-top h2 {
    font-size: 18px;
    font-weight: 850;
    margin: 0 0 8px;
}

.dark-detail .back-btn,
.dark-detail .menu-btn {
    color: white;
}

.status-pill {
    display: inline-block;
    background: rgba(22, 199, 154, 0.22);
    color: #15d6a3;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.green-status {
    background: #d9fbe9;
    color: #10b981;
}

.hero-progress {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 170px 1fr;
    align-items: center;
    gap: 12px;
    padding: 0 24px 32px;
}

.ring-side {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ring-side strong {
    font-size: 17px;
}

.ring-side span {
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
}

.ring-side.left {
    text-align: left;
}

.ring-side.right {
    text-align: right;
}

.ring {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        conic-gradient(#5f91ff 0deg 216deg, rgba(255,255,255,0.14) 216deg 360deg);
    box-shadow:
        inset 0 0 0 12px rgba(255,255,255,0.04),
        0 18px 45px rgba(52, 120, 255, 0.25);
}

.green-ring {
    background:
        conic-gradient(#20c997 0deg 216deg, #dff7ef 216deg 360deg);
    box-shadow: none;
}

.ring-inner {
    width: 122px;
    height: 122px;
    border-radius: 50%;
    background: #ffffff;
    display: grid;
    place-items: center;
    align-content: center;
    color: #111827;
}

.weight-ring .ring-inner {
    background: #0b1220;
    color: white;
}

.ring-inner strong {
    font-size: 40px;
    line-height: 1;
    font-weight: 900;
}

.ring-inner span {
    margin-top: 6px;
    font-size: 13px;
    color: #64748b;
}

.weight-ring .ring-inner span {
    color: rgba(255,255,255,0.75);
}

.floating-stats {
    width: calc(100% - 28px);
    margin: -18px auto 18px;
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-radius: 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.floating-stats div {
    padding: 16px 8px;
    text-align: center;
    border-right: 1px solid #eef2f7;
}

.floating-stats div:last-child {
    border-right: none;
}

.floating-stats strong {
    display: block;
    font-size: 19px;
    font-weight: 900;
}

.floating-stats span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.content-card {
    width: calc(100% - 28px);
    margin: 0 auto 16px;
    background: #ffffff;
    color: #0f172a;
    border-radius: 20px;
    padding: 16px;
    box-shadow:
        0 12px 35px rgba(15, 23, 42, 0.08),
        0 1px 4px rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.7);
}

/* ROADMAP */

.roadmap-card {
    padding: 18px 20px;
}

.roadmap-icons,
.roadmap-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.roadmap-icons {
    font-size: 22px;
}

.roadmap-line {
    height: 4px;
    background: #dfe5ee;
    border-radius: 999px;
    margin: 13px 10px 14px;
    overflow: hidden;
}

.roadmap-progress {
    width: 68%;
    height: 100%;
    border-radius: 999px;
    background: #3478ff;
}

.green-roadmap .roadmap-progress {
    background: #10b981;
}

.roadmap-labels span {
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.roadmap-labels small {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

/* CHART */

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title-row h3,
.history-card h3,
.activity-overview h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 850;
}

.card-title-row button {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 10px;
    padding: 5px 10px;
    font-weight: 700;
}

.line-chart {
    height: 155px;
    margin-top: 14px;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 33px,
            #eef2f7 34px
        );
    border-radius: 14px;
    padding: 8px;
}

.line-chart svg {
    width: 100%;
    height: 100%;
}

/* HISTORY */

.history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
}

.history-row:last-child {
    border-bottom: none;
}

.history-row span {
    color: #64748b;
}

/* INPUT */

.input-card label {
    display: block;
    font-size: 15px;
    font-weight: 850;
    margin-bottom: 12px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
}

.input-row input {
    height: 42px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    padding: 0 14px;
}

.input-row button,
.save-btn {
    height: 42px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #6d5dfc, #4f46e5);
    color: white;
    padding: 0 16px;
    font-weight: 800;
}

/* TIME DETAIL */

.light-top {
    color: #0f172a;
    height: 104px;
}

.time-hero {
    display: grid;
    grid-template-columns: 1fr 170px 1fr;
    align-items: center;
    gap: 10px;
    padding: 0 22px 24px;
    text-align: center;
}

.time-hero strong {
    display: block;
    font-size: 15px;
}

.time-hero span {
    color: #64748b;
    font-size: 13px;
}

.time-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0;
    overflow: hidden;
}

.time-stats div {
    padding: 20px;
    text-align: center;
}

.time-stats div:first-child {
    border-right: 1px solid #edf2f7;
}

.time-stats strong {
    display: block;
    color: #10b981;
    font-size: 20px;
}

.time-stats div:last-child strong {
    color: #0f172a;
}

.time-stats span {
    color: #64748b;
    font-size: 13px;
}

.activity-dots {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
}

.activity-dots span {
    width: 18px;
    height: 18px;
    background: #e5eaf1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 900;
    color: white;
}

.activity-dots .done {
    background: #10b981;
}

.water-input {
    display: grid;
    grid-template-columns: 42px 58px 42px 1fr auto;
    gap: 8px;
    align-items: center;
}

.water-input button {
    height: 42px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-weight: 900;
}

.water-input strong {
    height: 42px;
    border-radius: 12px;
    background: #f8fafc;
    display: grid;
    place-items: center;
}

.water-input .save-btn {
    background: linear-gradient(135deg, #10b981, #14b8a6);
    color: white;
    border: none;
    padding: 0 18px;
}

/* EMPTY */

.empty-state-screen {
    width: min(680px, 100%);
    margin: 70px auto 0;
}

.empty-card {
    background: white;
    border-radius: 28px;
    padding: 40px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 30px;
    align-items: center;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.1);
}

.empty-illustration {
    height: 170px;
    border-radius: 24px;
    background: linear-gradient(135deg, #ede9fe, #f5f3ff);
    display: grid;
    place-items: center;
    font-size: 70px;
}

.empty-card h2 {
    font-size: 26px;
    margin: 0 0 10px;
}

.empty-card p {
    color: #64748b;
    margin-bottom: 22px;
}

/* COMPLETED */

.completed-screen {
    width: min(850px, 100%);
    margin: 40px auto 0;
}

.completed-wrapper {
    background: white;
    border-radius: 28px;
    padding: 26px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.1);
}

.completed-tabs {
    width: 100%;
}

.completed-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.completed-card {
    position: relative;
    min-height: 190px;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 20px 20px 20px 62px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
}

.completed-check {
    position: absolute;
    left: 20px;
    top: 20px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    display: grid;
    place-items: center;
    font-weight: 900;
}

.completed-card h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.completed-status {
    color: #10b981;
    font-weight: 800;
    margin: 0;
}

.completed-card p {
    color: #64748b;
    margin: 7px 0;
    font-size: 13px;
}

.completed-card strong {
    display: block;
    margin: 10px 0;
    font-size: 14px;
}

.completed-card button {
    height: 36px;
    width: 100%;
    border-radius: 11px;
    border: 1px solid #e2e8f0;
    background: white;
    font-weight: 800;
}

.mini-chart {
    height: 42px;
    margin: 8px 0 12px;
}

.mini-chart svg {
    width: 100%;
    height: 100%;
}

.mini-dots {
    display: grid;
    grid-template-columns: repeat(5, 10px);
    gap: 7px;
    margin: 14px 0 20px;
}

.mini-dots span {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
}

/* RESPONSIVE */

@media (min-width: 1000px) {
    .tracker-shell {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        gap: 44px;
    }

    .tracker-screen.active-screen {
        width: min(470px, 100%);
    }

    #trackerDashboard.active-screen {
        width: 430px;
    }

    #completedGoals.active-screen {
        width: 850px;
    }

    #emptyState.active-screen {
        width: 680px;
    }
}

@media (max-width: 560px) {
    .tracker-shell {
        padding: 18px 12px 60px;
    }

    .tracker-top {
        align-items: center;
    }

    .primary-btn {
        padding: 0 12px;
        font-size: 14px;
    }

    .hero-progress,
    .time-hero {
        grid-template-columns: 1fr;
    }

    .ring-side {
        display: none;
    }

    .floating-stats {
        grid-template-columns: 1fr;
    }

    .floating-stats div {
        border-right: none;
        border-bottom: 1px solid #eef2f7;
    }

    .floating-stats div:last-child {
        border-bottom: none;
    }

    .completed-grid,
    .empty-card {
        grid-template-columns: 1fr;
    }

    .empty-card {
        padding: 24px;
    }

    .water-input {
        grid-template-columns: 42px 58px 42px 1fr;
    }

    .water-input .save-btn {
        grid-column: 1 / -1;
    }
}

/* ========================================= */
/* TRACKER UI POLISH V2 */
/* dodaj na konec trackerStyle.css */
/* ========================================= */

.tracker-shell {
    padding-top: 36px;
}

.goal-card {
    min-height: 230px;
}

.goal-card-header {
    margin-bottom: 10px;
}

.goal-icon {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.goal-actions button {
    transition: 0.2s ease;
}

.goal-actions button:hover {
    transform: translateY(-2px);
    background: #f8fafc;
}

.goal-actions button:first-child {
    background: #ffffff;
}
/*
.goal-actions button:first-child::before {
    content: "+ ";
    font-weight: 900;
}*/

.dark-detail {
    border-radius: 34px;
}

.detail-top {
    padding-top: 26px;
}

.hero-progress {
    padding-bottom: 40px;
}

.ring {
    position: relative;
}

.ring::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.light-detail .ring::after {
    border-color: rgba(16, 185, 129, 0.12);
}

.ring-inner {
    box-shadow: inset 0 0 18px rgba(15, 23, 42, 0.05);
}

.floating-stats {
    transform: translateY(-6px);
}

.content-card {
    transition: 0.2s ease;
}

.content-card:hover {
    transform: translateY(-2px);
}

.roadmap-card {
    margin-top: 4px;
}

.roadmap-icons span:nth-child(2) {
    background: #eef2ff;
    color: #4f46e5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.16);
}

.green-roadmap .roadmap-icons span:nth-child(2) {
    background: #dcfce7;
    color: #10b981;
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.16);
}

.line-chart {
    position: relative;
    overflow: hidden;
}

.line-chart::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(52, 120, 255, 0.05),
        transparent
    );
    pointer-events: none;
}

.history-row strong {
    color: #0f172a;
}

.input-card {
    margin-bottom: 24px;
}

.input-row input:focus {
    outline: none;
    border-color: #6d5dfc;
    box-shadow: 0 0 0 4px rgba(109, 93, 252, 0.12);
}

.primary-btn:hover,
.input-row button:hover,
.save-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.completed-card {
    transition: 0.2s ease;
}

.completed-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.09);
}

.empty-card {
    background:
        linear-gradient(135deg, rgba(255,255,255,0.96), rgba(255,255,255,0.9)),
        radial-gradient(circle at left, rgba(109, 93, 252, 0.12), transparent 45%);
}

/* test buttons za dev preview */
.tracker-dev-switcher {
    width: min(430px, 100%);
    margin: 0 auto 18px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tracker-dev-switcher button {
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 800;
}

.single-action {
    grid-template-columns: 1fr;
}

.single-action button {
    width: 100%;
}

/* ===================================== */
/* CALORIES */
/* ===================================== */

.goal-red::before {
    background: #ef4444;
}

.red-icon {
    background:
        linear-gradient(
            135deg,
            #ef4444,
            #f87171
        );
}

.red-fill {
    background:
        linear-gradient(
            90deg,
            #ef4444,
            #f87171
        );
}

.calories-status {
    background: #fee2e2;
    color: #ef4444;
}

.calories-ring {
    background:
        conic-gradient(
            #ef4444 0deg 263deg,
            #fee2e2 263deg 360deg
        );
}

.calories-save {
    background:
        linear-gradient(
            135deg,
            #ef4444,
            #f87171
        ) !important;
}

h2 {
    color: black !important;
}

/* ========================= */
/* EXERCISE */
/* ========================= */

.goal-purple::before {
    background: #8b5cf6;
}

.purple-icon {
    background:
        linear-gradient(
            135deg,
            #8b5cf6,
            #a78bfa
        );
}

.purple-fill {
    background:
        linear-gradient(
            90deg,
            #8b5cf6,
            #a78bfa
        );
}

.exercise-status {
    background: #ede9fe;
    color: #8b5cf6;
}

.exercise-ring {
    background:
        conic-gradient(
            #8b5cf6 0deg 220deg,
            #ede9fe 220deg 360deg
        );
}

.exercise-roadmap .roadmap-progress {
    background: #8b5cf6;
}

.exercise-save {
    background:
        linear-gradient(
            135deg,
            #8b5cf6,
            #a78bfa
        ) !important;
}