/* --- Değişkenler ile Tema Yönetimi (Siyah & Beyaz) --- */
:root {
    --bg-color: #f8f8f8;
    --sidebar-bg-color: #ffffff;
    --card-bg-color: #ffffff;
    --text-color: #111111;
    --subtle-text-color: #888888;
    --primary-color: #222222;
    --primary-hover-color: #000000;
    --border-color: #dcdcdc;
    --shadow-color: rgba(0, 0, 0, 0.06);
    --input-bg-color: #f0f0f0;
    --amount-color: #27ae60;
    /* Yeşil Renk */
    --due-soon-color: #e67e22;
    --overdue-color: #e74c3c;
    --commission-color: #3498db;
    --ai-color: #8e44ad;
    --success-color: #27ae60;
    --warning-color: #f39c12;
}

body.dark-mode {
    --bg-color: #000000;
    --sidebar-bg-color: #121212;
    --card-bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --subtle-text-color: #aaaaaa;
    --primary-color: #e0e0e0;
    --primary-hover-color: #ffffff;
    --border-color: #4a4a4a;
    --shadow-color: rgba(0, 0, 0, 0.25);
    --input-bg-color: #2a2a2a;
    --amount-color: #2ecc71;
    --ai-color: #9b59b6;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
}

/* --- Genel Stiller ve Sıfırlama --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100vh;
    overflow: hidden;
    /* Scrollu ana elementte kontrol edeceğiz */
}

/* ===== SCROLLBAR STİLLERİ ===== */
/* WebKit tarayıcılar (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
    border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--subtle-text-color);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-color);
}

/* Material Symbols Font */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined', 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga';
}

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

/* --- Yan Menü (Sidebar) --- */
.sidebar {
    width: 208px;
    background-color: var(--sidebar-bg-color);
    height: 100%;
    padding: 1.5rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: background-color 0.4s ease, border-color 0.4s ease;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.sidebar-header .logo {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    border-radius: 10px;
    color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar .nav-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--subtle-text-color);
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    text-align: left;
}

.sidebar .nav-btn:hover,
.sidebar .nav-btn.active {
    background-color: var(--input-bg-color);
    color: var(--text-color);
}

.sidebar .nav-btn.active {
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* --- Ana İçerik --- */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

header h1 {
    font-weight: 600;
    font-size: 1.8rem;
}

#current-date-display {
    font-size: 1rem;
    font-weight: 500;
    color: var(--subtle-text-color);
    margin-top: 0.25rem;
    margin-bottom: 1.5rem;
}

.page-content.hidden {
    display: none;
}

/* --- PANO SAYFASI YERLEŞİMİ --- */
.dashboard-top-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card-single {
    min-height: 120px;
}

.stat-card-combined {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
}

.combined-stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.combined-stat-divider {
    width: 1px;
    height: 60px;
    background-color: var(--border-color);
    margin: 0 1rem;
}

.stat-card h2 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--subtle-text-color);
    margin-bottom: 0.5rem;
}

.combined-stat-item h2 {
    font-size: 0.64rem;
}

.stat-amount {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--amount-color);
}

.combined-stat-item .stat-amount {
    font-size: 1.05rem;
}

.stat-amount.expected {
    color: var(--text-color);
}

.stat-amount.commission {
    color: var(--commission-color);
}

/* --- Risk Indicator --- */
.risk-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    min-width: 80px;
}

.risk-indicator.risk-low {
    background-color: rgba(39, 174, 96, 0.1);
    border: 2px solid var(--amount-color);
}

.risk-indicator.risk-medium {
    background-color: rgba(230, 126, 34, 0.1);
    border: 2px solid var(--due-soon-color);
}

.risk-indicator.risk-high {
    background-color: rgba(231, 76, 60, 0.1);
    border: 2px solid var(--overdue-color);
}

.risk-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.risk-indicator.risk-low .risk-percentage {
    color: var(--amount-color);
}

.risk-indicator.risk-medium .risk-percentage {
    color: var(--due-soon-color);
}

.risk-indicator.risk-high .risk-percentage {
    color: var(--overdue-color);
}

.risk-label {
    font-size: 0.7rem;
    color: var(--subtle-text-color);
    font-weight: 500;
    margin-top: 0.2rem;
}

.risk-icon {
    font-size: 1.2rem;
}

/* --- TAKVIM GRID --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
}

.calendar-day-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.calendar-day-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.calendar-day-name {
    font-size: 0.75rem;
    color: var(--subtle-text-color);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.calendar-day-date {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: 0.25rem;
}

.calendar-day-card.today .calendar-day-header {
    border-bottom-color: var(--commission-color);
}

.calendar-day-card.today .calendar-day-date {
    color: var(--commission-color);
}

.calendar-meetings-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.calendar-meeting-card {
    background: var(--bg-color);
    border-left: 3px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.calendar-meeting-card:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.calendar-meeting-card.meeting-past {
    border-left-color: var(--overdue-color);
    background: rgba(231, 76, 60, 0.05);
}

.calendar-meeting-card.meeting-upcoming {
    border-left-color: var(--due-soon-color);
    background: rgba(230, 126, 34, 0.05);
}

.calendar-meeting-card.meeting-future {
    border-left-color: var(--amount-color);
    background: rgba(39, 174, 96, 0.05);
}

.meeting-time {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.meeting-past .meeting-time {
    color: var(--overdue-color);
}

.meeting-upcoming .meeting-time {
    color: var(--due-soon-color);
}

.meeting-future .meeting-time {
    color: var(--amount-color);
}

.meeting-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.15rem;
}

.meeting-company {
    color: var(--subtle-text-color);
    font-size: 0.8rem;
}

.calendar-empty-state {
    text-align: center;
    color: var(--subtle-text-color);
    font-size: 0.85rem;
    padding: 2rem 0.5rem;
    font-style: italic;
}

.dashboard-top-layout .chart-section,
.dashboard-top-layout .trend-chart-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
}

/* --- Kart Yapısı --- */
.card {
    background: var(--card-bg-color);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    transition: background-color 0.4s ease, border-color 0.4s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.card h2 {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* --- Listeler --- */
.customer-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.customer-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.customer-list li:last-child {
    border-bottom: none;
}

.customer-info strong {
    font-size: 1rem;
    font-weight: 600;
    display: block;
}

.customer-info .details {
    font-size: 0.85rem;
    color: var(--subtle-text-color);
    margin-top: 0.2rem;
    display: block;
}

.customer-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.customer-actions .amount {
    font-size: 1rem;
    font-weight: 600;
    color: var(--amount-color);
}

.btn-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-action:hover {
    background-color: var(--input-bg-color);
}

.btn-action .material-symbols-outlined {
    color: var(--subtle-text-color);
    font-size: 1.2rem;
}

.btn-action.edit:hover .material-symbols-outlined {
    color: var(--commission-color);
}

.btn-action.delete:hover .material-symbols-outlined {
    color: var(--overdue-color);
}

/* --- Yaklaşan Ödemeler Özel Stilleri --- */
.countdown {
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    display: inline-block;
    margin-top: 0.3rem;
}

.countdown.overdue {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--overdue-color);
}

.countdown.due-soon {
    background-color: rgba(230, 126, 34, 0.1);
    color: var(--due-soon-color);
}

.countdown.on-time {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--amount-color);
}

.btn-paid {
    background-color: var(--amount-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: opacity 0.2s;
}

.btn-paid:hover {
    opacity: 0.9;
}

.btn-paid .material-symbols-outlined {
    font-size: 1.1rem;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg-color);
    padding: 1.75rem;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--subtle-text-color);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
}

.close-modal-btn:hover {
    background-color: var(--input-bg-color);
    color: var(--text-color);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

input,
.btn-add,
textarea,
select {
    width: 100%;
    padding: 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--commission-color);
}

.btn-add {
    background-color: var(--primary-color);
    color: var(--bg-color);
    font-weight: 600;
    cursor: pointer;
    border: none;
    margin-top: 1rem;
}

.btn-add:hover {
    background-color: var(--primary-hover-color);
}

.btn-add:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Notlar Sayfası --- */
.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.note-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
}

.note-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.note-card p {
    font-size: 0.95rem;
    color: var(--subtle-text-color);
    flex-grow: 1;
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
    line-height: 1.6;
}

.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--subtle-text-color);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* --- Potansiyel Müşteriler (Kanban) --- */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.kanban-column {
    background-color: var(--card-bg-color);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    min-height: 400px;
}

.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid;
}

.kanban-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.count-badge {
    background: var(--input-bg-color);
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Sütun Renk Kodları */
.status-call {
    border-color: var(--commission-color);
}

.status-call h3 {
    color: var(--commission-color);
}

.status-demo {
    border-color: var(--due-soon-color);
}

.status-demo h3 {
    color: var(--due-soon-color);
}

.status-trial {
    border-color: var(--amount-color);
}

.status-trial h3 {
    color: var(--amount-color);
}

.kanban-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Lead Kartı */
.lead-card {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: transform 0.2s;
}

.lead-card:hover {
    transform: translateY(-2px);
}

.lead-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.lead-name {
    font-weight: 600;
    font-size: 1rem;
}

.lead-budget-badge {
    font-size: 0.75rem;
    background-color: var(--input-bg-color);
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--text-color);
    font-weight: 500;
}

.lead-info-row {
    font-size: 0.85rem;
    color: var(--subtle-text-color);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lead-price-suggestion {
    margin-top: 0.75rem;
    padding: 0.6rem;
    background-color: var(--card-bg-color);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
    font-size: 0.85rem;
}

.lead-price-suggestion strong {
    color: var(--amount-color);
}

.lead-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 0.8rem;
}

.lead-move-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
}

.lead-move-btn:hover {
    opacity: 0.9;
}

.lead-card-notes {
    font-size: 0.8rem;
    color: var(--subtle-text-color);
    margin-top: 0.5rem;
    font-style: italic;
    white-space: pre-wrap;
    background: rgba(0, 0, 0, 0.02);
    padding: 0.5rem;
    border-radius: 6px;
}

/* --- Bildirim Sistemi --- */
#notification-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

.notification {
    background-color: var(--card-bg-color);
    color: var(--text-color);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 5px 15px var(--shadow-color);
    opacity: 0;
    transform: translateX(100%);
    animation: slideInAndOut 4s ease-out forwards;
    max-width: 350px;
    font-size: 0.9rem;
}

.notification.ai {
    border-color: var(--ai-color);
}

.notification.error {
    border-color: var(--overdue-color);
}

@keyframes slideInAndOut {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }

    10% {
        opacity: 1;
        transform: translateX(0);
    }

    90% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* --- Onay Modalı --- */
#confirm-modal .modal-content {
    max-width: 400px;
    text-align: center;
}

#confirm-modal-text {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: var(--subtle-text-color);
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-confirm,
.btn-cancel {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
}

.btn-confirm {
    background-color: var(--overdue-color);
    color: white;
}

.btn-cancel {
    background-color: var(--input-bg-color);
    color: var(--text-color);
}

/* --- Arama Sonuçları --- */
#search-results-container {
    margin-top: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    background: var(--bg-color);
}

.search-result-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

/* --- PIN Kilit Ekranı --- */
#pin-lock-overlay .modal-content {
    text-align: center;
    padding: 3rem 2rem;
}

#pin-input {
    font-size: 2rem;
    text-align: center;
    letter-spacing: 0.5em;
    width: 200px;
    margin: 0 auto;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* --- Müşteri Skoru Bölümü --- */
.customer-score-section {
    margin-top: 0;
}

.score-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.score-category {
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid;
    background-color: var(--bg-color);
}

.score-category.score-safe {
    border-color: var(--amount-color);
}

.score-category.score-warning {
    border-color: var(--due-soon-color);
}

.score-category.score-danger {
    border-color: var(--overdue-color);
}

.score-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.score-header .material-symbols-outlined {
    font-size: 24px;
}

.score-safe .score-header .material-symbols-outlined {
    color: var(--amount-color);
}

.score-warning .score-header .material-symbols-outlined {
    color: var(--due-soon-color);
}

.score-danger .score-header .material-symbols-outlined {
    color: var(--overdue-color);
}

.score-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.score-description {
    font-size: 0.85rem;
    color: var(--subtle-text-color);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.score-badge {
    display: inline-block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.score-safe .score-badge {
    color: var(--amount-color);
}

.score-warning .score-badge {
    color: var(--due-soon-color);
}

.score-danger .score-badge {
    color: var(--overdue-color);
}

.score-customer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.score-customer-list li {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: var(--card-bg-color);
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-customer-list .customer-delay-count {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background-color: var(--input-bg-color);
    color: var(--subtle-text-color);
}

/* --- Mobil Uyum (Responsive) --- */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .sidebar .nav-btn {
        white-space: nowrap;
        margin-bottom: 0;
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }

    .main-content {
        padding: 1rem;
        overflow: visible;
    }

    .dashboard-top-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-stats-row {
        grid-template-columns: 1fr;
    }

    .stat-card-combined {
        flex-direction: column;
    }

    .combined-stat-divider {
        width: 100%;
        height: 1px;
        margin: 1rem 0;
    }

    .score-categories {
        grid-template-columns: 1fr;
    }

    .kanban-board {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
    }
}

/* --- AI FEATURES STYLES --- */

/* AI Floating Chat Button */
.ai-chat-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ai-color), #9b59b6);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(142, 68, 173, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 999;
    animation: aiPulse 2s infinite;
}

.ai-chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(142, 68, 173, 0.6);
}

.ai-chat-fab .material-symbols-outlined {
    font-size: 28px;
}

@keyframes aiPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(142, 68, 173, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(142, 68, 173, 0.7);
    }
}

/* AI Chat Panel */
.ai-chat-panel {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 400px;
    height: 600px;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.ai-chat-panel:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ai-chat-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.1), rgba(155, 89, 182, 0.1));
    border-radius: 20px 20px 0 0;
}

.ai-chat-header strong {
    font-size: 1.1rem;
    margin-left: 0.5rem;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-message,
.user-message {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message .material-symbols-outlined {
    color: var(--ai-color);
    font-size: 24px;
    flex-shrink: 0;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .material-symbols-outlined {
    color: var(--commission-color);
    font-size: 24px;
    flex-shrink: 0;
}

.ai-message-content,
.user-message-content {
    background: var(--input-bg-color);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 80%;
    line-height: 1.5;
    font-size: 0.9rem;
}

.user-message-content {
    background: var(--commission-color);
    color: white;
}

.ai-chat-input-container {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.ai-chat-input-container input {
    flex: 1;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
}

.ai-chat-input-container .btn-action {
    background: var(--ai-color);
    color: white;
    padding: 0.75rem;
    border-radius: 10px;
}

.ai-chat-input-container .btn-action:hover {
    background: #9b59b6;
}

.ai-quick-questions {
    padding: 0 1rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ai-quick-btn {
    background: var(--input-bg-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
}

.ai-quick-btn:hover {
    background: var(--ai-color);
    color: white;
    border-color: var(--ai-color);
}

/* AI Insights Section */
.ai-insights-section {
    border-left: 4px solid var(--ai-color);
}

.ai-insights-content {
    min-height: 100px;
}

.ai-insights-content ul {
    list-style: none;
    padding: 0;
}

.ai-insights-content li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.ai-insights-content li:last-child {
    border-bottom: none;
}

.ai-insights-content li::before {
    content: "✨";
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* AI Loading Animation */
.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--ai-color);
}

.ai-loading .material-symbols-outlined {
    font-size: 48px;
    margin-bottom: 1rem;
}

.ai-loading p {
    color: var(--subtle-text-color);
    font-size: 0.9rem;
}

@keyframes rotating {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.rotating {
    animation: rotating 1s linear infinite;
}

/* AI Badge */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.1), rgba(155, 89, 182, 0.1));
    color: var(--ai-color);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--ai-color);
}

.ai-badge .material-symbols-outlined {
    font-size: 14px;
}

/* AI Action Buttons */
.ai-action-btn {
    background: var(--ai-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
    font-weight: 500;
}

.ai-action-btn:hover {
    background: #9b59b6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.3);
}

.ai-action-btn .material-symbols-outlined {
    font-size: 18px;
}

/* AI Settings Modal Specific */
#ai-key-status.success {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid var(--amount-color);
    color: var(--amount-color);
}

#ai-key-status.error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--overdue-color);
    color: var(--overdue-color);
}

/* Responsive AI Features */
@media (max-width: 768px) {
    .ai-chat-panel {
        width: calc(100% - 2rem);
        height: calc(100vh - 4rem);
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .ai-chat-fab {
        bottom: 1rem;
        right: 1rem;
        width: 56px;
        height: 56px;
    }

    .ai-analysis-grid {
        grid-template-columns: 1fr;
    }
}

/* --- AI ANALYSIS PAGE STYLES --- */

.ai-analysis-card {
    border-left: 4px solid var(--ai-color);
}

.ai-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.ai-card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.1rem;
}

.ai-card-header .material-symbols-outlined {
    color: var(--ai-color);
}

.ai-result-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--input-bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.ai-result-container.empty {
    display: none;
}

.delay-prediction-box {
    text-align: center;
    padding: 2rem;
}

.delay-days-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--ai-color);
    margin: 1rem 0;
}

.delay-message {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-top: 1rem;
}

.confidence-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 1rem;
}

.confidence-high {
    background: rgba(39, 174, 96, 0.1);
    color: var(--amount-color);
    border: 1px solid var(--amount-color);
}

.confidence-medium {
    background: rgba(230, 126, 34, 0.1);
    color: var(--due-soon-color);
    border: 1px solid var(--due-soon-color);
}

.confidence-low {
    background: rgba(142, 68, 173, 0.1);
    color: var(--ai-color);
    border: 1px solid var(--ai-color);
}

.effort-analysis-box {
    padding: 1.5rem;
}

.effort-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.effort-low {
    background: rgba(39, 174, 96, 0.1);
    color: var(--amount-color);
    border: 2px solid var(--amount-color);
}

.effort-medium {
    background: rgba(230, 126, 34, 0.1);
    color: var(--due-soon-color);
    border: 2px solid var(--due-soon-color);
}

.effort-high {
    background: rgba(231, 76, 60, 0.1);
    color: var(--overdue-color);
    border: 2px solid var(--overdue-color);
}

.keywords-display {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
}

.keyword-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    margin: 0.25rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.keyword-negative {
    background: rgba(231, 76, 60, 0.1);
    color: var(--overdue-color);
}

.keyword-positive {
    background: rgba(39, 174, 96, 0.1);
    color: var(--amount-color);
}

.refined-note-box {
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 4px solid var(--ai-color);
}

.refined-note-box p {
    margin: 0;
    line-height: 1.6;
    font-size: 1rem;
}

.query-result-box {
    padding: 1.5rem;
}

.query-result-box p {
    line-height: 1.8;
    margin: 0;
}

.cashflow-forecast-box {
    padding: 1.5rem;
}

.cashflow-forecast-box ul {
    list-style: none;
    padding: 0;
}

.cashflow-forecast-box li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.cashflow-forecast-box li:last-child {
    border-bottom: none;
}

.cashflow-forecast-box li::before {
    content: "📊";
    font-size: 1.2rem;
    flex-shrink: 0;
}

.data-buttons-group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.data-buttons-group .nav-btn {
    flex: 1;
    justify-content: center;
    padding: 0.75rem;
}

.data-buttons-group .nav-btn .material-symbols-outlined {
    margin-right: 0;
}

/* --- AI Analysis Styles --- */
.ai-result-box {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--input-bg-color);
    border: 1px solid var(--border-color);
    min-height: 60px;
}

.ai-result-box.ai-scrollable {
    max-height: 400px;
    overflow-y: auto;
}

.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--subtle-text-color);
}

.ai-loading .rotating {
    animation: rotate 1.5s linear infinite;
    font-size: 2rem;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Payment Delay Prediction */
.delay-prediction-box {
    text-align: center;
    padding: 1.5rem;
}

.delay-days-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.confidence-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.confidence-badge.confidence-high {
    background: rgba(39, 174, 96, 0.15);
    color: var(--amount-color);
    border: 1px solid var(--amount-color);
}

.confidence-badge.confidence-medium {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.confidence-badge.confidence-low {
    background: rgba(231, 76, 60, 0.15);
    color: var(--overdue-color);
    border: 1px solid var(--overdue-color);
}

.delay-message {
    color: var(--subtle-text-color);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Customer Effort Analysis */
.effort-analysis-box {
    padding: 1.5rem;
    text-align: center;
}

.effort-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.effort-level-badge .material-symbols-outlined {
    font-size: 1.5rem;
}

.effort-level-badge.effort-low {
    background: rgba(39, 174, 96, 0.15);
    color: var(--amount-color);
    border: 2px solid var(--amount-color);
}

.effort-level-badge.effort-medium {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning-color);
    border: 2px solid var(--warning-color);
}

.effort-level-badge.effort-high {
    background: rgba(231, 76, 60, 0.15);
    color: var(--overdue-color);
    border: 2px solid var(--overdue-color);
}

.ai-message-text {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.7;
    text-align: left;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
}

/* Database Query Results */
.query-result-box {
    padding: 1.5rem;
}

.query-result-box p {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Scrollbar Styling for AI Results */
.ai-scrollable::-webkit-scrollbar {
    width: 8px;
}

.ai-scrollable::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.ai-scrollable::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.ai-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--subtle-text-color);
}

/* --- Database Chat Styles --- */
.db-chat-messages {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.db-chat-message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    animation: slideDown 0.3s ease-out;
}

/* ===== BELİRSİZ CHECKBOX BÜYÜTME ===== */
#lead-budget-uncertain {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--commission-color);
}

/* ===== LEAD ACTION BUTONLARI BÜYÜTME ===== */
.lead-actions-top .btn-action {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
}

.lead-actions-top .btn-action .material-symbols-outlined {
    font-size: 24px !important;
}


@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.db-chat-message.user {
    align-self: flex-end;
    background: var(--primary-color);
    color: var(--bg-color);
    border-bottom-right-radius: 4px;
}

.db-chat-message.ai {
    align-self: flex-start;
    background: var(--input-bg-color);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

.db-chat-message.loading {
    align-self: flex-start;
    background: var(--input-bg-color);
    color: var(--subtle-text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.db-chat-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.db-chat-input {
    flex: 1;
    padding: 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.db-chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.db-chat-send-btn {
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: none;
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-chat-send-btn:hover {
    background-color: var(--primary-hover-color);
}

.db-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.db-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.db-chat-messages::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.db-chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.db-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--subtle-text-color);
}