/* ===== BİRLİK CRM - ANA STİL DOSYASI ===== */
:root {
    --primary: #1e3a5f;
    --primary-light: #3b82f6;
    --primary-lighter: #93c5fd;
    --accent: #3b82f6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    --purple: #8b5cf6;
    --sidebar-width: 220px;
    --navbar-height: 56px;
    --bottom-nav-height: 60px;
}

[data-bs-theme="dark"] {
    --bs-body-bg: #0f172a;
    --bs-body-color: #e2e8f0;
    --card-bg: #1e293b;
    --border-color: #334155;
    --sidebar-bg: #0f172a;
    --input-bg: #1e293b;
}

[data-bs-theme="light"] {
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --sidebar-bg: #f8fafc;
    --input-bg: #ffffff;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bs-body-bg, #f1f5f9);
    padding-top: var(--navbar-height);
}

/* ===== NAVBAR ===== */
.navbar.bg-primary { background: linear-gradient(135deg, var(--primary) 0%, #2d5a8e 100%) !important; }
.navbar { height: var(--navbar-height); z-index: 1050; }
.navbar-brand { font-size: 1.1rem; }
.navbar-brand img { border-radius: 6px; }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.3s ease;
}

.sidebar-nav { padding: 0.5rem; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: var(--bs-body-color, #475569);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.sidebar-link:hover { background: rgba(59, 130, 246, 0.08); color: var(--accent); }
.sidebar-link.active { background: var(--accent); color: #fff; }
.sidebar-link i { font-size: 1.1rem; width: 20px; text-align: center; }

.sidebar-divider { border-top: 1px solid var(--border-color); margin: 0.5rem 0; }
.sidebar-heading { display: block; padding: 0.5rem 1rem 0.25rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; font-weight: 600; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1035;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left 0.3s ease;
}

/* ===== MOBILE ===== */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .sidebar.show + .sidebar-overlay { display: block; }
    .main-content { margin-left: 0; padding-bottom: calc(var(--bottom-nav-height) + 20px); }
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* ===== RENKLI CARD HEADER'LAR ===== */
.card-header {
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
}

.card-header-primary {
    background: linear-gradient(135deg, #1e3a5f 0%, #3b6cb0 100%);
    color: #fff !important;
    border-bottom: none;
}
.card-header-primary h6,
.card-header-primary i,
.card-header-primary .bi { color: #fff !important; }

.card-header-success {
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    color: #fff !important;
    border-bottom: none;
}
.card-header-success h6,
.card-header-success i,
.card-header-success .bi { color: #fff !important; }

.card-header-warning {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
    color: #fff !important;
    border-bottom: none;
}
.card-header-warning h6,
.card-header-warning i,
.card-header-warning .bi { color: #fff !important; }

.card-header-danger {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
    color: #fff !important;
    border-bottom: none;
}
.card-header-danger h6,
.card-header-danger i,
.card-header-danger .bi { color: #fff !important; }

.card-header-info {
    background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%);
    color: #fff !important;
    border-bottom: none;
}
.card-header-info h6,
.card-header-info i,
.card-header-info .bi { color: #fff !important; }

.card-header-purple {
    background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
    color: #fff !important;
    border-bottom: none;
}
.card-header-purple h6,
.card-header-purple i,
.card-header-purple .bi { color: #fff !important; }

.card-header-dark {
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    color: #fff !important;
    border-bottom: none;
}
.card-header-dark h6,
.card-header-dark i,
.card-header-dark .bi { color: #fff !important; }

/* ===== STAT CARDS ===== */
.stat-card {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { font-size: 0.8rem; color: #94a3b8; }

/* ===== LOGIN ===== */
.login-body {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-header { text-align: center; margin-bottom: 1.5rem; }
.login-logo { font-size: 3rem; margin-bottom: 0.5rem; }
.login-header h1 { font-size: 1.4rem; font-weight: 700; color: var(--primary); margin-bottom: 0.25rem; }
.login-header p { color: #94a3b8; font-size: 0.9rem; }
.login-footer { text-align: center; margin-top: 1.5rem; }

/* ===== TABLE ===== */
.table-responsive { border-radius: 0; overflow: hidden; }
.table { margin-bottom: 0; font-size: 0.88rem; }
.table th { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: #64748b; white-space: nowrap; border-bottom: 2px solid var(--border-color); }
.table td { vertical-align: middle; }

/* ===== BADGES ===== */
.state-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

/* ===== STARS ===== */
.stars-container { display: inline-flex; gap: 2px; }
.star { color: #d1d5db; font-size: 1.2rem; cursor: default; transition: color 0.15s; }
.star.filled { color: #f59e0b; }
.stars-interactive .star { cursor: pointer; }
.stars-interactive .star:hover, .stars-interactive .star:hover ~ .star { color: #fbbf24; }

/* ===== KANBAN ===== */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 400px;
}

.kanban-column {
    min-width: 280px;
    max-width: 320px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.kanban-header {
    padding: 0.75rem 1rem;
    border-bottom: 3px solid;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-header h6 { margin: 0; font-weight: 700; font-size: 0.85rem; }
.kanban-count { font-size: 0.75rem; color: #64748b; background: var(--card-bg); padding: 0.1rem 0.5rem; border-radius: 10px; }

.kanban-body {
    padding: 0.5rem;
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
}

.kanban-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: box-shadow 0.15s, transform 0.15s;
}

.kanban-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.kanban-card.sortable-ghost { opacity: 0.4; }
.kanban-card .kc-company { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.kanban-card .kc-contact { font-size: 0.8rem; color: #64748b; }
.kanban-card .kc-amount { font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.kanban-card .kc-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border-color); font-size: 0.75rem; }

/* ===== FILTERS ===== */
.filter-bar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.filter-bar .form-control, .filter-bar .form-select { font-size: 0.85rem; }

/* ===== FORM ===== */
.form-label { font-weight: 600; font-size: 0.85rem; color: #475569; }

/* ===== NOTE DETAIL ===== */
.comment-list .comment-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-item .comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.comment-item .comment-meta { font-size: 0.75rem; color: #94a3b8; }
.comment-item .comment-text { font-size: 0.9rem; margin-top: 0.25rem; }

/* ===== VOICE RECORDER ===== */
.voice-recorder {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--sidebar-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.voice-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-btn.record { background: var(--danger); color: #fff; }
.voice-btn.record.recording { animation: pulse 1.5s infinite; }
.voice-btn.play { background: var(--accent); color: #fff; }
.voice-btn.stop { background: #6b7280; color: #fff; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}

/* ===== ATTACHMENT ===== */
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.attachment-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    background: var(--sidebar-bg);
}

.attachment-item img { width: 100%; height: 100px; object-fit: cover; }
.attachment-item .att-name { padding: 0.4rem; font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-item .att-icon { height: 100px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }

/* ===== FAB ===== */
.fab-button {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    text-decoration: none;
    z-index: 1020;
    transition: transform 0.2s;
}

.fab-button:hover { transform: scale(1.1); color: #fff; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #94a3b8;
    font-size: 0.65rem;
    gap: 0.15rem;
    padding: 0.25rem 0.5rem;
    transition: color 0.15s;
}

.bottom-nav-item i { font-size: 1.2rem; }
.bottom-nav-item.active { color: var(--accent); }

/* ===== PWA BANNER ===== */
.pwa-banner {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 9999;
    font-size: 0.85rem;
}

/* ===== UTILITIES ===== */
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-accent { color: var(--accent); }
.bg-accent { background: var(--accent); }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state h5 { color: #64748b; }
.empty-state p { color: #94a3b8; font-size: 0.9rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 575.98px) {
    .stat-card { padding: 0.75rem; }
    .stat-card .stat-value { font-size: 1.2rem; }
    .kanban-column { min-width: 260px; }
    .filter-bar { padding: 0.75rem; }
    .card-body { padding: 0.75rem; }
}
