:root {
    --primary-blue:       #3B82F6;
    --primary-blue-dark:  #2563EB;
    --primary-green:      #10B981;
    --primary-green-dark: #059669;
    --background:          #FFFFFF;
    --background-secondary:#F9FAFB;
    --text-primary:        #111827;
    --text-secondary:      #6B7280;
    --border:              #E5E7EB;
    --error:               #EF4444;
    --warning:             #F59E0B;
    --success:             #10B981;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
}

.app-main {
    max-width: 480px;
    margin: 0 auto;
    min-height: calc(100vh - 50px);
}

/* ── Düğmeler ─────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.15s;
}
.btn-primary:hover  { background-color: var(--primary-blue-dark); }
.btn-primary:active { opacity: 0.9; }

.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-green);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.15s;
}
.btn-success:hover  { background-color: var(--primary-green-dark); }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--primary-blue);
    border: 1.5px solid var(--primary-blue);
    padding: 11px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.15s;
}
.btn-outline:hover { background-color: var(--brand-50); }

/* ── Form elemanları ───────────────────────────────────────── */
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    color: var(--text-primary);
    background-color: var(--background);
    outline: none;
    transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--primary-blue); }
.form-input.invalid { border-color: var(--error); }

.form-group { margin-bottom: 16px; }

.validation-message {
    color: var(--error);
    font-size: 12px;
    margin-top: 4px;
}

/* ── Kart ──────────────────────────────────────────────────── */
.card {
    background: var(--background);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
    padding: 24px;
}

/* ── Sayfa container ───────────────────────────────────────── */
.page-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Splash ────────────────────────────────────────────────── */
.splash-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--primary-blue);
    gap: 28px;
}

.splash-title {
    color: white;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 3px;
    margin: 0;
}

.splash-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── App topbar (MainLayout) ───────────────────────────────── */
.app-topbar {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    min-height: 50px;
    gap: 6px;
}

.topbar-logo {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary-blue);
    letter-spacing: -0.5px;
    flex-shrink: 0;
    text-decoration: none;
}

.topbar-nav {
    display: flex;
    flex: 1;
    justify-content: center;
    gap: 2px;
}

.topbar-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 18px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: background-color 0.15s, color 0.15s;
}
.topbar-nav-link:hover  { background: #F3F4F6; color: var(--primary-blue); }
.topbar-nav-link.active { background: var(--brand-50); color: var(--primary-blue); }

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.15s, color 0.15s;
}
.btn-logout:hover {
    background-color: #FEF2F2;
    color: var(--error);
    border-color: #FECACA;
}

/* ── Onboarding genel ─────────────────────────────────────── */
.onboard-header {
    text-align: center;
    padding: 32px 20px 20px;
}
.onboard-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}
.onboard-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* birim etiketi: kg, cm */
.field-unit {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 0 6px 0 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Toggle butonlar (Cinsiyet / HedefTipi / Süre) ─────────── */
.toggle-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 2px 0;
}
.toggle-group.toggle-col {
    flex-direction: column;
    width: 100%;
}
.toggle-btn {
    background: var(--background-secondary);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.toggle-btn:hover { border-color: var(--primary-blue); color: var(--primary-blue); }
.toggle-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    font-weight: 600;
}
.toggle-group.toggle-col .toggle-btn { text-align: left; }

/* ── Seçenek listesi (EgzersizSeviyesi) ───────────────────── */
.option-list {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.option-item {
    background: var(--background);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.option-item:hover { border-color: var(--brand-100); }
.option-item.selected {
    border-color: var(--primary-blue);
    background: var(--brand-50);
}
.option-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.option-desc {
    font-size: 12px;
    color: var(--text-secondary);
}
.option-item.selected .option-title { color: var(--primary-blue); }

/* ── Sonuç kartı (VKİ / BMR) ──────────────────────────────── */
.result-card {
    margin: 12px 20px 4px;
    background: #F0FDF4;
    border: 1.5px solid #86EFAC;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.result-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.result-label {
    font-size: 13px;
    color: var(--text-secondary);
}
.result-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
}
.result-unit {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 3px;
}

/* ── Auth sayfaları (Giriş / Üye Ol) ──────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 40px;
    background: var(--background);
}

.field-row {
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 18px;
}

.field-label {
    min-width: 130px;
    text-align: right;
    font-size: 15px;
    color: var(--text-primary);
    padding-right: 6px;
    white-space: nowrap;
}

.field-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    border-bottom: 1.5px solid #9CA3AF;
    padding-bottom: 4px;
}

.field-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 4px 2px;
    background: transparent;
    color: var(--text-primary);
    min-width: 0;
    font-family: var(--font-family);
}
.field-input::placeholder { color: #9CA3AF; }

.eye-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 0 4px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* ValidationMessage alanı */
.field-error {
    display: block;
    font-size: 12px;
    color: var(--error);
    padding: 0 20px 6px;
    padding-left: 156px; /* label genişliği (130) + gap (6) + padding (20) */
    margin-top: -12px;
}

.auth-error {
    margin: 4px 20px 12px;
    padding: 10px 14px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    color: var(--error);
    font-size: 14px;
}

.auth-submit-row {
    display: flex;
    justify-content: flex-end;
    padding: 8px 20px 0;
    margin-top: 8px;
}

.btn-auth {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    min-width: 100px;
    transition: background-color 0.15s;
}
.btn-auth:hover    { background-color: var(--primary-blue-dark); }
.btn-auth:disabled { opacity: 0.65; cursor: not-allowed; }

.auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: var(--text-secondary);
}
.auth-footer a {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

/* ── Blazor hata UI ────────────────────────────────────────── */
#blazor-error-ui {
    background: #FEF3C7;
    border-top: 1px solid #F59E0B;
    bottom: 0;
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 14px;
    color: var(--text-primary);
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #FEE2E2;
    border: 1px solid var(--error);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--error);
}
.blazor-error-boundary::after { content: "Bir hata oluştu."; }

/* ── Dashboard / Anasayfa ─────────────────────────────────── */
.home-page {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 92px;
}

/* Hero card: sol=mavi (halkası + yemek ekle), sağ=açık sarı (makrolar) */
.hero-card {
    display: flex;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
    min-height: 210px;
}

/* Sol: mavi — halkası + selamlama + yemek ekle */
.hero-left {
    flex: 1;
    background: linear-gradient(160deg, var(--brand-600) 0%, var(--brand-700) 100%);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: white;
}
.hero-top-text { align-self: flex-start; width: 100%; }
.hero-greeting { font-size: 10px; opacity: 0.80; font-weight: 400; }
.hero-name     { font-size: 14px; font-weight: 700; line-height: 1.2; }
.hero-date     { font-size: 10px; opacity: 0.68; margin-top: 1px; }

.hero-ring-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}
.hero-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    gap: 1px;
}
.hero-ring-num { font-size: 20px; font-weight: 800; line-height: 1; }
.hero-ring-sub { font-size: 9px; opacity: 0.80; }
.hero-ring-lmt { font-size: 9px; opacity: 0.65; }

.btn-yemek-ekle-hero {
    background: rgba(255,255,255,0.20);
    color: white;
    border: 1.5px solid rgba(255,255,255,0.50);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.15s;
    margin-top: auto;
}
.btn-yemek-ekle-hero:hover { background: rgba(255,255,255,0.30); }

/* Sağ: açık sarı — makrolar */
.hero-right {
    flex: 0.95;
    background: #FFFBEB;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 1.5px solid #FEF08A;
}
.hero-macro-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}
.hero-macro-row { display: flex; flex-direction: column; gap: 3px; }
.hero-macro-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.hero-macro-name { font-size: 11px; color: var(--text-secondary); }
.hero-macro-val  { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.hero-macro-track {
    height: 5px;
    background: #E5E7EB;
    border-radius: 3px;
    overflow: hidden;
}
.hero-macro-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    min-width: 0;
}
.hero-balance-badge {
    font-size: 11px;
    font-weight: 600;
    color: #15803D;
    background: #DCFCE7;
    padding: 3px 8px;
    border-radius: 8px;
    text-align: center;
}
.hero-balance-badge.over { color: #DC2626; background: #FEE2E2; }

/* Macro bar chart (replaces pills) */
.macro-chart-card {
    background: var(--background);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 14px 16px;
}
.macro-bar-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.macro-bar-row:last-child { border-bottom: none; }
.macro-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.macro-bar-name   { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.macro-bar-amount { font-size: 12px; color: var(--text-secondary); }
.macro-bar-track {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.macro-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    min-width: 0;
}
.macro-fill-karb { background: var(--macro-carb); }
.macro-fill-prot { background: var(--macro-protein); }
.macro-fill-yag  { background: var(--macro-fat); }

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.meal-card {
    background: var(--background);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.meal-group-header {
    padding: 7px 14px;
    background: var(--background-secondary);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tuketim-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    gap: 8px;
}
.tuketim-name { flex: 1; font-size: 14px; color: var(--text-primary); }
.tuketim-kcal { font-size: 13px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.empty-meals  { text-align: center; padding: 20px 16px; color: var(--text-secondary); font-size: 14px; }

.period-card {
    background: var(--background);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 14px 16px;
}
.period-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}
.period-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.period-days  { font-size: 13px; color: var(--text-secondary); }
.progress-track {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--primary-blue);
    border-radius: 4px;
    transition: width 0.4s ease;
}
.period-stats {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}
.period-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}
.period-date-lbl { font-size: 11px; color: var(--text-secondary); }
.period-remaining-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-blue);
    background: var(--brand-50);
    padding: 2px 8px;
    border-radius: 10px;
}

.insights-card {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.insight-item {
    font-size: 13px;
    color: #92400E;
    padding-left: 14px;
    position: relative;
}
.insight-item::before { content: "•"; position: absolute; left: 0; }

.deger-card {
    background: var(--background);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 14px 16px;
}
.deger-metric-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
}
.deger-metric-row:last-of-type { border-bottom: none; }
.deger-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.deger-dot.yesil   { background: var(--primary-green); }
.deger-dot.sari    { background: var(--warning); }
.deger-dot.turuncu { background: #F97316; }
.deger-dot.kirmizi { background: var(--error); }
.deger-metric-lbl { font-size: 13px; color: var(--text-secondary); min-width: 68px; }
.deger-metric-val { font-size: 13px; color: var(--text-primary); flex: 1; }
.deger-tip-list {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.deger-tip {
    font-size: 12px;
    color: var(--text-secondary);
    padding-left: 12px;
    position: relative;
}
.deger-tip::before { content: "›"; position: absolute; left: 0; color: var(--primary-blue); }

/* Tespitler */
.tespit-card {
    background: var(--info-bg);
    border: 1px solid var(--info);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tespit-item {
    font-size: 13px;
    color: #0C4A6E;
    padding: 2px 0 2px 14px;
    position: relative;
}
.tespit-item::before { content: "•"; position: absolute; left: 0; color: var(--info); }

/* Öneriler */
.oneri-card {
    background: #F0FDF4;
    border: 1px solid #86EFAC;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.oneri-item {
    font-size: 13px;
    color: #14532D;
    padding: 2px 0 2px 16px;
    position: relative;
}
.oneri-item::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--success);
    font-size: 11px;
    top: 3px;
}

.fab-add {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: white;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(58,133,96,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, transform 0.1s;
    z-index: 100;
}
.fab-add:hover  { background: var(--primary-blue-dark); }
.fab-add:active { transform: scale(0.94); }

.fab-rapor {
    position: fixed;
    bottom: 24px;
    right: 92px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-green);
    color: white;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(58,133,96,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, transform 0.1s;
    z-index: 100;
}
.fab-rapor:hover  { background: var(--primary-green-dark); }
.fab-rapor:active { transform: scale(0.94); }

/* ── iOS safe area ─────────────────────────────────────────── */
.status-bar-safe-area { display: none; }
@supports (-webkit-touch-callout: none) {
    .status-bar-safe-area {
        display: flex;
        position: sticky;
        top: 0;
        height: env(safe-area-inset-top);
        background-color: var(--background);
        width: 100%;
        z-index: 1;
    }
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.50);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}
.modal-content {
    background: var(--background);
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.20);
}
.modal-icon {
    font-size: 52px;
    margin-bottom: 12px;
}
.modal-content h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
}
.modal-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 20px;
}
.modal-content .btn-primary {
    display: block;
    width: 100%;
    background: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
}
.modal-content .btn-secondary {
    display: block;
    width: 100%;
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 11px 0;
    font-size: 14px;
    cursor: pointer;
}

/* ── Yemek Arama (/yemek-ara) ─────────────────────────────── */
.ara-page          { padding: 0 0 80px; }
.ara-header        { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
.ara-title         { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.btn-back          { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-primary); padding: 0 4px; line-height: 1; }
.btn-back-full     { margin-top: 16px; background: var(--primary-blue); color: #fff; border: none; border-radius: 8px; padding: 10px 24px; font-size: 14px; cursor: pointer; }

.ara-search-bar    { display: flex; gap: 8px; padding: 0 16px 12px; }
.ara-input         { flex: 1; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 15px; outline: none; color: var(--text-primary); background: var(--background); }
.ara-input:focus   { border-color: var(--primary-blue); }
.btn-ara           { background: var(--primary-blue); color: #fff; border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn-ara:disabled  { opacity: 0.6; cursor: not-allowed; }

.ara-empty         { padding: 48px 24px; text-align: center; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.ara-empty-icon    { font-size: 44px; margin-bottom: 12px; }
.ara-hata          { margin: 0 16px 10px; padding: 10px 14px; background: #FEE2E2; color: #DC2626; border-radius: 8px; font-size: 13px; }
.ara-result-count  { padding: 0 16px 6px; font-size: 12px; color: var(--text-secondary); }

.ara-list          { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.ara-card          { display: flex; align-items: center; justify-content: space-between; background: var(--background-secondary); border-radius: 12px; padding: 12px 14px; cursor: pointer; border: 1.5px solid var(--border); transition: border-color .15s; }
.ara-card:active   { border-color: var(--primary-blue); background: var(--brand-50); }
.ara-card-left     { flex: 1; min-width: 0; }
.ara-card-ad       { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ara-card-kat      { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.ara-card-right    { text-align: right; margin-left: 10px; flex-shrink: 0; }
.ara-card-kcal     { font-size: 16px; font-weight: 700; color: var(--primary-blue); }
.ara-card-kcal-lbl { font-size: 10px; color: var(--text-secondary); }

/* ── Yemek Detay (/yemek/{id}) ─────────────────────────────── */
.detay-page        { padding: 0 0 100px; }
.detay-loading, .detay-hata { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; color: var(--text-secondary); font-size: 14px; }
.detay-topbar      { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
.detay-topbar-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.detay-header      { padding: 8px 16px 4px; }
.detay-ad          { font-size: 20px; font-weight: 800; color: var(--text-primary); line-height: 1.25; }
.detay-kat         { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

.detay-kcal-badge  { display: inline-flex; align-items: baseline; gap: 3px; margin: 8px 16px 0; background: var(--brand-50); border-radius: 10px; padding: 6px 14px; }
.detay-kcal-num    { font-size: 26px; font-weight: 800; color: var(--primary-blue); }
.detay-kcal-lbl    { font-size: 13px; color: var(--text-secondary); }

.detay-makro-row   { display: flex; gap: 8px; padding: 12px 16px 0; }
.detay-makro-item  { flex: 1; border-radius: 10px; padding: 10px 8px; text-align: center; }
.detay-makro-item.karb { background: var(--macro-carb-bg); }
.detay-makro-item.prot { background: var(--macro-protein-bg); }
.detay-makro-item.yag  { background: var(--macro-fat-bg); }
.detay-makro-val   { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.detay-makro-lbl   { font-size: 10px; color: var(--text-secondary); margin-top: 2px; }

.besin-tablo       { margin: 6px 16px 0; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--border); }
.besin-satir       { display: flex; justify-content: space-between; padding: 9px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
.besin-satir:last-child { border-bottom: none; }
.besin-satir:nth-child(even) { background: var(--background-secondary); }
.besin-lbl         { color: var(--text-secondary); }
.besin-val         { font-weight: 600; color: var(--text-primary); }

.btn-bunu-yedim    { display: block; width: calc(100% - 32px); margin: 20px 16px 0; background: var(--primary-blue); color: #fff; border: none; border-radius: 12px; padding: 15px 0; font-size: 16px; font-weight: 700; cursor: pointer; }

/* ── Tüketim Modal (detay sayfası) ─────────────────────────── */
.tuketim-modal     { max-width: 360px; }
.tuketim-modal h2  { font-size: 16px; margin: 0 0 14px; }
.modal-field-lbl   { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-align: left; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.modal-ogun-row    { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.modal-ogun-btn    { background: var(--background-secondary); border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; color: var(--text-primary); }
.modal-ogun-btn.active { background: var(--brand-50); border-color: var(--primary-blue); color: var(--primary-blue); font-weight: 600; }

.modal-row-2col    { display: flex; gap: 10px; margin-bottom: 12px; }
.modal-field       { flex: 1; display: flex; flex-direction: column; }
.modal-input       { border: 1.5px solid var(--border); border-radius: 8px; padding: 9px 10px; font-size: 15px; outline: none; text-align: center; }
.modal-input:focus { border-color: var(--primary-blue); }
.modal-select      { border: 1.5px solid var(--border); border-radius: 8px; padding: 9px 10px; font-size: 13px; outline: none; background: var(--background); color: var(--text-primary); }

.modal-onizleme    { display: flex; justify-content: center; gap: 12px; margin-bottom: 14px; background: #F0FDF4; border-radius: 8px; padding: 8px 0; }
.modal-onizleme-gram { font-size: 13px; color: var(--text-secondary); }
.modal-onizleme-kcal { font-size: 14px; font-weight: 700; color: var(--primary-green); }

/* ── Toast ─────────────────────────────────────────────────── */
.toast             { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); padding: 12px 24px; border-radius: 24px; font-size: 14px; font-weight: 600; white-space: nowrap; z-index: 2000; box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.toast-success     { background: var(--success); color: #fff; }

/* ── Mini spinner (Ara butonu yüklenirken) ─────────────────── */
.mini-spin         { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle; }

/* ── Kontrol Ekranı (/kontrol-ekrani) ─────────────────────── */
.kontrol-loading   { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; gap: 16px; }
.kontrol-loading-txt { font-size: 14px; color: var(--text-secondary); }
.kontrol-hata      { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; padding: 24px; text-align: center; }

.kontrol-page      { padding: 0 0 100px; }

.kontrol-hero      { text-align: center; padding: 28px 20px 16px; }
.kontrol-hero-emoji { font-size: 52px; margin-bottom: 8px; }
.kontrol-hero-title { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.kontrol-hero-dates { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

/* MC-DAI skor kartı */
.kontrol-skor-card   { margin: 0 16px 12px; background: var(--background-secondary); border-radius: 16px; padding: 20px 20px 16px; text-align: center; border: 1.5px solid var(--border); }
.kontrol-skor-lbl    { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.kontrol-skor-num    { font-size: 52px; font-weight: 900; line-height: 1; margin-bottom: 6px; }
.kontrol-skor-grade  { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.kontrol-skor-bar-track { height: 8px; background: #E5E7EB; border-radius: 4px; overflow: hidden; }
.kontrol-skor-bar-fill  { height: 100%; border-radius: 4px; transition: width .8s ease; }

/* Skor renk sınıfları */
.skor-mukemmel   { color: var(--success); }
.skor-iyi        { color: var(--brand-600); }
.skor-orta       { color: #D97706; }
.skor-dusuk      { color: #DC2626; }
.kontrol-skor-bar-fill.skor-mukemmel { background: var(--success); }
.kontrol-skor-bar-fill.skor-iyi      { background: var(--brand-600); }
.kontrol-skor-bar-fill.skor-orta     { background: #F59E0B; }
.kontrol-skor-bar-fill.skor-dusuk    { background: #EF4444; }

/* Radar chart */
.kontrol-chart-card  { margin: 0 16px 12px; background: var(--background); border-radius: 16px; padding: 16px; border: 1.5px solid var(--border); }
.kontrol-chart-wrap  { max-width: 280px; margin: 0 auto; }

/* Alt-skor çubukları */
.kontrol-subskor-card { margin: 0 16px 12px; background: var(--background); border-radius: 16px; padding: 14px 16px; border: 1.5px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.subskor-satir       { display: flex; flex-direction: column; gap: 4px; }
.subskor-header      { display: flex; justify-content: space-between; align-items: baseline; }
.subskor-lbl         { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.subskor-meta        { font-size: 11px; color: var(--text-secondary); }
.subskor-track       { height: 6px; background: #F3F4F6; border-radius: 3px; overflow: hidden; }
.subskor-fill        { height: 100%; border-radius: 3px; transition: width .6s ease; }

/* Stat kutuları */
.kontrol-stat-row    { display: flex; gap: 10px; margin: 0 16px 12px; }
.kontrol-stat-box    { flex: 1; background: var(--background-secondary); border-radius: 12px; padding: 12px 8px; text-align: center; border: 1px solid var(--border); }
.kontrol-stat-val    { font-size: 22px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.kontrol-stat-lbl    { font-size: 10px; color: var(--text-secondary); margin-top: 3px; }

/* Donut chart */
.kontrol-donut-card  { display: flex; align-items: center; gap: 16px; margin: 0 16px 16px; background: var(--background); border-radius: 16px; padding: 16px; border: 1.5px solid var(--border); }
.kontrol-donut-wrap  { position: relative; flex-shrink: 0; width: 100px; height: 100px; }
.kontrol-donut-wrap canvas { width: 100px !important; height: 100px !important; }
.kontrol-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.kontrol-donut-pct   { font-size: 18px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.kontrol-donut-lbl   { font-size: 10px; color: var(--text-secondary); }
.kontrol-donut-meta-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.kontrol-donut-meta-sub   { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* Aksiyon butonları */
.kontrol-actions     { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
.kontrol-btn-primary { background: var(--primary-blue); color: #fff; border: none; border-radius: 12px; padding: 15px 0; font-size: 15px; font-weight: 700; cursor: pointer; width: 100%; }
.kontrol-btn-secondary { background: transparent; color: var(--text-secondary); border: 1.5px solid var(--border); border-radius: 12px; padding: 13px 0; font-size: 14px; cursor: pointer; width: 100%; }

/* ── Periyot Detay (/periyot-detay/{id}) ──────────────────── */
.pd-page             { padding: 0 0 100px; }
.pd-hero             { text-align: center; padding: 24px 20px 12px; }
.pd-hero-title       { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.pd-hero-dates       { font-size: 13px; color: var(--text-secondary); margin-top: 5px; }

.pd-ozet-card        { margin: 0 16px 12px; background: var(--background); border-radius: 16px; padding: 16px; border: 1.5px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.pd-ozet-title       { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.pd-info-row         { display: flex; justify-content: space-between; align-items: center; }
.pd-info-lbl         { font-size: 14px; color: var(--text-secondary); }
.pd-info-val         { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.pd-info-divider     { height: 1px; background: var(--border); margin: 2px 0; }

.pd-top-satir        { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pd-top-satir:last-child { border-bottom: none; }
.pd-top-sira         { width: 24px; height: 24px; border-radius: 50%; background: var(--background-secondary); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text-secondary); flex-shrink: 0; }
.pd-top-bilgi        { flex: 1; min-width: 0; }
.pd-top-ad           { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-top-meta         { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }

.pd-bar-wrap         { width: 100%; height: 160px; margin-top: 12px; }
.pd-bar-wrap canvas  { width: 100% !important; height: 160px !important; }

/* Blok 6 — Çeşitlilik */
.pd-ces-skor-row    { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 4px; }
.pd-ces-skor-num    { font-size: 36px; font-weight: 700; line-height: 1; }
.pd-ces-skor-lbl    { font-size: 14px; color: var(--text-secondary); }
.pd-ces-meta        { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* Blok 7 — Günlük Makro */
.pd-gunluk-bar-wrap        { width: 100%; height: 180px; position: relative; margin-top: 12px; }
.pd-gunluk-bar-wrap canvas { width: 100% !important; height: 180px !important; }

/* Blok 8 — Günlük Kalori */
.pd-kalori-wrap        { width: 100%; height: 160px; position: relative; margin-top: 12px; }
.pd-kalori-wrap canvas { width: 100% !important; height: 160px !important; }

/* Blok 9 — Tespitler & Öneriler */
.pd-tespit-baslik   { font-size: 11px; font-weight: 700; color: #F59E0B; margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.pd-tespit-satir    { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; font-size: 13px; color: var(--text-primary); line-height: 1.5; }
.pd-tespit-ikon     { color: #F59E0B; font-size: 8px; margin-top: 5px; flex-shrink: 0; }
.pd-oneri-baslik    { font-size: 11px; font-weight: 700; color: var(--brand-600); margin: 16px 0 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.pd-oneri-satir     { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; font-size: 13px; color: var(--text-primary); border-bottom: 1px solid var(--border); line-height: 1.5; }
.pd-oneri-satir:last-child { border-bottom: none; }
.pd-oneri-ikon      { color: var(--brand-600); font-weight: 700; flex-shrink: 0; }

.pd-makro-card       { margin: 0 16px 12px; background: var(--background); border-radius: 16px; padding: 16px; border: 1.5px solid var(--border); }
.pd-makro-body       { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.pd-makro-chart      { flex-shrink: 0; width: 110px; height: 110px; }
.pd-makro-chart canvas { width: 110px !important; height: 110px !important; }
.pd-makro-legend     { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.pd-makro-item       { display: flex; flex-direction: column; gap: 2px; }
.pd-makro-row        { display: flex; align-items: center; gap: 7px; }
.pd-makro-dot        { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pd-makro-name       { font-size: 13px; font-weight: 600; color: var(--text-primary); flex: 1; }
.pd-makro-pct        { font-size: 13px; font-weight: 700; color: var(--text-primary); }

/* Profil — düzenleme modu */
.pd-card-header      { display: flex; justify-content: space-between; align-items: center; }

.pd-duzenle-btn      { font-size: 12px; font-weight: 600; color: var(--brand-600); background: rgba(58,133,96,0.08); border: 1px solid rgba(58,133,96,0.25); border-radius: 8px; padding: 4px 12px; cursor: pointer; }
.pd-duzenle-btn:active { opacity: 0.7; }

.pd-info-notu        { background: rgba(58,133,96,0.08); border: 1px solid rgba(58,133,96,0.22); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.pd-info-notu strong { color: var(--text-primary); }

.pd-form-row         { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pd-form-lbl         { font-size: 14px; color: var(--text-secondary); flex-shrink: 0; }
.pd-form-input       { flex: 1; max-width: 140px; font-size: 15px; font-weight: 600; color: var(--text-primary); background: var(--background-secondary); border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 10px; text-align: right; outline: none; }
.pd-form-input:focus { border-color: var(--brand-600); }
.pd-form-select      { flex: 1; max-width: 160px; font-size: 14px; font-weight: 600; color: var(--text-primary); background: var(--background-secondary); border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 10px; outline: none; }
.pd-form-select:focus { border-color: var(--brand-600); }

.pd-hesaplanan-row   { opacity: 0.5; }
.pd-hesaplanan-val   { display: flex; align-items: baseline; gap: 6px; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.pd-hesaplanan-tag   { font-size: 10px; font-weight: 400; color: var(--text-secondary); }

.pd-form-actions     { display: flex; gap: 10px; margin-top: 4px; }
.pd-btn-kaydet       { flex: 1; background: var(--brand-600); color: #fff; font-size: 15px; font-weight: 700; border: none; border-radius: 12px; padding: 12px 0; cursor: pointer; }
.pd-btn-kaydet:disabled { opacity: 0.6; cursor: default; }
.pd-btn-kaydet:active:not(:disabled) { opacity: 0.85; }
.pd-btn-iptal        { flex: 1; background: transparent; color: var(--text-secondary); font-size: 15px; font-weight: 600; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 0; cursor: pointer; }
.pd-btn-iptal:disabled { opacity: 0.5; cursor: default; }

.pd-basari-mesaji    { margin: 0 16px 12px; background: rgba(22,163,74,0.1); border: 1px solid rgba(22,163,74,0.3); border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--success); }
.pd-hata-mesaji      { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 600; color: #EF4444; }

/* İlerleme ekranı — periyot listesi */
.ilerleme-kart       { margin: 0 16px 10px; background: var(--background); border-radius: 16px; padding: 14px 16px; border: 1.5px solid var(--border); cursor: pointer; }
.ilerleme-kart:active { opacity: 0.72; }
.ilerleme-kart-ust   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ilerleme-tarih      { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.ilerleme-gun        { font-size: 12px; color: var(--text-secondary); background: var(--background-secondary); border-radius: 6px; padding: 2px 8px; border: 1px solid var(--border); }
.ilerleme-kart-alt   { display: flex; align-items: center; gap: 12px; }
.ilerleme-skor-blok  { display: flex; flex-direction: column; align-items: center; min-width: 52px; }
.ilerleme-skor-lbl   { font-size: 9px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 1px; }
.ilerleme-skor-num   { font-size: 26px; font-weight: 900; line-height: 1.1; }
.ilerleme-etiketler  { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.ilerleme-basarili   { font-size: 12px; color: var(--success); font-weight: 600; }
.ilerleme-asilan     { font-size: 12px; color: #EF4444; font-weight: 600; }
.ilerleme-kcal       { font-size: 12px; color: var(--text-secondary); text-align: right; }
.ilerleme-ok         { font-size: 22px; color: var(--text-secondary); margin-left: 2px; line-height: 1; }
.ilerleme-bos        { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 64px 16px 32px; text-align: center; font-size: 15px; color: var(--text-secondary); }
.pd-makro-sub        { font-size: 11px; color: var(--text-secondary); padding-left: 17px; }
