/* ============================================
   CRM Eket - Ana Stil Dosyası
   Kurumsal, Açık, Ferah Tasarım
   ============================================ */

/* Google Fonts - Inter (Kurumsal) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ==================== CSS DEĞİŞKENLERİ ==================== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #059669;
    --success-light: #d1fae5;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --info: #0891b2;
    --info-light: #cffafe;

    --bg-body: #f1f5f9;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --bg-sidebar-active: #2563eb;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    --text-sidebar: #cbd5e1;

    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 6px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    --sidebar-width: 260px;
    --header-height: 64px;
    --transition: all 0.2s ease;
}

/* ==================== GENEL ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ==================== LAYOUT ==================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.app-sidebar::-webkit-scrollbar {
    width: 4px;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background: var(--bg-sidebar-hover);
    border-radius: 4px;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

.app-header {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}

.app-content {
    flex: 1;
    padding: 24px;
}

/* ==================== SIDEBAR ==================== */
.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand h2 {
    color: var(--text-white);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-brand h2 span {
    color: var(--primary);
    font-weight: 300;
}

.sidebar-brand small {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-menu {
    padding: 12px 0;
}

.sidebar-menu-label {
    padding: 12px 20px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-sidebar);
    font-size: 13.5px;
    font-weight: 400;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-white);
    border-left-color: var(--primary);
}

.sidebar-menu a.active {
    background: rgba(37, 99, 235, 0.15);
    color: var(--text-white);
    border-left-color: var(--primary);
    font-weight: 500;
}

.sidebar-menu a i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
    text-align: center;
    opacity: 0.7;
}

.sidebar-menu a.active i,
.sidebar-menu a:hover i {
    opacity: 1;
}

.sidebar-menu .menu-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* ==================== HEADER ==================== */
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
}

.sidebar-toggle:hover {
    background: var(--bg-body);
}

.page-title-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-search {
    position: relative;
}

.header-search input {
    width: 280px;
    padding: 8px 16px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    background: var(--bg-body);
    transition: var(--transition);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.header-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.header-notification {
    position: relative;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.header-notification:hover {
    background: var(--bg-body);
    color: var(--primary);
}

.header-notification .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 10px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.header-user:hover {
    background: var(--bg-body);
}

.header-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.header-user-info {
    line-height: 1.3;
}

.header-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==================== SAYFA İÇERİĞİ ==================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.page-breadcrumb a {
    color: var(--text-secondary);
}

.page-breadcrumb a:hover {
    color: var(--primary);
}

.page-breadcrumb .separator {
    font-size: 10px;
}

/* ==================== KARTLAR ==================== */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

.card-header h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ==================== STAT KARTLARI ==================== */
.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-card-icon.bg-primary { background-color: var(--primary-light) !important; color: var(--primary) !important; }
.stat-card-icon.bg-success { background-color: var(--success-light) !important; color: var(--success) !important; }
.stat-card-icon.bg-warning { background-color: var(--warning-light) !important; color: var(--warning) !important; }
.stat-card-icon.bg-danger { background-color: var(--danger-light) !important; color: var(--danger) !important; }
.stat-card-icon.bg-info { background-color: var(--info-light) !important; color: var(--info) !important; }

.stat-card-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* ==================== TABLOLAR ==================== */
.table {
    font-size: 13.5px;
}

.table > thead > tr > th {
    background: var(--bg-body);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.table > tbody > tr:hover {
    background: rgba(37, 99, 235, 0.02);
}

.table .actions {
    white-space: nowrap;
}

/* ==================== FORMLAR ==================== */
.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==================== BUTONLAR ==================== */
.btn {
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.btn i {
    font-size: 14px;
}

/* Bootstrap buton renklerini tema ile uyumlu hale getir */
.btn-primary { background-color: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background-color: var(--success); border-color: var(--success); }
.btn-success:hover { background-color: #047857; border-color: #047857; }
.btn-danger { background-color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background-color: #b91c1c; border-color: #b91c1c; }
.btn-warning { background-color: var(--warning); border-color: var(--warning); color: white; }
.btn-warning:hover { background-color: #b45309; border-color: #b45309; color: white; }
.btn-info { background-color: var(--info); border-color: var(--info); }
.btn-info:hover { background-color: #0e7490; border-color: #0e7490; }

.btn-sm {
    font-size: 12px;
    padding: 5px 10px;
}

.btn-lg {
    font-size: 15px;
    padding: 10px 24px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
}

/* ==================== BADGE ==================== */
.badge {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.badge.bg-primary { background-color: var(--primary) !important; }
.badge.bg-success { background-color: var(--success) !important; }
.badge.bg-danger { background-color: var(--danger) !important; }
.badge.bg-warning { background-color: var(--warning) !important; color: white !important; }
.badge.bg-info { background-color: var(--info) !important; }
.badge.bg-secondary { background-color: var(--secondary) !important; }

/* ==================== ALERT ==================== */
.alert {
    border-radius: var(--border-radius);
    padding: 12px 16px;
    font-size: 13.5px;
    margin-bottom: 16px;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
}

.alert-info {
    background: var(--info-light);
    color: #155e75;
}

.alert .btn-close {
    margin-left: auto;
    font-size: 10px;
}

/* ==================== MODAL ==================== */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header .modal-title {
    font-size: 16px;
    font-weight: 600;
}

/* ==================== DROPDOWN ==================== */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    font-size: 13px;
}

.dropdown-item {
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
}

.dropdown-item:hover {
    background: var(--bg-body);
    color: var(--primary);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-divider {
    margin: 4px 0;
    border-color: var(--border-color);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h5 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ==================== FİLTRE BARI ==================== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-body);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.filter-bar .form-control,
.filter-bar .form-select {
    max-width: 200px;
    font-size: 13px;
    padding: 6px 10px;
}

.filter-bar .btn {
    font-size: 13px;
    padding: 6px 14px;
}

/* ==================== TAB ==================== */
.nav-tabs .nav-link {
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

/* ==================== TIMELINE ==================== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-white);
}

.timeline-item .time {
    font-size: 12px;
    color: var(--text-muted);
}

.timeline-item .content {
    font-size: 13.5px;
    color: var(--text-primary);
}

/* ==================== LOGIN SAYFASI ==================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.login-card .logo h1 span {
    color: var(--primary);
}

.login-card .logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.login-card .form-control {
    padding: 10px 14px;
    font-size: 14px;
}

.login-card .btn-primary {
    width: 100%;
    padding: 10px;
    font-size: 15px;
    font-weight: 600;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .header-search input {
        width: 200px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-control,
    .filter-bar .form-select {
        max-width: 100%;
    }
}

@media (max-width: 767.98px) {
    .app-content {
        padding: 16px;
    }

    .app-header {
        padding: 0 16px;
    }

    .header-search {
        display: none;
    }

    .header-user-info {
        display: none;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .stat-card-content h3 {
        font-size: 20px;
    }

    .card-body {
        padding: 16px;
    }

    .table thead th,
    .table tbody td {
        padding: 10px 12px;
    }
}

@media (max-width: 575.98px) {
    .login-card {
        padding: 24px;
    }

    .page-header h1 {
        font-size: 20px;
    }
}

/* ==================== YARDIMCI SINIFLAR ==================== */
/* Not: Bootstrap text-* ve bg-* siniflarini override etmiyoruz */

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-16 { font-size: 16px; }

.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.cursor-pointer { cursor: pointer; }

/* Animasyonlar */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Print */
@media print {
    .app-sidebar,
    .app-header,
    .sidebar-overlay,
    .btn,
    .filter-bar {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .app-content {
        padding: 0 !important;
    }
}
