/* ==================================================
   FLYE CRM — Soft Gold & Warm Palette
   Primary: warm gold, base: cream/white, sidebar: dark brown
================================================== */
:root {
    --bg:             #F7F4EF;   /* krem arka plan */
    --surface:        #FFFFFF;
    --surface-alt:    #F0ECE4;
    --surface-bg:     #F0ECE4;   /* alias */
    --border:         #DED8CE;
    --border-color:   #DED8CE;   /* alias */
    --ink:            #2E2820;
    --ink-soft:       #7A6E62;
    --ink-lighter:    #AFA69C;   /* eksik değişken eklendi */
    --primary:        #B89558;   /* yumuşak altın */
    --primary-dark:   #9A7A3E;
    --primary-soft:   #F5EEDD;
    --primary-rgb:    184, 149, 88;
    --accent:         #5F8A52;   /* adaçayı yeşili – onay/başarı */
    --accent-soft:    #E2EFE0;
    --warn:           #C9783A;   /* amber/toprak */
    --danger:         #B84444;
    --shadow:         0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Segoe UI', 'Inter', -apple-system, system-ui, sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
}

h1, h2, h3, h4 { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }

/* ===== SHELL ===== */
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
    background: #26201A;   /* koyu sıcak kahve */
    color: #F0EBE0;
    display: flex; flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.04);
}
.brand {
    padding: 18px 16px;
    display: flex; gap: 12px; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.07);
    position: relative;
}
.brand-icon { font-size: 26px; color: var(--primary); flex-shrink: 0; }
/* FLYE big logo text */
.brand-app {
    font-size: 22px; font-weight: 800;
    letter-spacing: 3px; text-transform: uppercase;
    color: var(--primary);
    line-height: 1.1;
}
/* company name below FLYE */
.brand-title {
    font-size: 11.5px; font-weight: 500;
    color: #9A8E82;
    letter-spacing: .5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 140px;
}
/* X close button — only visible on mobile */
.sidebar-close-btn {
    display: none;
    margin-left: auto;
    background: none; border: none;
    color: #9A8E82; font-size: 18px;
    cursor: pointer; padding: 4px 6px;
    border-radius: 6px;
    transition: background .15s;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,.08); color: #F0EBE0; }

.nav-menu { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 14px; border-radius: 8px;
    color: #C0B4A8; text-decoration: none; font-weight: 500;
    transition: all .15s ease; font-size: 14px;
    position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #F5EDD9; }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(184,149,88,.30); }
.nav-item.active i { color: #fff; }
.nav-item i { font-size: 17px; width: 20px; color: #9A8E82; }
.nav-badge {
    margin-left: auto; background: var(--warn); color: white;
    font-size: 11px; font-weight: 700;
    padding: 1px 7px; border-radius: 10px;
}

.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.06); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.user-chip i { font-size: 30px; color: #9A8E82; }
.user-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #F0EBE0; }
.user-role { font-size: 11.5px; color: #9A8E82; }
.btn-logout {
    color: #9A8E82; padding: 6px 8px; border-radius: 6px;
    text-decoration: none; transition: all .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.08); color: #F0EBE0; }

/* ===== TOPBAR ===== */
.main-content { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}
.topbar-date { color: var(--ink-soft); font-size: 13.5px; }
.breadcrumb-area { display: flex; align-items: center; gap: 10px; }

/* hamburger — hidden on desktop */
.hamburger-btn {
    display: none;
    background: none; border: none;
    font-size: 22px; color: var(--ink-soft);
    cursor: pointer; padding: 4px 6px;
    border-radius: 6px;
    transition: background .15s, color .15s;
    line-height: 1;
}
.hamburger-btn:hover { background: var(--surface-alt); color: var(--ink); }

.page-body { padding: 28px; flex: 1; }

/* ===== STAT CARDS ===== */
.page-title { margin: 0 0 4px 0; font-size: 24px; }
.page-subtitle { color: var(--ink-soft); margin: 0 0 24px 0; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 28px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 3px; height: 100%; background: var(--primary);
}
.stat-card.accent::before { background: var(--accent); }
.stat-card.warn::before { background: var(--warn); }
.stat-label { color: var(--ink-soft); font-size: 12.5px; text-transform: uppercase; letter-spacing: .8px; }
.stat-value { font-size: 30px; font-weight: 700; color: var(--ink); margin-top: 6px; line-height: 1; }
.stat-trend { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}
.card-header-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.card-title { margin: 0; font-size: 16px; font-weight: 600; }

/* ===== TABLE ===== */
.table-clean { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-clean thead th {
    text-align: left; padding: 10px 12px;
    color: var(--ink-soft); font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .7px;
    border-bottom: 1.5px solid var(--border);
}
.table-clean tbody td {
    padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.table-clean tbody tr:hover { background: var(--surface-alt); }
.table-clean tbody tr:last-child td { border-bottom: none; }

/* ===== BADGES ===== */
.badge-soft, .status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 11.5px; font-weight: 600; letter-spacing: .3px;
}
.badge-yeni     { background: #F5EEDD; color: #9A7A3E; }
.badge-sicak    { background: #FDEFD8; color: #C9783A; }
.badge-soguk    { background: #ECEAE5; color: #7A6E62; }
.badge-kazanildi { background: #E2EFE0; color: #3E7235; }
.badge-kaybedildi { background: #F5E0E0; color: #8B3A3A; }
.badge-gorusuluyor { background: #EAE8F4; color: #584F9A; }

/* ===== BUTTONS ===== */
.btn {
    border: none; border-radius: 8px;
    padding: 8px 16px; font-weight: 600; font-size: 13.5px;
    cursor: pointer; transition: all .15s ease;
    display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline {
    background: transparent; color: var(--primary); border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-soft); }
.btn-ghost {
    background: transparent; color: var(--ink-soft); border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-alt); color: var(--ink); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }

/* ===== FORM ===== */
.form-label {
    font-size: 12.5px; font-weight: 600; color: var(--ink);
    margin-bottom: 5px; display: block;
}
.form-control, .form-select {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); font-size: 14px; color: var(--ink);
    transition: border-color .15s ease;
    font-family: inherit;
}
.form-control:focus, .form-select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(184,149,88,.15);
}
.form-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px; margin-bottom: 14px;
}

/* ===== PLAN ITEMS ===== */
.plan-item {
    display: flex; gap: 14px; padding: 12px;
    border-left: 3px solid var(--primary);
    background: var(--surface-alt); border-radius: 6px; margin-bottom: 8px;
    align-items: center;
}
.plan-time { font-weight: 700; color: var(--primary); min-width: 70px; }
.plan-content { flex: 1; }
.plan-title { font-weight: 600; }
.plan-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

/* ===== VISUAL CALENDAR GRID ===== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    margin-top: 16px;
}
@media (max-width: 1200px) { .calendar-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) { .calendar-grid { grid-template-columns: 1fr; } }

.calendar-day {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease;
    overflow: hidden;
}
.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.calendar-day.today {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), .2), 0 4px 12px rgba(var(--primary-rgb), .1);
}
.calendar-day-header {
    padding: 10px 12px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.calendar-day.today .calendar-day-header {
    background: var(--primary);
    border-bottom-color: var(--primary-dark);
}
.calendar-day-name {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--ink-soft);
}
.calendar-day.today .calendar-day-name { color: #fff; }
.calendar-day-num {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
}
.calendar-day.today .calendar-day-num { color: #fff; }
.calendar-day-body {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 260px;
}
.calendar-event {
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    border-left: 3px solid var(--primary);
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: default;
    transition: background .12s ease, transform .12s ease;
    position: relative;
}
.calendar-event:hover {
    transform: scale(1.02);
}
.calendar-event .event-time {
    font-weight: 700;
    font-size: 11px;
    color: var(--ink);
    min-width: 36px;
}
.calendar-event .event-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.calendar-event .event-delete {
    opacity: 0;
    transition: opacity .12s;
    cursor: pointer;
    color: var(--danger);
    font-size: 12px;
    padding: 1px 3px;
    border: none;
    background: none;
}
.calendar-event:hover .event-delete { opacity: 1; }

/* Event type colors */
.calendar-event.type-gosterim { border-left-color: #3b82f6; background: #eff6ff; }
.calendar-event.type-arama    { border-left-color: #10b981; background: #ecfdf5; }
.calendar-event.type-mesaj    { border-left-color: #8b5cf6; background: #f5f3ff; }
.calendar-event.type-takip    { border-left-color: #f59e0b; background: #fffbeb; }
.calendar-event.type-toplanti { border-left-color: #ef4444; background: #fef2f2; }
.calendar-event.type-diger    { border-left-color: #6b7280; background: #f9fafb; }

/* Status dot */
.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.pending   { background: #f59e0b; }
.status-dot.completed { background: #10b981; }
.status-dot.cancelled { background: #ef4444; }
.status-dot.postponed { background: #8b5cf6; }

.calendar-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--ink-soft);
    font-size: 11px;
    font-style: italic;
    border: 1px dashed var(--border);
    border-radius: 6px;
    margin: 4px;
    padding: 12px;
}

/* Calendar legend */
.calendar-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 0;
    font-size: 12px;
    color: var(--ink-soft);
}
.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.calendar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* ===== RATING STARS ===== */
.rating-stars { display: inline-flex; gap: 2px; }
.rating-stars .bi-star-fill { color: #f59e0b; }
.rating-stars .bi-star { color: var(--border); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.empty-state i { font-size: 48px; color: var(--border); }

/* ===== MODAL (aktivite ekleme vb.) ===== */
.modal-backdrop-custom {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: var(--surface);
    border-radius: 14px;
    padding: 28px;
    width: 480px; max-width: 95vw;
    box-shadow: 0 20px 40px rgba(0,0,0,.18);
}
.modal-box h3 { margin: 0 0 20px 0; font-size: 18px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    /* Mobile shell: single column, sidebar hidden off-canvas */
    .app-shell { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100dvh;
        width: 270px;
        z-index: 500;
        transform: translateX(-100%);
        transition: transform .25s cubic-bezier(.4,0,.2,1);
        box-shadow: none;
    }

    /* when sidebar-open class is on app-shell */
    .app-shell.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,.3);
    }

    /* dark overlay behind open sidebar */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 499;
        animation: fadeIn .2s ease;
    }
    @keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

    /* show hamburger + close buttons */
    .hamburger-btn { display: flex; }
    .sidebar-close-btn { display: flex; }

    .page-body { padding: 16px; }
    .topbar { padding: 10px 16px; }
    .form-row { grid-template-columns: 1fr; }

    /* stat cards full-width */
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

    /* MusteriDetay: stack columns */
    .musteri-detay-grid {
        grid-template-columns: 1fr !important;
    }

    /* table scroll on mobile */
    .table-responsive-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-clean { min-width: 580px; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 20px; }
    .brand-app { font-size: 19px; }
}
