:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f4f6fb;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --sidebar-w: 250px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { text-decoration: none; color: inherit; }

.app-wrapper { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    background: #111827;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 20px 0;
}
.sidebar-logo {
    font-size: 18px;
    font-weight: 700;
    padding: 0 20px 20px;
    color: #fff;
    border-bottom: 1px solid #1f2937;
    margin-bottom: 10px;
}
.sidebar-menu { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.sidebar-menu a {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14.5px;
    color: #cbd5e1;
}
.sidebar-menu a:hover { background: #1f2937; color: #fff; }
.sidebar-menu a.aktif { background: var(--primary); color: #fff; }
.sidebar-ayrac {
    margin: 12px 8px 6px;
    padding-top: 10px;
    border-top: 1px solid #1f2937;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: .05em;
}
.cikis-link { color: #f87171 !important; margin-top: 8px; }

/* ANA İÇERİK */
.ana-icerik { flex: 1; min-width: 0; }
.ust-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mobil-menu-btn { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }
.ust-bar-sag { display: flex; gap: 10px; align-items: center; }
.kullanici-adi { font-weight: 600; }
.rol-etiket {
    background: #eef2ff; color: var(--primary);
    font-size: 12px; padding: 3px 10px; border-radius: 20px;
}
.icerik-kutu { padding: 24px; max-width: 1200px; }

/* AUTH SAYFALARI (login/kayıt) */
.app-wrapper.auth-mode { align-items: center; justify-content: center; width: 100%; }
.app-wrapper.auth-mode .ana-icerik { display: flex; align-items: center; justify-content: center; width: 100%; }
.auth-kutu {
    background: #fff; padding: 40px; border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08); width: 100%; max-width: 400px;
    margin: 40px auto;
}
.auth-kutu h1 { font-size: 22px; margin-bottom: 4px; }
.auth-kutu p.alt-metin { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.auth-alt-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.auth-alt-link a { color: var(--primary); font-weight: 600; }

/* KART / TABLO / FORM ORTAK STİLLER */
.kart {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 12px; padding: 22px; margin-bottom: 20px;
}
.kart h2, .kart h3 { margin-top: 0; }
.sayfa-baslik { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px;}
.sayfa-baslik h1 { margin: 0; font-size: 22px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.istatistik-kart { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.istatistik-kart .sayi { font-size: 26px; font-weight: 700; }
.istatistik-kart .etiket { color: var(--text-muted); font-size: 13px; }

.form-grup { margin-bottom: 16px; }
.form-grup label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.form-grup input, .form-grup select, .form-grup textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; font-family: inherit;
}
.form-grup input:focus, .form-grup select:focus, .form-grup textarea:focus {
    outline: none; border-color: var(--primary);
}
.form-satir { display: flex; gap: 14px; }
.form-satir .form-grup { flex: 1; }

.btn {
    display: inline-block; padding: 10px 18px; border-radius: 8px;
    background: var(--primary); color: #fff; border: none;
    font-size: 14px; font-weight: 600; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--primary-dark); }
.btn-tam { width: 100%; }
.btn-kucuk { padding: 6px 12px; font-size: 13px; }
.btn-yesil { background: var(--success); }
.btn-yesil:hover { background: #15803d; }
.btn-kirmizi { background: var(--danger); }
.btn-kirmizi:hover { background: #b91c1c; }
.btn-gri { background: #64748b; }
.btn-gri:hover { background: #475569; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 13px; text-transform: uppercase; }
tr:hover td { background: #f8fafc; }
.tablo-wrap { overflow-x: auto; }

.badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-bekleyen { background: #fef3c7; color: var(--warning); }
.badge-onay { background: #dcfce7; color: var(--success); }
.badge-red { background: #fee2e2; color: var(--danger); }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }

.bos-durum { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* HAFTALIK PLAN TABLOSU */
.plan-tablo td, .plan-tablo th { text-align: center; }
.plan-hucre { background: #eef2ff; border-radius: 6px; padding: 6px; font-size: 12.5px; }
.plan-izin { background: #fee2e2; color: #991b1b; }

@media (max-width: 800px) {
    .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; z-index: 100; transition: left .2s; }
    .sidebar.acik { left: 0; }
    .mobil-menu-btn { display: block; }
    .form-satir { flex-direction: column; }
}
