/* ============================================================
   CRM Mateknoloji — Ana Stil Dosyası
   ============================================================ */

:root {
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 0px;
    --topbar-height: 60px;
    --sidebar-bg: #1a1f3a;
    --sidebar-hover: rgba(255,255,255,.08);
    --sidebar-active: rgba(79,142,247,.2);
    --sidebar-active-border: #4f8ef7;
    --primary: #4f8ef7;
}

/* ── Body ── */
body {
    background-color: #f4f6fb;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: #212529;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    transition: transform .25s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #4f8ef7, #6c63ff);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand { line-height: 1.2; }

/* Menü */
.sidebar-menu { padding-bottom: 1rem; }

.menu-section {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
    padding: .75rem 1rem .25rem;
    margin-top: .25rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 1rem;
    margin: 1px .5rem;
    border-radius: 8px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.menu-item i { font-size: 1rem; flex-shrink: 0; }

.menu-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.menu-item.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left: 3px solid var(--sidebar-active-border);
    margin-left: calc(.5rem - 3px);
}

/* ── Main Wrapper ── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
}

/* ── Topbar ── */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar-title { font-size: .9rem; font-weight: 600; }

/* ── Main Content ── */
.main-content { flex: 1; }

/* ── Cards ── */
.kpi-card { border-radius: 12px; transition: transform .15s; }
.kpi-card:hover { transform: translateY(-2px); }
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: .75rem; }
.kpi-icon { border-radius: 10px !important; }

/* ── Avatar ── */
.avatar-sm {
    width: 32px; height: 32px;
    flex-shrink: 0;
}

/* ── Badge ── */
.badge { font-weight: 500; }

/* ── Tables ── */
.table th {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
    padding: .65rem .75rem;
}
.table td { padding: .65rem .75rem; vertical-align: middle; }

/* ── Forms ── */
.form-label { font-size: .82rem; margin-bottom: .3rem; }
.form-label-sm { font-size: .75rem; }
.form-control, .form-select {
    font-size: .85rem;
    border-color: #dee2e6;
    border-radius: 8px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(79,142,247,.15);
}
.input-group-text { border-color: #dee2e6; }

/* ── Buttons ── */
.btn { font-size: .82rem; border-radius: 8px; }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: #3a7ae0;
    border-color: #3a7ae0;
}

/* ── Alerts ── */
.alert { border-radius: 10px; font-size: .85rem; }

/* ── Sidebar Overlay (mobil) ── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    display: none;
}
.sidebar-overlay.show { display: block; }

/* ── Scrollbar (sidebar) ── */
.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* ── Progress bars ── */
.progress { border-radius: 50px; }

/* ── List group ── */
.list-group-item { border-color: #f0f0f0; }
.list-group-item-action:hover { background: #f8f9fa; }

/* ── Dropdown ── */
.dropdown-menu { border-radius: 10px; border-color: #e9ecef; font-size: .82rem; }
.dropdown-item { padding: .45rem 1rem; border-radius: 6px; margin: 1px .25rem; }
.dropdown-item:hover { background: #f0f4ff; }

/* ── Pagination ── */
.page-link { border-radius: 6px !important; margin: 0 2px; font-size: .78rem; }

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
    }
}

/* ── Sidebar collapsed (desktop toggle) ── */
body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}
body.sidebar-collapsed .main-wrapper {
    margin-left: 0;
}

/* ── Card headers ── */
.card-header h6 { font-size: .85rem; }

/* ── Activity timeline icons ── */
.rounded-circle.bg-primary-subtle,
.rounded-circle.bg-success-subtle,
.rounded-circle.bg-info-subtle,
.rounded-circle.bg-warning-subtle,
.rounded-circle.bg-danger-subtle,
.rounded-circle.bg-secondary-subtle {
    flex-shrink: 0;
}

/* ── Sticky sidebar on detail pages ── */
.sticky-top { top: calc(var(--topbar-height) + 1rem) !important; }

/* ── Hover utility ── */
.hover-white:hover { color: #fff !important; }
