/* ================== CRM PANEL ================== */
:root {
    --p-bg: #f4f6fa;
    --p-card: #ffffff;
    --p-ink: #1c2534;
    --p-muted: #6a7686;
    --p-line: #e4e8f0;
    --p-accent: #2e5ca6;
    --p-accent-soft: #e7eef9;
    --p-sidebar-w: 232px;
}

html, body { height: 100%; }

body.panel-body {
    background: var(--p-bg);
    color: var(--p-ink);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14.5px;
}

/* ---------- Sidebar ---------- */
.p-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--p-sidebar-w);
    background: #fff;
    border-right: 1px solid var(--p-line);
    overflow-y: auto;
    z-index: 1030;
}

.p-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 18px; border-bottom: 1px solid var(--p-line);
    text-decoration: none;
}
.p-logo .ikon {
    width: 34px; height: 34px; border-radius: 8px;
    background: var(--p-accent); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.p-logo b { color: var(--p-ink); font-size: 16px; }
.p-logo small { display: block; color: var(--p-muted); font-size: 11px; }

.p-menu { padding: 10px 0 30px; }
.p-menu .modul-btn {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 18px; border: 0; background: none;
    color: var(--p-ink); font-size: 14px; text-decoration: none; text-align: left;
}
.p-menu .modul-btn:hover { background: var(--p-bg); }
.p-menu .modul-btn i.mi { color: var(--p-muted); font-size: 15px; width: 18px; }
.p-menu .modul-btn .ok { margin-left: auto; font-size: 11px; color: var(--p-muted); transition: transform .15s; }
.p-menu .modul-btn[aria-expanded="true"] .ok { transform: rotate(90deg); }
.p-menu .modul-btn.aktif, .p-menu .modul-btn.aktif i.mi { color: var(--p-accent); font-weight: 600; }
.p-menu .alt a {
    display: block; padding: 7px 18px 7px 46px;
    color: var(--p-muted); font-size: 13.5px; text-decoration: none;
    border-left: 3px solid transparent;
}
.p-menu .alt a:hover { color: var(--p-ink); background: var(--p-bg); }
.p-menu .alt a.aktif { color: var(--p-accent); border-left-color: var(--p-accent); background: var(--p-accent-soft); font-weight: 600; }

/* ---------- Topbar ---------- */
.p-main { margin-left: var(--p-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.p-topbar {
    background: #fff; border-bottom: 1px solid var(--p-line);
    padding: 10px 24px;
    display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 1020;
}
.p-topbar .ara { position: relative; width: 300px; }
.p-topbar .ara input { padding-left: 34px; }
.p-topbar .ara .bi-search { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--p-muted); }
.p-topbar .ara .sonuc {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #fff; border: 1px solid var(--p-line); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(28,37,52,.12); display: none; overflow: hidden;
}
.p-topbar .ara .sonuc a { display: block; padding: 8px 12px; color: var(--p-ink); text-decoration: none; font-size: 13.5px; }
.p-topbar .ara .sonuc a:hover { background: var(--p-bg); }
.p-topbar .kullanici { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.p-topbar .kullanici .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--p-accent-soft); color: var(--p-accent);
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}

/* ---------- İçerik ---------- */
.p-icerik { padding: 22px 24px 40px; flex: 1; }

.p-crumb { font-size: 13px; color: var(--p-muted); margin-bottom: 6px; }
.p-crumb a { color: var(--p-muted); text-decoration: none; }
.p-baslik { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.p-baslik h1 { font-size: 24px; font-weight: 700; margin: 0; }
.p-baslik .sag { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Kartlar ---------- */
.p-kart {
    background: var(--p-card); border: 1px solid var(--p-line);
    border-radius: 10px; padding: 18px 20px; margin-bottom: 18px;
}
.p-kart h2 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.p-kart .alt-baslik { color: var(--p-muted); font-size: 12.5px; margin-bottom: 12px; }

.stat-satir { display: grid; gap: 14px; margin-bottom: 18px; }
.stat-satir.k4 { grid-template-columns: repeat(4, 1fr); }
.stat-satir.k5 { grid-template-columns: repeat(5, 1fr); }
.stat-satir.k6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1200px) { .stat-satir.k4, .stat-satir.k5, .stat-satir.k6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .stat-satir.k4, .stat-satir.k5, .stat-satir.k6 { grid-template-columns: repeat(2, 1fr); } }

.stat-kart {
    background: var(--p-card); border: 1px solid var(--p-line);
    border-radius: 10px; padding: 14px 16px;
}
.stat-kart .ust { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-kart .ust i { font-size: 16px; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.stat-kart .rozet { font-size: 11px; color: var(--p-muted); }
.stat-kart .deger { font-size: 22px; font-weight: 800; line-height: 1.1; }
.stat-kart .etiket { font-size: 12.5px; color: var(--p-muted); margin-top: 2px; }

.ikon-mavi { background: var(--p-accent-soft); color: var(--p-accent); }
.ikon-yesil { background: #e3f4ea; color: #198754; }
.ikon-sari { background: #fdf3e0; color: #b7791f; }
.ikon-kirmizi { background: #fdeaea; color: #c0392b; }
.ikon-mor { background: #efe9fb; color: #6f42c1; }
.ikon-turkuaz { background: #e2f5f5; color: #0d8a8a; }

/* ---------- Tablo ---------- */
.p-tablo-sarici { overflow-x: auto; }
.p-tablo { width: 100%; border-collapse: collapse; font-size: 14px; }
.p-tablo th {
    text-align: left; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase;
    color: var(--p-muted); padding: 10px 12px; border-bottom: 2px solid var(--p-line);
    white-space: nowrap;
}
.p-tablo td { padding: 10px 12px; border-bottom: 1px solid var(--p-line); vertical-align: middle; }
.p-tablo tr:hover td { background: #f9fafc; }
.p-tablo .islemler { white-space: nowrap; text-align: right; }

.bos-durum { text-align: center; color: var(--p-muted); padding: 46px 20px; }
.bos-durum i { font-size: 34px; display: block; margin-bottom: 10px; opacity: .5; }

/* ---------- Rozetler ---------- */
.rz { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.rz-gri { background: #eef1f6; color: var(--p-muted); }
.rz-mavi { background: var(--p-accent-soft); color: var(--p-accent); }
.rz-yesil { background: #e3f4ea; color: #198754; }
.rz-sari { background: #fdf3e0; color: #9a6b1e; }
.rz-kirmizi { background: #fdeaea; color: #c0392b; }
.rz-mor { background: #efe9fb; color: #6f42c1; }

/* ---------- Filtre paneli ---------- */
.filtre-panel .form-label { font-size: 12.5px; font-weight: 600; color: var(--p-muted); margin-bottom: 4px; }

/* ---------- Form ---------- */
.form-label .zorunlu { color: #c0392b; }
.modal-lg-crm { max-width: 900px; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 20px; }
.kanban-sutun { background: #eef1f6; border-radius: 10px; min-width: 280px; width: 280px; padding: 10px; }
.kanban-sutun h6 { font-size: 13px; font-weight: 700; padding: 4px 6px; display: flex; justify-content: space-between; }
.kanban-kart { background: #fff; border: 1px solid var(--p-line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; }
.kanban-kart .kk-baslik { font-weight: 600; font-size: 13.5px; }
.kanban-kart .kk-alt { color: var(--p-muted); font-size: 12px; margin-top: 4px; display: flex; justify-content: space-between; }

/* ---------- Takvim ---------- */
.takvim-sarici { overflow-x: auto; }
.takvim { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 900px; }
.takvim th { border: 1px solid var(--p-line); background: #fff; padding: 8px; font-size: 13px; text-align: center; }
.takvim th.bugun { color: var(--p-accent); background: var(--p-accent-soft); }
.takvim td { border: 1px solid var(--p-line); height: 44px; vertical-align: top; padding: 2px 4px; background: #fff; }
.takvim td.bugun { background: #f4f8fe; }
.takvim .saat { width: 56px; text-align: right; color: var(--p-muted); font-size: 11.5px; background: var(--p-bg); padding-right: 8px; }
.takvim .etkinlik {
    display: block; border-radius: 6px; padding: 2px 6px; margin-bottom: 2px;
    font-size: 11.5px; color: #fff; text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Login ---------- */
.login-sayfa {
    min-height: 100vh; background: #f0f3f8;
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-kutu { display: grid; grid-template-columns: 1fr 1fr; max-width: 960px; width: 100%; gap: 28px; align-items: stretch; }
@media (max-width: 860px) { .login-kutu { grid-template-columns: 1fr; } .login-tanitim { display: none; } }
.login-tanitim {
    background: linear-gradient(150deg, #16233c, #2e5ca6);
    border-radius: 16px; color: #fff; padding: 42px 38px;
    display: flex; flex-direction: column; justify-content: center;
}
.login-tanitim h1 { font-size: 28px; font-weight: 800; line-height: 1.25; }
.login-tanitim h1 span { color: #9ec2f5; }
.login-tanitim p { color: #c6d4ea; }
.login-tanitim li { margin-bottom: 8px; color: #dfe9f8; list-style: none; }
.login-tanitim li i { color: #7fd8a5; margin-right: 8px; }
.login-form { background: #fff; border-radius: 16px; padding: 42px 38px; display: flex; flex-direction: column; justify-content: center; }

/* ---------- Dashboard mini listeler ---------- */
.mini-liste { list-style: none; margin: 0; padding: 0; }
.mini-liste li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--p-line); font-size: 13.5px; }
.mini-liste li:last-child { border-bottom: 0; }
.mini-liste .zaman { margin-left: auto; color: var(--p-muted); font-size: 12px; white-space: nowrap; }

/* ---------- Sekmeler ---------- */
.p-sekmeler { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 4px; gap: 4px; margin-bottom: 18px; }
.p-sekmeler a {
    padding: 7px 16px; border-radius: 8px; text-decoration: none;
    color: var(--p-muted); font-size: 13.5px; font-weight: 600;
}
.p-sekmeler a.aktif { background: #fff; color: var(--p-accent); box-shadow: 0 1px 4px rgba(28,37,52,.08); }
.p-sekmeler .sayi { font-size: 11px; background: var(--p-accent-soft); color: var(--p-accent); border-radius: 999px; padding: 1px 7px; margin-left: 5px; }

/* ---------- Mobil ---------- */
@media (max-width: 992px) {
    .p-sidebar { transform: translateX(-100%); transition: transform .2s; }
    .p-sidebar.acik { transform: translateX(0); }
    .p-main { margin-left: 0; }
    .p-topbar .ara { width: 160px; }
}
