/* ==========================================================================
   eBakja — Birleşik Veli Arayüzü (Blade)
   Mobil-öncelikli, içerik max ~480px ortalanmış kolon. Tasarım: eBakja.
   ========================================================================== */
:root {
    --primary: #4578ec; --primary-dark: #3866d4; --primary-soft: #EDEFFF;
    --bg: #f7f7f7; --card: #F6F6F6; --white: #ffffff; --border: #E3E3E3;
    --text: #333333; --text-secondary: #6D6D6D;
    --accent-pink: #FFDDE9; --accent-yellow: #FFF0C8; --accent-cyan: #DDF5FF;
    --blue-100: #EDEFFF; --blue-200: #DDE1FF; --blue-300: #C2C7FF;
    --danger: #F65556; --success: #2eb872; --warning: #f0a500; --info: #36b9cc;
    --radius-card: 12px; --radius-sm: 8px; --radius-pill: 999px;
    --shadow-sm: 0 1px 3px rgba(16,24,40,.06);
    --shadow-card: 0 6px 18px rgba(16,24,40,.06);
    --shadow-nav: 0 -2px 16px rgba(16,24,40,.08);
    --frame-max: 480px; --nav-h: 68px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    background: #e9eaee; color: var(--text);
    -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* Çerçeve */
#app-frame {
    position: relative; max-width: var(--frame-max); min-height: 100vh;
    margin: 0 auto; background: var(--bg); display: flex; flex-direction: column;
    box-shadow: 0 0 40px rgba(0,0,0,.06);
}
#app { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#app-frame.has-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }

/* Tipografi */
.h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.h2 { font-size: 19px; font-weight: 700; }
.h3 { font-size: 16px; font-weight: 700; }
.muted { color: var(--text-secondary); }
.text-danger { color: var(--danger); } .text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.center { text-align: center; } .bold { font-weight: 700; } .small { font-size: 13px; }

/* Düzen */
.screen-pad { padding: 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.spacer { flex: 1; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.full { width: 100%; }

/* Üst bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--bg); }
.topbar .brand { display: flex; align-items: center; gap: 8px; }
.topbar .brand .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.topbar .brand .brand-name { font-size: 18px; font-weight: 700; }
.topbar .brand .brand-logo { height: 30px; width: auto; display: block; }

/* Programları (günlük/ders/nahar) güncel zaman dilimine göre daraltma */
.sched-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sched-head .h3 { margin: 0; }
.sched-toggle {
    flex: none;
    background: var(--bg-grey, #f6f6f6);
    border: 1px solid var(--border, #E3E3E3);
    color: var(--primary, #4578ec);
    font-family: inherit;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    border-radius: 8px;
    padding: 7px 12px;
    cursor: pointer;
    white-space: nowrap;
}
.sched-toggle:active { transform: scale(0.97); }
.sched.collapsed .sched-extra { display: none; }
.sched .line-item.sched-current { background: var(--accent-blue, #DDF5FF); border-radius: 8px; padding-left: 10px; padding-right: 10px; }
.sched-current-empty { display: none; }
.sched.collapsed .sched-current-empty { display: block; }
.topbar .actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--radius-pill); background: var(--white); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text); box-shadow: var(--shadow-sm); }
.icon-btn svg { width: 20px; height: 20px; }

/* Sayfa başlığı (geri butonlu) */
.page-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg); position: sticky; top: 0; z-index: 5; }
.page-head .back { width: 38px; height: 38px; border-radius: var(--radius-pill); background: var(--white); border: 1px solid var(--border); display: grid; place-items: center; flex: none; }
.page-head .title { font-size: 18px; font-weight: 700; }

/* Kartlar */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px; box-shadow: var(--shadow-card); }
.card-flat { background: var(--card); border-radius: var(--radius-card); padding: 16px; }
.notice-card { border-radius: var(--radius-card); padding: 16px; background: linear-gradient(135deg, var(--blue-200), var(--blue-100)); color: var(--text); }
.notice-card .nc-title { font-weight: 700; margin-bottom: 4px; }

/* Çocuk/öğe kartı */
.child-card { display: flex; align-items: center; gap: 14px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px; box-shadow: var(--shadow-card); width: 100%; text-align: left; }
.child-card:active { transform: scale(.995); }
.avatar { width: 54px; height: 54px; border-radius: var(--radius-pill); background: var(--blue-100); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 18px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.child-card .info { flex: 1; min-width: 0; }
.child-card .info .name { font-weight: 700; }
.child-card .info .sub { color: var(--text-secondary); font-size: 13px; }
.child-card .chev { color: var(--text-secondary); flex: none; }

/* Renkli mini kartlar */
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { border-radius: var(--radius-card); padding: 16px; min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; }
.tile .tile-ic { width: 34px; height: 34px; display: grid; place-items: center; background: rgba(255,255,255,.55); border-radius: 10px; }
.tile .tile-ic svg { width: 20px; height: 20px; }
.tile .tile-t { font-weight: 700; }
.tile.pink { background: var(--accent-pink); } .tile.yellow { background: var(--accent-yellow); }
.tile.cyan { background: var(--accent-cyan); } .tile.blue { background: var(--blue-200); }

/* İstatistik kartları */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px; text-align: center; box-shadow: var(--shadow-sm); }
.stat .num { font-size: 22px; font-weight: 800; }
.stat .lbl { font-size: 11px; color: var(--text-secondary); }

/* Satır menü */
.list-group { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-card); }
.list-row { display: flex; align-items: center; gap: 14px; padding: 15px 16px; width: 100%; text-align: left; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row .lr-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.list-row .lr-ic svg { width: 18px; height: 18px; }
.list-row .lr-title { flex: 1; font-weight: 600; }
.list-row .chev { color: var(--text-secondary); }

/* Butonlar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 20px; border-radius: var(--radius-sm); font-weight: 700; font-size: 16px; background: var(--primary); color: #fff; transition: background .15s, opacity .15s; }
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-outline { background: var(--white); color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost { background: var(--card); color: var(--text); }
.btn-danger { background: var(--danger); } .btn-danger:hover { background: #db4344; }
.btn-success { background: var(--success); } .btn-success:hover { background: #28a564; }
.btn-sm { height: 40px; font-size: 14px; padding: 0 14px; }

/* Formlar */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 600; }
.input, input.input, select.input, textarea.input { width: 100%; height: 52px; padding: 0 14px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 12px 14px; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(69,120,236,.12); }
.input::placeholder { color: #aeb1b8; }
.input:disabled, .input[readonly] { background: #eef0f5; color: #888; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .col-span { grid-column: 1 / -1; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }
.phone-input { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; height: 52px; }
.phone-input .cc { font-weight: 700; }
.phone-input input { flex: 1; border: none; outline: none; height: 100%; letter-spacing: 1px; background: transparent; }
.otp-input { width: 100%; height: 64px; text-align: center; font-size: 30px; font-weight: 800; letter-spacing: 16px; color: var(--primary); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; }
.otp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(69,120,236,.12); }

/* Adım göstergesi */
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps span { flex: 1; height: 6px; border-radius: 6px; background: var(--border); }
.steps span.on { background: var(--primary); }

/* Galeri */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery-grid .g-item { aspect-ratio: 1/1; border-radius: var(--radius-sm); overflow: hidden; background: var(--blue-100); display: block; }
.gallery-grid .g-item img { width: 100%; height: 100%; object-fit: cover; }

/* Liste satırı (program/yemek) */
.line-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.line-item:last-child { border-bottom: none; }
.line-item .time { font-weight: 700; color: var(--primary); min-width: 90px; }
.line-item .li-body { flex: 1; }
.line-item .li-body .li-t { font-weight: 600; }
.line-item .li-body .li-s { color: var(--text-secondary); font-size: 13px; }

/* Rozet / durum */
.badge { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; }
.badge.pending { background: var(--accent-yellow); color: #8a6d00; }
.badge.approved { background: rgba(46,184,114,.15); color: #1c7a4d; }
.badge.rejected { background: rgba(246,85,86,.15); color: #b22; }
.badge.in_queue { background: var(--blue-100); color: var(--primary); }
.badge.suggested { background: var(--accent-cyan); color: #0d6b86; }

/* Flash mesajlar */
.flash { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; font-weight: 600; }
.flash.success { background: rgba(46,184,114,.12); color: #1c7a4d; }
.flash.error { background: rgba(246,85,86,.12); color: #b22; }
.flash.info { background: var(--blue-100); color: var(--primary); }

/* Boş durum */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 20px; color: var(--text-secondary); text-align: center; }
.empty .empty-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--card); display: grid; place-items: center; }
.empty .empty-ic svg { width: 28px; height: 28px; color: var(--text-secondary); }

/* Alt menü */
.bottom-nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: var(--frame-max); height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); display: flex; align-items: stretch; background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-top: 1px solid var(--border); box-shadow: var(--shadow-nav); z-index: 20; }
.bottom-nav .nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-secondary); font-size: 11px; font-weight: 600; }
.bottom-nav .nav-item svg { width: 24px; height: 24px; }
.bottom-nav .nav-item.active { color: var(--primary); }

/* Onboarding/giriş illüstrasyon */
.illus { width: 120px; height: 120px; margin: 0 auto; border-radius: 24px; background: linear-gradient(135deg, var(--blue-200), var(--accent-cyan)); display: grid; place-items: center; }
.illus svg { width: 56px; height: 56px; color: var(--primary); }

/* QR/yollanma yardımcı */
.doc { background:#fff; border:1px solid var(--border); border-radius: var(--radius-card); padding: 20px; }
