/* ============================================================
   TakipPro — Psikolog & Diyetisyen Randevu / Danışan Takip Sistemi
   Tasarım tokenları
   ============================================================ */
:root {
    --bg:            #EFF3F1;
    --surface:       #FFFFFF;
    --surface-soft:  #E4EBE7;
    --primary:       #2B4C43;
    --primary-soft:  #6B9080;
    --primary-pale:  #DCE7E1;
    --accent:        #E0A458;
    --accent-dark:   #C48A42;
    --text:          #22302B;
    --text-mute:     #647169;
    --danger:        #C1584A;
    --danger-pale:   #F5E0DC;
    --success:       #4C8067;
    --success-pale:  #DCEAE1;
    --border:        #DDE5E1;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --shadow: 0 4px 16px rgba(43, 76, 67, 0.08);
    --shadow-lift: 0 8px 28px rgba(43, 76, 67, 0.14);

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
    overflow-y: auto;
}

body {
    font-size: 15px;
    line-height: 1.5;
    padding-bottom: 84px; /* bottom nav boşluğu */
    min-height: 100dvh;
    touch-action: manipulation;
}

body:not(.auth-page) .sayfa,
body:not(.auth-page) .admin-shell,
body:not(.auth-page) .hero {
    animation: page-slide-in .28s cubic-bezier(.22, .8, .24, 1) both;
    will-change: transform, opacity;
}

body.auth-page {
    padding-bottom: 0;
}

body.auth-page .auth-sarici {
    animation: auth-slide-in .36s cubic-bezier(.22, .8, .24, 1) both;
    will-change: transform, opacity;
}

body.sayfa-cikis:not(.auth-page) .sayfa,
body.sayfa-cikis:not(.auth-page) .admin-shell,
body.sayfa-cikis:not(.auth-page) .hero {
    animation: page-slide-out .18s cubic-bezier(.4, 0, 1, 1) both;
}

body.auth-page.sayfa-cikis .auth-sarici {
    animation: auth-slide-out .2s cubic-bezier(.4, 0, 1, 1) both;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--primary);
    margin: 0 0 6px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

button, input, select, textarea {
    font-family: var(--font-body);
    font-size: 15px;
    max-width: 100%;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@keyframes page-slide-in {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes page-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-18px);
    }
}

@keyframes auth-slide-in {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auth-slide-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-16px);
    }
}

@media (prefers-reduced-motion: reduce) {
    body:not(.auth-page) .sayfa,
    body:not(.auth-page) .admin-shell,
    body:not(.auth-page) .hero,
    body.auth-page .auth-sarici,
    body.sayfa-cikis:not(.auth-page) .sayfa,
    body.sayfa-cikis:not(.auth-page) .admin-shell,
    body.sayfa-cikis:not(.auth-page) .hero,
    body.auth-page.sayfa-cikis .auth-sarici {
        animation: none;
        transform: none;
    }
}

/* ==================== LAYOUT ==================== */
.sayfa {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 18px 16px 8px;
}

.ust-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
    padding: 14px 16px 10px;
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ust-bar > div:first-child { min-width: 0; }

.ust-bar h1 {
    font-size: 21px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ust-bar .eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-mute);
    font-weight: 700;
    margin-bottom: 2px;
    display: block;
}

.geri-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow);
    font-size: 18px;
    color: var(--primary);
}

.ust-aksiyonlar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.zil-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    color: var(--primary);
    position: relative;
}
.auth-destek-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 40;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lift);
    font-weight: 800;
}
.zil-ikon { font-size: 19px; line-height: 1; }
.zil-sayi {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    border: 2px solid var(--surface);
}

.takvim-ok {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-soft);
    color: var(--primary);
    font-size: 24px;
    font-weight: 800;
    flex-shrink: 0;
}

/* ==================== KART ==================== */
.kart {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    width: 100%;
}

.kart-baslik {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kart-baslik h3 { font-size: 16px; margin: 0; }

/* ==================== BUTONLAR ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 20px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    text-align: center;
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
    width: 100%;
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #234038; }

.btn-accent { background: var(--accent); color: #2b2013; }
.btn-accent:hover { background: var(--accent-dark); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary-soft);
}

.btn-danger { background: var(--danger-pale); color: var(--danger); }

.btn-whatsapp {
    background: #25D366;
    color: #073D1E;
}
.btn-whatsapp:hover { background: #1FBD5A; }

.btn-sm { padding: 9px 14px; font-size: 13px; width: auto; }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ==================== FORM ==================== */
.form-grup { margin-bottom: 16px; }

.form-grup label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-mute);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-grup input,
.form-grup select,
.form-grup textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.form-grup input:focus,
.form-grup select:focus,
.form-grup textarea:focus {
    border-color: var(--primary-soft);
    outline: none;
}

.form-grup textarea { resize: vertical; min-height: 90px; }

.form-yardim { font-size: 12px; color: var(--text-mute); margin-top: 5px; }

.form-satir { display: flex; gap: 10px; min-width: 0; }
.form-satir .form-grup { flex: 1; }

/* ==================== ROZET (DURUM) ==================== */
.rozet {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.rozet-bekliyor    { background: #FBEBD6; color: var(--accent-dark); }
.rozet-onaylandi   { background: var(--success-pale); color: var(--success); }
.rozet-tamamlandi  { background: var(--primary-pale); color: var(--primary); }
.rozet-iptal       { background: var(--danger-pale); color: var(--danger); }

/* ==================== LİSTE ÖĞESİ ==================== */
.liste-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    min-width: 0;
}
.liste-item:last-child { border-bottom: none; }

.avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--primary-pale);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.liste-item-govde { flex: 1; min-width: 0; }
.liste-item-govde .baslik { font-weight: 700; font-size: 15px; }
.liste-item-govde .alt-yazi { font-size: 13px; color: var(--text-mute); margin-top: 2px; }

/* Randevu şeridi: sol renkli çizgi ile durumu kodlar (signature element) */
.randevu-seridi {
    display: flex;
    gap: 12px;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-soft);
}
.randevu-seridi.durum-bekliyor    { border-left-color: var(--accent); }
.randevu-seridi.durum-onaylandi   { border-left-color: var(--success); }
.randevu-seridi.durum-tamamlandi  { border-left-color: var(--primary-soft); }
.randevu-seridi.durum-iptal       { border-left-color: var(--danger); opacity: .6; }

.randevu-saat {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    color: var(--primary);
    min-width: 54px;
}
.randevu-saat span { display: block; font-family: var(--font-body); font-size: 11px; color: var(--text-mute); font-weight: 600; }

/* ==================== BOŞ DURUM ==================== */
.bos-durum {
    text-align: center;
    padding: 46px 20px;
    color: var(--text-mute);
}
.bos-durum .ikon { font-size: 38px; margin-bottom: 10px; }
.bos-durum h3 { color: var(--text); font-size: 16px; }
.bos-durum p { font-size: 13px; margin: 4px 0 16px; }

/* ==================== FLASH MESAJ ==================== */
.flash {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}
.flash-basari { background: var(--success-pale); color: var(--success); }
.flash-hata   { background: var(--danger-pale); color: var(--danger); }

.premium-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(34, 48, 43, 0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.premium-modal-icerik {
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-lift);
}
.premium-modal-icerik h3 { font-size: 20px; }

/* ==================== SÜPER ADMİN ==================== */
.admin-shell {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 18px 16px 30px;
}
.admin-ust {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}
.admin-ust h1 { font-size: 26px; }
.admin-ust p { margin: 0; color: var(--text-mute); font-size: 13px; }
.admin-ust .eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--accent-dark);
    font-weight: 800;
}
.admin-istatistik {
    grid-template-columns: repeat(2, 1fr);
}
.admin-uzman-kart .kart-baslik {
    align-items: flex-start;
}
.admin-metrikler {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 14px;
}
.admin-metrikler span {
    background: var(--surface-soft);
    border-radius: var(--radius-sm);
    padding: 9px;
    text-align: center;
    color: var(--text-mute);
    font-size: 12px;
    font-weight: 800;
}
.toggle-satir {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--text-mute);
    font-weight: 800;
    font-size: 13px;
}
.toggle-satir input { width: auto; }

/* ==================== ALT NAVİGASYON (uygulama hissi) ==================== */
.alt-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    max-width: 560px;
    background: var(--surface);
    box-shadow: 0 -4px 20px rgba(43,76,67,0.12);
    display: flex;
    justify-content: space-around;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    z-index: 30;
}
.alt-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-mute);
    padding: 6px 8px;
    border-radius: 100px;
    position: relative;
    min-width: 0;
    flex: 1;
}
.alt-nav a .ikon { font-size: 20px; }
.alt-nav a.aktif { color: var(--primary); background: var(--primary-pale); }

/* ==================== ÖZET / İSTATİSTİK KUTULARI ==================== */
.istatistik-satir {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.istatistik-kutu {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 14px 10px;
    text-align: center;
    box-shadow: var(--shadow);
}
.istatistik-kutu .sayi {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
    display: block;
}
.istatistik-kutu .etiket {
    font-size: 11px;
    color: var(--text-mute);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ==================== FİNANS ==================== */
.finans-donem {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 12px;
}
.finans-donem strong {
    display: block;
    font-family: var(--font-display);
    color: var(--primary);
    font-size: 18px;
}
.finans-donem span {
    display: block;
    color: var(--text-mute);
    font-size: 12px;
    font-weight: 700;
}
.finans-ozet {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.finans-ozet .sayi {
    font-size: 20px;
    word-break: break-word;
}
.istatistik-kutu.kazanc .sayi { color: var(--success); }
.istatistik-kutu.zarar .sayi { color: var(--danger); }
.finans-liste {
    padding-top: 4px;
    padding-bottom: 4px;
}
.finans-item {
    display: grid;
    grid-template-columns: 1fr auto 32px;
    align-items: center;
    gap: 10px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}
.finans-item:last-child { border-bottom: none; }
.finans-item .liste-item-govde { min-width: 0; }
.finans-tutar {
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap;
}
.finans-item.gelir .finans-tutar { color: var(--success); }
.finans-item.gider .finans-tutar { color: var(--danger); }
.mini-sil {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--danger-pale);
    color: var(--danger);
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}

/* ==================== AUTH SAYFALARI ==================== */
.auth-sarici {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 18px;
    background: linear-gradient(180deg, var(--primary) 0%, #1E362F 100%);
}
.auth-kart {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px 26px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lift);
    animation: auth-card-rise .42s cubic-bezier(.22, .8, .24, 1) both;
}
.auth-logo {
    text-align: center;
    margin-bottom: 22px;
}
.auth-logo .marka {
    font-family: var(--font-display);
    font-size: 26px;
    color: var(--primary);
    font-weight: 700;
}
.auth-logo .alt-marka {
    font-size: 12px;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

@keyframes auth-card-rise {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.auth-alt-link {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-mute);
}
.auth-alt-link a { color: var(--primary); font-weight: 700; }

.reset-link-kutu {
    background: var(--primary-pale);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 16px;
    overflow-wrap: anywhere;
}
.reset-link-kutu a {
    display: block;
    margin-top: 4px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

/* ==================== SEKME (tab) ==================== */
.sekmeler {
    display: flex;
    background: var(--surface-soft);
    border-radius: 100px;
    padding: 4px;
    margin-bottom: 16px;
}
.sekmeler a {
    flex: 1;
    text-align: center;
    padding: 9px 6px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-mute);
}
.sekmeler a.aktif { background: var(--primary); color: #fff; }

/* ==================== KAYAN AKSİYON BUTONU (FAB) ==================== */
.fab {
    position: fixed;
    right: 18px;
    bottom: 92px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #2b2013;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    box-shadow: var(--shadow-lift);
    z-index: 25;
    line-height: 0;
}

/* ==================== LANDING (PUBLIC) ==================== */
.hero {
    padding: 38px 20px 26px;
    text-align: center;
    color: #fff;
    background: linear-gradient(160deg, var(--primary) 0%, #1E362F 100%);
    border-radius: 0 0 28px 28px;
    margin-bottom: 20px;
}
.hero .eyebrow { color: var(--accent); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; }
.hero h1 { color: #fff; font-size: 26px; margin: 8px 0 8px; }
.hero p { color: #C9D8D1; font-size: 14px; max-width: 320px; margin: 0 auto; }

.uzman-secim-karti {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
}
.uzman-secim-karti input { width: auto; }
.uzman-secim-karti.secili { border-color: var(--primary); background: var(--primary-pale); }

/* ==================== YARDIMCI SINIFLAR ==================== */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-mute { color: var(--text-mute); }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }

.bildirim-kart p { overflow-wrap: anywhere; }

.destek-mesaj {
    border-left: 4px solid var(--primary-pale);
    padding: 12px 0 12px 12px;
    margin-bottom: 12px;
}
.destek-mesaj.admin {
    border-left-color: var(--accent);
}
.destek-mesaj .meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-mute);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 4px;
}
.destek-mesaj p {
    margin: 0;
    overflow-wrap: anywhere;
}

@media (min-width: 560px) {
    .sayfa, .ust-bar { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 420px) {
    .form-satir {
        flex-direction: column;
        gap: 0;
    }
    .istatistik-satir,
    .admin-istatistik {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .admin-metrikler {
        grid-template-columns: 1fr;
    }
    .alt-nav a {
        font-size: 10px;
        padding-left: 3px;
        padding-right: 3px;
    }
    .alt-nav a .ikon {
        font-size: 18px;
    }
    .finans-ozet {
        grid-template-columns: 1fr;
    }
    .finans-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .finans-tutar {
        white-space: normal;
    }
    .mini-sil {
        justify-self: end;
    }
}
