/* ============================================================
   MB Fitness — dashboard, program ızgarası, takvim, ölçüm
   ============================================================ */

/* ---------------------------------------------------------- dashboard */

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.dash-grid .wide { grid-column: 1 / -1; }

.tile {
    background: var(--surface); border: 1px solid var(--line-soft);
    border-radius: var(--r); padding: 14px;
    display: flex; flex-direction: column; gap: 2px; min-height: 92px;
    position: relative; overflow: hidden;
}
.tile .tl {
    font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--text-mute); font-weight: 700; display: flex; align-items: center; gap: 6px;
}
.tile .tv { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.tile .tv small { font-size: 12px; font-weight: 600; color: var(--text-mute); margin-left: 3px; letter-spacing: 0; }
.tile .ts { font-size: 12px; color: var(--text-dim); }
.tile.accent { border-color: rgba(201, 249, 78, .28); }
.tile.accent .tl { color: var(--accent); }

.ico {
    width: 26px; height: 26px; border-radius: 8px; flex: none;
    display: grid; place-content: center; font-size: 13px;
}
.ico.lime { background: var(--accent-dim); color: var(--accent); }
.ico.blue { background: rgba(76, 201, 240, .14); color: var(--water); }
.ico.orange { background: rgba(255, 138, 76, .14); color: var(--cardio); }
.ico.red { background: rgba(255, 95, 109, .14); color: var(--danger); }

/* 14 günlük nokta şeridi */
.daystrip { display: flex; gap: 5px; margin-top: 10px; }
.daystrip > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.daystrip .box {
    width: 100%; aspect-ratio: 1; border-radius: 6px;
    background: var(--surface-2); border: 1px solid var(--line);
    display: grid; place-content: center; font-size: 9.5px; font-weight: 700; color: var(--text-mute);
}
.daystrip .box.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.daystrip .box.today { border-color: var(--text-dim); }
.daystrip .lb { font-size: 9px; color: var(--text-mute); }

.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.shortcut {
    border-radius: var(--r); padding: 16px 14px; min-height: 86px;
    display: flex; flex-direction: column; justify-content: space-between;
    border: 1px solid var(--line-soft); background: var(--surface);
}
.shortcut .st { font-size: 14.5px; font-weight: 700; }
.shortcut .ss { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }
.shortcut .arrow { align-self: flex-end; color: var(--text-mute); font-size: 15px; }

/* ---------------------------------------------------------- program ızgarası */

.day-head {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(100deg, #223016, var(--surface-2));
    border: 1px solid #2E4020; border-radius: var(--r);
    padding: 12px 14px; margin: 20px 0 10px;
}
.day-head .no {
    width: 26px; height: 26px; border-radius: 8px; flex: none;
    background: var(--accent); color: var(--accent-ink);
    display: grid; place-content: center; font-size: 13px; font-weight: 800;
}
.day-head .tx { flex: 1; min-width: 0; }
.day-head .tx b { font-size: 15px; font-weight: 700; }
.day-head .tx span { display: block; font-size: 11.5px; color: var(--text-dim); }
.day-head .go {
    flex: none; height: 32px; padding: 0 13px; border-radius: var(--r-pill);
    background: var(--accent); color: var(--accent-ink); border: none;
    font-size: 12.5px; font-weight: 700;
}

.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ex-tile {
    background: var(--surface); border: 1px solid var(--line-soft);
    border-radius: var(--r); padding: 12px; position: relative;
    display: flex; flex-direction: column; gap: 3px;
}
.ex-tile .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ex-tile .no { font-size: 12px; font-weight: 800; color: var(--text-mute); }
.ex-tile .nm { font-size: 13.5px; font-weight: 700; line-height: 1.25; margin-top: 4px; }
.ex-tile .tr { font-size: 11.5px; color: var(--text-dim); line-height: 1.3; }
.ex-tile .sr { font-size: 11.5px; font-weight: 600; color: var(--text); margin-top: 2px; }
.ex-tile .rs { font-size: 11px; color: var(--water); margin-top: 3px; }
.ex-tile .bl { font-size: 10px; font-weight: 700; color: var(--accent); letter-spacing: .06em; }
.ex-tile.b-b { border-color: rgba(76, 201, 240, .22); }
.ex-tile.b-b .bl { color: var(--water); }

/* video ikonu */
.vbtn {
    flex: none; width: 30px; height: 22px; border-radius: 5px;
    background: #E62117; color: #fff;
    display: grid; place-content: center;
    box-shadow: 0 2px 8px rgba(230, 33, 23, .28);
}
.vbtn svg { width: 18px; height: 18px; }
.vbtn.ghost { background: var(--surface-2); border: 1px solid var(--line); color: var(--text-mute); box-shadow: none; }
.vbtn.lg { width: 40px; height: 29px; border-radius: 7px; }
.vbtn.lg svg { width: 23px; height: 23px; }

/* ---------------------------------------------------------- takvim */

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head b { font-size: 15px; }
.cal-head button {
    width: 32px; height: 32px; border-radius: var(--r-pill);
    background: var(--surface-2); border: 1px solid var(--line); color: var(--text-dim); font-size: 14px;
}
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: 9.5px; color: var(--text-mute); text-align: center; font-weight: 700; padding-bottom: 4px; }
.cal .cell {
    aspect-ratio: 1; border-radius: 8px; background: var(--surface-2);
    border: 1px solid var(--line-soft);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.cal .cell.empty { background: transparent; border-color: transparent; }
.cal .cell .d { font-size: 11.5px; color: var(--text-dim); font-weight: 600; }
.cal .cell .n { font-size: 8.5px; font-weight: 800; }
.cal .cell.done { background: var(--accent-dim); border-color: rgba(201, 249, 78, .35); }
.cal .cell.done .d, .cal .cell.done .n { color: var(--accent); }
.cal .cell.today { border-color: var(--text-dim); }

/* ---------------------------------------------------------- accordion */

.acc { border-bottom: 1px solid var(--line-soft); }
.acc:last-child { border-bottom: none; }
.acc > button {
    width: 100%; background: none; border: none; color: var(--text);
    display: flex; align-items: center; gap: 10px; text-align: left;
    padding: 14px 0; font-size: 14.5px; font-weight: 600;
}
.acc > button .chev { margin-left: auto; color: var(--text-mute); font-size: 12px; transition: transform .2s; }
.acc.open > button .chev { transform: rotate(90deg); }
.acc .body { font-size: 13px; color: var(--text-dim); line-height: 1.6; padding: 0 0 14px; }

/* ---------------------------------------------------------- ölçüm */

.m-card {
    background: var(--surface); border: 1px solid var(--line-soft);
    border-radius: var(--r); padding: 16px; margin-bottom: 12px;
}
.m-card .mh { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.m-card .badge {
    font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: var(--r-pill);
    background: var(--accent-dim); color: var(--accent); letter-spacing: .04em;
}
.m-card .mh .dt { font-size: 15.5px; font-weight: 700; }
.m-card .mh .tm { font-size: 11.5px; color: var(--text-mute); }

.m-vals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.m-val {
    background: var(--surface-2); border: 1px solid var(--line-soft);
    border-radius: var(--r-sm); padding: 10px 10px 11px;
}
.m-val .k { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); font-weight: 700; }
.m-val .v { font-size: 17px; font-weight: 700; margin-top: 2px; }
.m-val .v small { font-size: 10.5px; color: var(--text-mute); font-weight: 500; margin-left: 2px; }
.m-val .dd { font-size: 10.5px; font-weight: 700; margin-top: 1px; }

.photo-label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); font-weight: 700; margin: 16px 0 8px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo {
    border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2);
    border: 1px solid var(--line); position: relative; aspect-ratio: 3 / 4;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .cap {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, .82));
    font-size: 10px; font-weight: 600; padding: 14px 6px 5px; text-align: center; color: #fff;
}
.photo.slot {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    border-style: dashed; color: var(--text-mute); font-size: 10px; font-weight: 600; text-align: center; padding: 6px;
}
.photo .del {
    position: absolute; top: 5px; right: 5px; width: 22px; height: 22px;
    border-radius: var(--r-pill); background: rgba(0, 0, 0, .6); border: none;
    color: #fff; font-size: 11px; display: grid; place-content: center; z-index: 2;
}
.photo input[type=file] { position: absolute; inset: 0; opacity: 0; }

.viewer {
    position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, .94);
    display: grid; place-content: center; padding: 16px;
}
.viewer-stage {
    max-width: 100%; max-height: 86dvh; overflow: hidden;
    border-radius: var(--r-sm);
    touch-action: none;   /* pinch/pan JS tarafindan yonetiliyor */
}
.viewer img {
    max-width: 100%; max-height: 86dvh; display: block;
    transform-origin: center center;
    will-change: transform;
    user-select: none; -webkit-user-drag: none;
}
.viewer-hint {
    position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 18px);
    text-align: center; font-size: 11.5px; color: rgba(255, 255, 255, .55);
    pointer-events: none;
}
.viewer .x {
    position: absolute; top: calc(var(--safe-t) + 14px); right: 16px;
    width: 38px; height: 38px; border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .12); border: none; color: #fff; font-size: 17px;
}

/* ---------------------------------------------------------- yardımcılar */

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.icon-btn {
    width: 34px; height: 34px; flex: none; border-radius: var(--r-sm);
    background: var(--surface-2); border: 1px solid var(--line);
    color: var(--text-mute); font-size: 13px; display: grid; place-content: center;
}
.icon-btn.danger { color: var(--danger); border-color: rgba(255, 95, 109, .3); }

.fab {
    position: fixed; right: 18px; z-index: 45;
    bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
    width: 54px; height: 54px; border-radius: var(--r-pill);
    background: var(--accent); color: var(--accent-ink); border: none;
    font-size: 26px; font-weight: 300; display: grid; place-content: center;
    box-shadow: 0 8px 24px rgba(201, 249, 78, .22);
}

.seg { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px; }
.seg button { flex: 1; border: none; background: transparent; color: var(--text-dim); padding: 10px 8px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
    width: 38px; height: 38px; border-radius: var(--r-sm);
    background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 17px;
}
.stepper .val { font-size: 17px; font-weight: 700; min-width: 84px; text-align: center; }

/* Core+ — hocanın programına sonradan eklenen opsiyonel hareketler */
.ex-tile.opt, .ex-card.opt { border-color: rgba(255, 138, 76, .3); border-style: dashed; }
.ex-tile.opt .bl { color: var(--cardio); }
.tag.opt {
    background: rgba(255, 138, 76, .12); color: var(--cardio);
    border-color: rgba(255, 138, 76, .3);
}

/* Yeni surum bildirimi */
.update-bar {
    position: fixed; left: 0; right: 0; z-index: 60;
    bottom: calc(var(--nav-h) + var(--safe-b) + 10px);
    max-width: 492px; margin: 0 auto;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px 12px 16px;
    background: var(--surface-2); border: 1px solid rgba(201, 249, 78, .35);
    border-radius: var(--r); box-shadow: var(--shadow);
    animation: rise .28s ease both;
}
.update-bar .ut { flex: 1; min-width: 0; }
.update-bar .ut b { display: block; font-size: 14px; }
.update-bar .ut span { font-size: 11.5px; color: var(--text-mute); }
.update-bar button {
    flex: none; height: 38px; padding: 0 16px; border: none;
    border-radius: var(--r-pill);
    background: var(--accent); color: var(--accent-ink);
    font-size: 13.5px; font-weight: 700;
}
.update-bar button:disabled { opacity: .6; }

/* Fotograf yukleme / indirme gostergesi */
.photo-busy {
    position: absolute; inset: 0; z-index: 3;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: var(--surface-2);
    font-size: 10.5px; font-weight: 600; color: var(--text-mute);
    text-align: center; padding: 6px;
}
.photo-busy.over { background: rgba(13, 17, 21, .93); }
.photo-busy.err { color: var(--danger); gap: 4px; }

/* Yuzdeli halka: --pct degiskeni doldurulan yayi belirler. */
.ring {
    position: relative; width: 46px; height: 46px; border-radius: 50%;
    background: conic-gradient(var(--accent) var(--pct, 0%), var(--line) 0);
    display: grid; place-content: center;
    transition: background .2s linear;
}
.ring::before {
    content: ""; position: absolute; inset: 4px;
    border-radius: 50%; background: var(--surface-2);
}
.photo-busy.over .ring::before { background: #0D1115; }
.ring b {
    position: relative; z-index: 1;
    font-size: 11px; font-weight: 800; color: var(--accent);
    font-variant-numeric: tabular-nums;
}

/* Yuzde olculemeyen asamalarda donen yay */
.spin-ring {
    background: conic-gradient(var(--accent) 0% 25%, var(--line) 25% 100%);
    animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Ogun kartlari — baslik, madde listesi, altta makrolar */
.meal {
    background: var(--surface); border: 1px solid var(--line-soft);
    border-radius: var(--r); overflow: hidden; margin-bottom: 12px;
}
.meal-h {
    padding: 13px 16px 11px;
    font-size: 15.5px; font-weight: 700; color: var(--accent);
    border-bottom: 1px solid var(--line-soft);
}
.meal-items { padding: 2px 16px; }
.meal-item {
    padding: 11px 0; font-size: 14px; line-height: 1.4;
    border-bottom: 1px solid var(--line-soft);
}
.meal-item:last-child { border-bottom: none; }

.meal-macros {
    display: flex; align-items: center;
    border-top: 1px solid var(--line-soft);
    background: var(--surface-2);
}
.meal-macros > div {
    flex: 1; text-align: center; padding: 11px 6px;
    border-right: 1px solid var(--line-soft);
}
.meal-macros > div:last-child { border-right: none; }
.meal-macros span {
    display: block; font-size: 10.5px; letter-spacing: .06em;
    text-transform: uppercase; color: var(--text-mute); font-weight: 700;
}
.meal-macros b {
    display: block; font-size: 16px; font-weight: 800; margin-top: 3px;
    color: var(--water); font-variant-numeric: tabular-nums;
}

/* Kilo takibi basligi — buyuk deger, fark rozeti, baslangic satiri */
.weight-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.wh-now b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.wh-now small { font-size: 13px; color: var(--text-mute); font-weight: 600; margin-left: 3px; }
.wh-badge {
    font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: var(--r-pill);
}
.wh-badge.down { background: var(--accent-dim); color: var(--accent); }
.wh-badge.up { background: rgba(255, 95, 109, .12); color: var(--danger); }
.wh-since { flex-basis: 100%; font-size: 11.5px; color: var(--text-mute); }
.wh-note { font-size: 12.5px; color: var(--text-mute); margin-top: 10px; }

/* Bilgilendirme bolumundeki uyari notu */
.acc-note {
    font-size: 12.5px; line-height: 1.55; color: var(--cardio);
    background: rgba(255, 138, 76, .08);
    border-left: 2px solid var(--cardio);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    padding: 10px 12px; margin-bottom: 10px;
}
.acc .rule-list li { padding: 7px 0 7px 18px; font-size: 13.5px; }
.acc .rule-list li::before { top: 14px; }
