:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #1e293b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --success: #10b981;
    --warning: #f59e0b;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius: 0.5rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }
.w-full { width: 100%; }
.mt-auto { margin-top: auto; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.row-end { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 1rem; }

/* --- Butonlar --------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--border); color: var(--text-main); }
.btn-secondary:hover:not(:disabled) { background: #cbd5e1; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-dark); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-link {
    background: none; border: none; color: var(--primary);
    cursor: pointer; font-size: 0.85rem; padding: 0.2rem; font-family: inherit;
}
.btn-link:hover { text-decoration: underline; }

/* --- Formlar ---------------------------------------------------------- */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.form-control {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--text-main);
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
textarea.form-control { min-height: 80px; resize: vertical; }
.form-satir { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-satir > * { flex: 1 1 180px; }

/* --- Giriş ------------------------------------------------------------ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.auth-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
}
.auth-title { text-align: center; margin-bottom: 0.25rem; font-size: 1.35rem; }
.auth-kurum {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}
.error-text {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    text-align: center;
}

/* --- Yerleşim --------------------------------------------------------- */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--secondary);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow-y: auto;
}
.sidebar-header { margin-bottom: 1.5rem; }
.sidebar-header h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.15rem; line-height: 1.25; }
.sidebar-kurum {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-bottom: 0.45rem;
    line-height: 1.3;
}
.user-info { font-size: 0.8rem; color: #cbd5e1; }
.user-rol {
    display: inline-block;
    margin-top: 0.3rem;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    background: rgba(255,255,255,0.15);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.nav-links { display: flex; flex-direction: column; gap: 0.25rem; }
.nav-link {
    background: none;
    border: none;
    color: #cbd5e1;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.92rem;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-link.active { background: var(--primary); color: #fff; font-weight: 500; }
.nav-ayrac {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    padding-left: 0.75rem;
}

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    min-height: 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1.5rem;
}
.topbar h3 { font-size: 1.05rem; font-weight: 600; }
.content-pad { padding: 1.5rem; overflow-y: auto; flex: 1; }

/* --- Kartlar ---------------------------------------------------------- */
.kart {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.kart + .kart { margin-top: 1rem; }
.kart-baslik {
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Özet şeridi */
.ozet-serit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.ozet-kutu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
}
.ozet-kutu.uyari { border-left-color: var(--warning); }
.ozet-kutu.tehlike { border-left-color: var(--danger); }
.ozet-kutu.basari { border-left-color: var(--success); }
.ozet-sayi { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.ozet-etiket { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }

/* Görev kartları */
.task-list { display: flex; flex-direction: column; gap: 1rem; }
.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.task-card.gecikti { border-left-color: var(--danger); background: #fef2f2; }
.task-card.bugun { border-left-color: var(--warning); }
.task-card.kapali { border-left-color: var(--success); opacity: 0.85; }
.task-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.task-title { font-weight: 600; font-size: 1.05rem; }
.task-meta { font-size: 0.85rem; color: var(--text-muted); }
.task-meta strong { color: var(--text-main); font-weight: 500; }
.task-eylem { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.6rem; }

.badge {
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.bg-warning { background: var(--warning); color: #fff; }
.bg-success { background: var(--success); color: #fff; }
.bg-danger  { background: var(--danger); color: #fff; }
.bg-muted   { background: var(--border); color: var(--text-muted); }

/* --- Tablolar --------------------------------------------------------- */
.tablo-sarmal { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th {
    text-align: left;
    padding: 0.7rem 0.85rem;
    background: #f1f5f9;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
tbody td { padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
td.eylemler { white-space: nowrap; text-align: right; }
td.eylemler .btn { margin-left: 0.25rem; }

/* --- Takvim ----------------------------------------------------------- */
.takvim-baslik { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.takvim-ay { font-weight: 600; font-size: 1.05rem; min-width: 160px; text-align: center; }
.takvim {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.takvim-gun-adi {
    background: #f1f5f9;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}
.takvim-hucre {
    background: var(--surface);
    min-height: 92px;
    padding: 0.35rem;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.takvim-hucre.bos { background: #fafafa; }
.takvim-hucre.bugun { background: #eff6ff; }
.takvim-gun-no { font-weight: 600; color: var(--text-muted); font-size: 0.8rem; }
.takvim-hucre.bugun .takvim-gun-no { color: var(--primary); }
.takvim-is {
    background: #e0e7ff;
    border-radius: 3px;
    padding: 0.12rem 0.3rem;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.takvim-is.gecikti { background: #fee2e2; color: var(--danger-dark); }
.takvim-is.yapildi { background: #d1fae5; color: #047857; }
.takvim-is.iptal { background: var(--border); color: var(--text-muted); text-decoration: line-through; }

/* --- Tekrar (bakım planı) seçimi -------------------------------------- */
.tekrar-secimler {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
}
.tekrar-secim {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.tekrar-secim:hover { border-color: var(--primary); }
.tekrar-secim.secili {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 0 0 1px var(--primary) inset;
}
.tekrar-secim input { position: absolute; opacity: 0; pointer-events: none; }
.tekrar-ad { font-weight: 600; font-size: 0.92rem; }
.tekrar-aciklama { font-size: 0.76rem; color: var(--text-muted); }

.tekrar-panel {
    margin-top: 1rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #f8fafc;
}
.tekrar-panel > label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.gun-secimler { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.gun-chip {
    min-width: 44px;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s;
}
.gun-chip:hover { border-color: var(--primary); }
.gun-chip.secili {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}
/* Ayın günleri 1-31: dar ve ızgara halinde */
.ay-gunleri .gun-chip { min-width: 38px; padding: 0.35rem 0.2rem; text-align: center; }

/* Önizleme — plan kaydedilmeden hangi günlere düşeceğini gösterir */
.onizleme-kutu {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}
.onizleme-kutu.hatali { background: #fef2f2; border-color: #fca5a5; }
.onizleme-ozet { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.5rem; }
.onizleme-tarihler { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.onizleme-gun {
    background: var(--surface);
    border: 1px solid #bfdbfe;
    border-radius: 9999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    white-space: nowrap;
}

.bg-mavi { background: #dbeafe; color: #1d4ed8; }

/* --- Kip (modal) ------------------------------------------------------ */
.kip-fon {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
}
.kip {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}
.kip-baslik {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.kip-govde { padding: 1.25rem; }
.kip-alt {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.kip-kapat {
    background: none; border: none; font-size: 1.5rem; line-height: 1;
    cursor: pointer; color: var(--text-muted); padding: 0 0.25rem;
}

/* --- Bildirim --------------------------------------------------------- */
#bildirim-alan {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(360px, calc(100vw - 2rem));
}
.bildirim {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    color: #fff;
    font-size: 0.9rem;
    animation: bildirim-gir 0.2s ease-out;
}
.bildirim.basari { background: var(--success); }
.bildirim.hata { background: var(--danger); }
.bildirim.bilgi { background: var(--secondary); }
@keyframes bildirim-gir { from { opacity: 0; transform: translateX(1rem); } }

/* --- Çeşitli ---------------------------------------------------------- */
.bos-durum { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.bos-durum-baslik { font-size: 1.05rem; font-weight: 500; margin-bottom: 0.35rem; color: var(--text-main); }
.yukleniyor { text-align: center; padding: 2rem; color: var(--text-muted); }
.foto-serit { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.foto-serit img {
    width: 88px; height: 88px; object-fit: cover;
    border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer;
}
.onizleme { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.onizleme img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); }
.sayfalama { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; font-size: 0.85rem; }
.filtre-serit {
    display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0.85rem; margin-bottom: 1rem;
}
.filtre-serit .form-group { margin-bottom: 0; min-width: 140px; }

/* --- Ünite ağacı ------------------------------------------------------ */
/* Ana programdaki "bölge > ünite > alt ünite" yapısı. Satırlar liste değil
   düğme: sahada eldivenle dokunulacak, o yüzden yükseklik 56px'in altına
   inmiyor ve tıklama alanı satırın tamamı. */
.unite-arama { margin-bottom: 1rem; }

.unite-bolge {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}
.unite-bolge-baslik {
    padding: 0.7rem 0.9rem;
    background: var(--secondary);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

.unite-satir {
    display: flex;
    align-items: stretch;
    border-top: 1px solid var(--border);
    /* Sol kenardaki renk şeridi ünitenin durumunu bir bakışta veriyor */
    border-left: 4px solid transparent;
}
.unite-satir:first-of-type { border-top: none; }
.unite-satir.gecikti  { border-left-color: var(--danger); }
.unite-satir.bekliyor { border-left-color: var(--warning); }
.unite-satir.tamam    { border-left-color: var(--success); }
.unite-satir.eski     { border-left-color: #cbd5e1; }
.unite-satir.bakimsiz { border-left-color: transparent; }

.unite-ok {
    flex: 0 0 auto;
    width: 2.6rem;
    background: none;
    border: none;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
}
.unite-ok.bos { cursor: default; }

.unite-govde {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-start;
    text-align: left;
    min-height: 56px;
    padding: 0.6rem 0.9rem 0.6rem 0;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
}
.unite-govde:hover { background: var(--background); }
.unite-ad { font-weight: 600; font-size: 0.95rem; }
.unite-sayi {
    display: inline-block;
    min-width: 1.35rem;
    padding: 0 0.35rem;
    margin-left: 0.35rem;
    background: var(--border);
    color: var(--text-muted);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
}
.unite-alt { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.unite-tip {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
}
.unite-durum { font-size: 0.8rem; color: var(--text-muted); }
.unite-satir.gecikti  .unite-durum { color: var(--danger); font-weight: 600; }
.unite-satir.bekliyor .unite-durum { color: #b45309; font-weight: 500; }
.unite-satir.tamam    .unite-durum { color: #047857; }

.unite-bilgi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.unite-bilgi > div { display: flex; flex-direction: column; }
.unite-bilgi span { font-size: 0.72rem; text-transform: uppercase; color: var(--text-muted); }

.unite-gecmis-baslik {
    margin: 1.25rem 0 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
}
.unite-gecmis { display: flex; flex-direction: column; gap: 0.75rem; }
.unite-gecmis-satir {
    padding: 0.7rem;
    background: var(--background);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* --- Alt sekme çubuğu (telefon) --------------------------------------- */
/* Masaüstünde gizli. Telefonda gezinmenin tamamı burada: hamburger menü
   ekranın en üstünde ve tek elle erişilemeyecek yerdeydi. */
.alt-sekme { display: none; }

.hesap-btn { display: none; }

.liste-menu { display: flex; flex-direction: column; }
.liste-menu-satir {
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0.25rem;
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    cursor: pointer;
}
.liste-menu-satir:last-child { border-bottom: none; }
.liste-menu-satir:hover { background: var(--background); }
.liste-menu-satir.tehlike { color: var(--danger); font-weight: 500; }

.hesap-kart {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.hesap-bas-buyuk {
    width: 3rem; height: 3rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; font-weight: 600;
}

/* --- Mobil (saha kuralı: büyük dokunma alanı, az metin) --------------- */
@media (max-width: 860px) {
    /* Kenar çubuğu tamamen gizli: yerini üstteki ince başlık ve alt sekme
       çubuğu aldı. İki başlık şeridi üst üste durmuyor artık. */
    .sidebar { display: none; }

    .app-layout { flex-direction: column; height: 100dvh; }

    .topbar {
        padding: 0.5rem 0.9rem;
        /* Çentik/durum çubuğu altına girmesin */
        padding-top: calc(0.5rem + env(safe-area-inset-top));
        min-height: 0;
        gap: 0.5rem;
        position: sticky;
        top: 0;
        z-index: 30;
    }
    .topbar h3 { font-size: 1.15rem; font-weight: 700; }

    .hesap-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.25rem;
        height: 2.25rem;
        flex: 0 0 auto;
        border-radius: 999px;
        border: none;
        background: var(--primary);
        color: #fff;
        font-family: inherit;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
    }

    .alt-sekme {
        display: flex;
        background: var(--surface);
        border-top: 1px solid var(--border);
        /* Jest çubuğunun üstünde kalsın */
        padding-bottom: env(safe-area-inset-bottom);
        flex: 0 0 auto;
    }
    .alt-sekme-dugme {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        padding: 0.5rem 0.15rem 0.55rem;
        background: none;
        border: none;
        font-family: inherit;
        font-size: 0.68rem;
        line-height: 1.2;
        color: var(--text-muted);
        cursor: pointer;
    }
    .alt-sekme-dugme svg { width: 1.45rem; height: 1.45rem; }
    .alt-sekme-dugme span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .alt-sekme-dugme.active { color: var(--primary); font-weight: 600; }
    .alt-sekme-dugme.active svg { stroke-width: 2.2; }

    .content-pad { padding: 1rem 0.9rem 1.25rem; -webkit-overflow-scrolling: touch; }

    /* Pencereler alttan açılan sayfa gibi: telefonda ortalanmış küçük kutu
       hem klavye açılınca kayıyor hem de başparmakla uzak kalıyordu. */
    .kip-fon { align-items: flex-end; padding: 0; }
    .kip {
        max-width: none;
        max-height: 92dvh;
        border-radius: 1rem 1rem 0 0;
        display: flex;
        flex-direction: column;
    }
    .kip-baslik { padding: 1rem; font-size: 1.05rem; }
    .kip-govde { padding: 1rem; overflow-y: auto; flex: 1; }
    .kip-alt {
        padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
        gap: 0.6rem;
        flex: 0 0 auto;
    }
    .kip-alt .btn { flex: 1; }

    /* Saha: dokunma alanları büyür */
    .btn { padding: 0.85rem 1.1rem; font-size: 1rem; }
    .btn-sm { padding: 0.5rem 0.8rem; font-size: 0.85rem; }
    .form-control { padding: 0.8rem; font-size: 1rem; }
    .task-title { font-size: 1.1rem; }
    .task-card { padding: 1.1rem; }

    /* Sahada eldivenle: satır yükseliyor, yazı büyüyor, ok tuşu genişliyor */
    .unite-govde { min-height: 64px; padding-top: 0.75rem; padding-bottom: 0.75rem; }
    .unite-ad { font-size: 1.05rem; }
    .unite-durum { font-size: 0.85rem; }
    .unite-ok { width: 3rem; font-size: 1.1rem; }

    .ozet-serit { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.75rem; }
    .takvim-hucre { min-height: 64px; font-size: 0.68rem; }
    #bildirim-alan {
        left: 0.75rem;
        right: 0.75rem;
        top: calc(0.75rem + env(safe-area-inset-top));
        max-width: none;
    }

    /* Geniş içerik ekranı taşırmasın; kendi içinde kaysın */
    .tablo-sarmal { -webkit-overflow-scrolling: touch; }
    .filtre-serit { gap: 0.6rem; }
    .filtre-serit .form-group { min-width: 0; flex: 1 1 45%; }

    /* Sayfa içindeki eylem düğmeleri tam genişlik: tek elle basılabilsin */
    .task-eylem .btn { width: 100%; }
}

/* Çok dar telefonlar (küçük ekran, büyük yazı ayarı) */
@media (max-width: 380px) {
    .alt-sekme-dugme span { font-size: 0.62rem; }
    .alt-sekme-dugme svg { width: 1.35rem; height: 1.35rem; }
    .topbar h3 { font-size: 1.05rem; }
}
