/* ==================================================
   FLYE CRM — Soft Gold & Warm Palette
   Primary: warm gold, base: cream/white, sidebar: dark brown
================================================== */
:root {
    --bg:             #F7F4EF;
    --surface:        #FFFFFF;
    --surface-alt:    #F0ECE4;
    --surface-bg:     #F0ECE4;
    --border:         #DED8CE;
    --border-color:   #DED8CE;
    --ink:            #2E2820;
    --ink-soft:       #7A6E62;
    --ink-lighter:    #AFA69C;
    --primary:        #B89558;
    --primary-dark:   #9A7A3E;
    --primary-soft:   #F5EEDD;
    --primary-rgb:    184, 149, 88;
    --accent:         #5F8A52;
    --accent-soft:    #E2EFE0;
    --warn:           #C9783A;
    --danger:         #B84444;
    --shadow:         0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
    --sidebar-bg:     #26201A;
    --sidebar-text:   #F0EBE0;
    --topbar-bg:      var(--surface);
    --font-display:   'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;
    --font-mono:      'IBM Plex Mono', ui-monospace, monospace;
}

/* ===== DARK MODE — FLYE brand: black + lime-green + chrome (from the logo) ===== */
[data-theme="dark"] {
    --bg:             #040504;   /* logo's pure black */
    --surface:        #0C0E0D;
    --surface-alt:    #131615;
    --surface-bg:     #131615;
    --border:         #23262A;   /* cool neutral hairline */
    --border-color:   #23262A;
    --ink:            #ECEFF0;
    --ink-soft:       #969C9E;
    --ink-lighter:    #5E6467;
    --primary:        #7BC62E;   /* logo lime / grass green */
    --primary-dark:   #5DA31E;
    --primary-soft:   #12210A;
    --primary-rgb:    123, 198, 46;
    --accent:         #B4BBC0;   /* chrome / silver (the cloud) */
    --accent-soft:    #191C1E;
    --warn:           #E0954A;
    --danger:         #E06B6B;
    --shadow:         0 26px 64px -32px rgba(0,0,0,.85), 0 2px 8px -2px rgba(0,0,0,.5);
    --sidebar-bg:     #080908;
    --sidebar-text:   #DCEAD2;
    --topbar-bg:      #0C0E0D;
    --nav-item-color: #8A9284;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Hanken Grotesk', 'Segoe UI', -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; background: var(--bg); }

.sidebar {
    background: var(--sidebar-bg, #26201A);
    color: var(--sidebar-text, #F0EBE0);
    display: flex; flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.04);
    transition: background .2s ease;
}
.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; }
/* Exact wordmark cropped from the canonical logo asset. */
.flye-wordmark {
    position: relative;
    width: 96px;
    height: 24px;
    overflow: hidden;
}
.flye-wordmark img {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 96px;
    height: auto;
    max-width: none;
}
/* FLYE big logo text */
.brand-app {
    font-size: 22px; font-weight: 800;
    letter-spacing: 4px; text-transform: uppercase;
    font-style: italic;
    color: var(--primary);
    opacity: 0.72;
    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 !important;
    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: var(--nav-item-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: var(--sidebar-text, #F5EDD9); }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(var(--primary-rgb),.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; }
.sidebar-user-avatar {
    position: relative; flex: 0 0 32px; width: 32px; height: 32px;
    display: grid; place-items: center; overflow: hidden; border-radius: 50%;
    border: 1px solid rgba(123,198,46,.7); background: var(--primary-soft);
    color: var(--primary); font-size: 11px; font-weight: 800;
}
.sidebar-user-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.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 !important;
    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: 25px; font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; }
.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: 14px; margin-bottom: 26px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 17px 19px;
    box-shadow: var(--shadow);
    position: relative; overflow: hidden;
    transition: border-color .18s ease, transform .12s ease;
}
.stat-card[style*="cursor:pointer"]:hover { transform: translateY(-1px); border-color: rgba(var(--primary-rgb),.35); }
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 2px; height: 100%; background: var(--primary); opacity: .9;
}
.stat-card.accent::before { background: var(--accent); }
.stat-card.warn::before { background: var(--warn); }
.stat-label { color: var(--ink-soft); font-size: 12.5px; font-weight: 500; }
.stat-value { font-family: var(--font-mono); font-size: 28px; font-weight: 500; color: var(--ink); margin-top: 9px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-trend { font-size: 12px; color: var(--ink-soft); margin-top: 9px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    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: 15.5px; font-weight: 700; font-family: var(--font-display); letter-spacing: -.01em; }

.dashboard-content-grid,
.analytics-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 20px;
}
.settings-content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

/* ===== 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(var(--primary-rgb),.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 {
    color: var(--ink);
    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; }
.calendar-event.type-not      { border-left-color: #06b6d4; background: #ecfeff; }

/* 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; }

/* ===== DETAY POPUP ===== */
@keyframes popupIn {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

.detay-popup {
    background: var(--surface);
    border-radius: 18px;
    width: 440px;
    max-width: 94vw;
    box-shadow: 0 24px 60px rgba(0,0,0,.20), 0 4px 16px rgba(0,0,0,.08);
    overflow: hidden;
    animation: popupIn .22s cubic-bezier(.22,.68,0,1.2);
}

/* — Hero band — */
.detay-hero {
    padding: 20px 20px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.detay-hero.type-gosterim { background: linear-gradient(135deg,#1d4ed8 0%,#3b82f6 100%); }
.detay-hero.type-arama    { background: linear-gradient(135deg,#047857 0%,#10b981 100%); }
.detay-hero.type-mesaj    { background: linear-gradient(135deg,#5b21b6 0%,#8b5cf6 100%); }
.detay-hero.type-takip    { background: linear-gradient(135deg,#b45309 0%,#f59e0b 100%); }
.detay-hero.type-toplanti { background: linear-gradient(135deg,#991b1b 0%,#ef4444 100%); }
.detay-hero.type-diger    { background: linear-gradient(135deg,#374151 0%,#6b7280 100%); }
.detay-hero.type-not      { background: linear-gradient(135deg,#0e7490 0%,#06b6d4 100%); }

.detay-hero-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.detay-tip-pill {
    display: inline-block;
    background: rgba(255,255,255,.22);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    width: fit-content;
}

.detay-hero-title {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
    text-shadow: 0 1px 3px rgba(0,0,0,.18);
}

.detay-kapat-btn {
    flex-shrink: 0;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s, transform .15s;
    line-height: 1;
}
.detay-kapat-btn:hover { background: rgba(255,255,255,.32); transform: scale(1.1); }

/* — Body rows — */
.detay-body {
    padding: 6px 0 10px;
}

.detay-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    transition: background .12s;
}
.detay-row:hover { background: var(--surface-alt); }
.detay-row + .detay-row { border-top: 1px solid var(--border); }

.detay-icon-wrap {
    width: 32px; height: 32px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-soft);
    border-radius: 9px;
    color: var(--primary-dark);
    font-size: 14px;
}

.detay-row-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.detay-row-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--ink-lighter);
}
.detay-row-value {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    word-break: break-word;
}

/* — Status pill — */
.detay-durum-pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    width: fit-content;
}
.detay-durum-pill.durum-pending   { background: #fef3c7; color: #92400e; }
.detay-durum-pill.durum-completed { background: #d1fae5; color: #065f46; }
.detay-durum-pill.durum-cancelled { background: #fee2e2; color: #991b1b; }
.detay-durum-pill.durum-postponed { background: #ede9fe; color: #4c1d95; }

/* ===== CLICKABLE TABLE ROWS ===== */
.table-row-clickable { cursor: pointer; }
.table-row-clickable:hover { background: var(--primary-soft) !important; }

/* ===== APPOINTMENT DETAIL MODAL ===== */
.appt-detail-modal { width: 520px; }
.appt-detail-header {
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.appt-detail-name { font-size: 18px; font-weight: 700; line-height: 1.2; }
.appt-detail-phone { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.appt-detail-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 14px; margin-bottom: 20px;
}
.appt-detail-full { grid-column: 1 / -1; }
.appt-detail-field label {
    font-size: 11px; font-weight: 600; color: var(--ink-soft);
    text-transform: uppercase; letter-spacing: .6px; display: block;
}
.appt-detail-field p {
    font-size: 14px; color: var(--ink); margin: 4px 0 0 0; font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    html, body { overflow-x: hidden; }

    /* 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 — override the !important with !important */
    .hamburger-btn { display: flex !important; }
    .sidebar-close-btn { display: flex !important; }

    .main-content, .page-body, .card { min-width: 0; }
    .page-body { padding: 14px 12px; overflow-wrap: break-word; }
    .topbar { padding: 10px 14px; }
    .form-row { grid-template-columns: 1fr; gap: 10px; }
    .form-row > [style*="grid-column:span 2"],
    .form-row > [style*="grid-column: span 2"] { grid-column: 1 !important; }
    .form-control, .form-select, textarea { max-width: 100%; min-width: 0; }

    .card { padding: 14px; margin-bottom: 14px; border-radius: 10px; }
    .dashboard-content-grid,
    .analytics-content-grid,
    .settings-content-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .card-header-row {
        margin-bottom: 12px; padding-bottom: 10px;
        flex-wrap: wrap; gap: 10px;
    }
    .table-clean tbody td { padding: 9px 10px; font-size: 13px; }
    .table-clean thead th { padding: 8px 10px; font-size: 11.5px; }
    .plan-item { padding: 10px; margin-bottom: 8px; }

    /* stat cards full-width */
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
    .stat-card { padding: 14px 16px; }
    .stat-value { font-size: 26px; }

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

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

    /* detail modal mobile */
    .appt-detail-modal { width: 100%; padding: 20px; }
    .appt-detail-grid { grid-template-columns: 1fr; gap: 12px; }
    .appt-detail-full { grid-column: 1; }
    .modal-box { padding: 20px; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 20px; }
    .page-subtitle { font-size: 13px; margin-bottom: 16px; }
    .brand-app { font-size: 19px; }
    .appt-detail-name { font-size: 16px; }
    .appt-detail-header { gap: 8px; }
    .btn { padding: 7px 13px; font-size: 13px; }
    .btn-sm { padding: 5px 10px; font-size: 12px; }
    .topbar-date { display: none; }
    .page-title, .page-subtitle, .card-title { word-break: normal; overflow-wrap: break-word; }
}

/* Mobile operational tables become readable cards instead of compressed rows. */
@media (max-width: 700px) {
    .mobile-toolbar-search,
    .mobile-toolbar-actions { width: 100%; min-width: 0; }
    .mobile-toolbar-search .form-control { width: 100%; max-width: none !important; }
    .mobile-toolbar-actions { justify-content: space-between; flex-wrap: wrap; }

    .mobile-card-table { overflow: visible; }
    .mobile-card-table .table-clean { min-width: 0; width: 100%; }
    .mobile-card-table thead { display: none; }
    .mobile-card-table tbody { display: grid; gap: 10px; }
    .mobile-card-table tbody tr {
        display: block;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface-alt);
    }
    .mobile-card-table .table-clean tbody td {
        display: grid;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        max-width: none !important;
        padding: 7px 0;
        border: 0;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        overflow-wrap: anywhere;
        width: 100% !important;
    }
    .mobile-card-table .table-clean tbody td + td { border-top: 1px solid var(--border); }
    .mobile-card-table .table-clean tbody td::before {
        content: attr(data-label);
        color: var(--ink-soft);
        font-size: 10.5px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }
    .mobile-card-table .mobile-card-actions > div,
    .mobile-card-table td.mobile-card-actions { align-items: center; }
    .mobile-card-table .mobile-card-actions > div { flex-wrap: wrap; justify-content: flex-start; }

    .customer-detail-header .page-title { min-width: calc(100% - 52px); }
    .customer-detail-meta {
        display: flex;
        flex-direction: column;
        gap: 5px;
        padding-left: 0 !important;
        overflow-wrap: anywhere;
    }
    .bulk-bar {
        left: 12px;
        right: 12px;
        bottom: 12px;
        min-width: 0;
        transform: none;
        padding: 10px 12px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .bulk-btn { padding: 6px 10px; }

    .intent-summary-card,
    .intent-summary-text { min-width: 0; overflow-wrap: anywhere; }

    .customer-summary-text,
    .timeline-title,
    .timeline-sub,
    .plan-title { min-width: 0; overflow-wrap: anywhere; }
    .plan-item > div { min-width: 0; }

    .appointments-filter,
    .appointments-filter .form-select { width: 100%; max-width: none !important; }

    .modal-backdrop-custom,
    .modal-backdrop { padding: 12px; }
    .modal-box,
    .customer-modal-card {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
    }

    @keyframes slideUp {
        from { opacity:0; transform:translateY(16px); }
        to { opacity:1; transform:translateY(0); }
    }
}

/* ===== DARK MODE SIDEBAR OVERRIDES ===== */
[data-theme="dark"] .sidebar          { background: var(--sidebar-bg); border-right-color: rgba(255,255,255,.04); }
[data-theme="dark"] .nav-item         { color: #9A8E82; }
[data-theme="dark"] .nav-item:hover   { background: rgba(255,255,255,.06); color: #F0EBE0; }
[data-theme="dark"] .user-name        { color: #D4C9BC; }
[data-theme="dark"] .topbar           { background: var(--topbar-bg); border-bottom-color: var(--border); }
[data-theme="dark"] .calendar-event.type-gosterim { background: #1e2d4a; }
[data-theme="dark"] .calendar-event.type-arama    { background: #12271e; }
[data-theme="dark"] .calendar-event.type-mesaj    { background: #201a35; }
[data-theme="dark"] .calendar-event.type-takip    { background: #2a2010; }
[data-theme="dark"] .calendar-event.type-toplanti { background: #2a1212; }
[data-theme="dark"] .calendar-event.type-diger    { background: #1e1e1e; }
[data-theme="dark"] .calendar-event.type-not      { background: #0d2830; }
[data-theme="dark"] .badge-yeni     { background: #2A2218; color: #C9A96E; }
[data-theme="dark"] .badge-sicak    { background: #2A1E0E; color: #D4893F; }
[data-theme="dark"] .badge-soguk    { background: #232220; color: #9A8E82; }
[data-theme="dark"] .badge-kazanildi  { background: #1A2A18; color: #6FA35E; }
[data-theme="dark"] .badge-kaybedildi { background: #2A1818; color: #CC5555; }
[data-theme="dark"] .badge-gorusuluyor { background: #1E1A30; color: #9B8FCC; }
[data-theme="dark"] .detay-durum-pill.durum-pending   { background: #2a2010; color: #f59e0b; }
[data-theme="dark"] .detay-durum-pill.durum-completed { background: #1A2A18; color: #6FA35E; }
[data-theme="dark"] .detay-durum-pill.durum-cancelled { background: #2A1818; color: #CC5555; }
[data-theme="dark"] .detay-durum-pill.durum-postponed { background: #1E1A30; color: #9B8FCC; }

/* ===== FLYE BRAND — dark accents (lime green, glow only on brand moments) ===== */
[data-theme="dark"] body { background: var(--bg); }

/* Primary button — lime with dark ink, subtle glow */
[data-theme="dark"] .btn-primary {
    color: #0A1603;
    background: linear-gradient(180deg, #93E03F, var(--primary));
    box-shadow: 0 8px 22px -12px rgba(var(--primary-rgb),.5);
}
[data-theme="dark"] .btn-primary:hover { color: #0A1603; filter: brightness(1.05); }
[data-theme="dark"] .btn-primary i { color: #0A1603; }

/* Active nav — subtle green tint + inset bar, not a loud fill */
[data-theme="dark"] .nav-item.active {
    background: rgba(var(--primary-rgb),.12);
    color: #E3F5D4;
    box-shadow: inset 2px 0 0 var(--primary);
}
[data-theme="dark"] .nav-item.active i { color: var(--primary); }

/* KPI accent bar keeps a faint glow (echoes the logo's glowing steps) */
[data-theme="dark"] .stat-card { transition: border-color .2s ease; }
[data-theme="dark"] .stat-card::before { box-shadow: 0 0 12px rgba(var(--primary-rgb),.4); }
[data-theme="dark"] .card:hover { border-color: rgba(var(--primary-rgb),.24); }

/* ===== DARK MODE TOGGLE BUTTON ===== */
.dark-toggle-btn {
    background: none; border: 1px solid var(--border);
    color: var(--ink-soft); font-size: 16px;
    width: 34px; height: 34px;
    border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s ease;
}
.dark-toggle-btn:hover { background: var(--surface-alt); color: var(--ink); border-color: var(--primary); }

/* ===== NOTIFICATION BELL ===== */
.notif-wrap {
    position: relative;
}
.notif-btn {
    background: none; border: 1px solid var(--border);
    color: var(--ink-soft); font-size: 17px;
    width: 34px; height: 34px;
    border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s ease; position: relative;
}
.notif-btn:hover { background: var(--surface-alt); color: var(--ink); border-color: var(--primary); }
.notif-badge {
    position: absolute; top: -5px; right: -5px;
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--topbar-bg, var(--surface));
    animation: pulse-badge .8s ease-in-out 2;
}
@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.18); }
}
.notif-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 320px; max-height: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.08);
    z-index: 400; overflow: hidden;
    animation: dropIn .18s cubic-bezier(.22,.68,0,1.2);
}
@keyframes dropIn {
    from { opacity:0; transform: translateY(-8px) scale(.97); }
    to   { opacity:1; transform: translateY(0)    scale(1);   }
}
.notif-header {
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border);
    font-weight: 700; font-size: 13px; color: var(--ink);
    display: flex; justify-content: space-between; align-items: center;
}
.notif-list { overflow-y: auto; max-height: 320px; }
.notif-item {
    display: flex; gap: 11px; align-items: flex-start;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background .12s;
    text-decoration: none; color: inherit;
}
.notif-item:hover { background: var(--surface-alt); }
.notif-item:last-child { border-bottom: none; }
.notif-icon {
    width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.notif-icon.pending   { background: var(--primary-soft); color: var(--primary); }
.notif-icon.match     { background: var(--primary-soft); color: var(--primary-dark); }
.notif-text { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.notif-sub   { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.notif-empty { padding: 24px 16px; text-align: center; color: var(--ink-soft); font-size: 13px; }

/* ===== INTERACTIONS ACCORDION ===== */
.accordion-customer {
    border: 1px solid var(--border);
    border-radius: 10px; overflow: hidden;
    margin-bottom: 8px;
    transition: box-shadow .15s;
}
.accordion-customer:hover { box-shadow: var(--shadow); }

.accordion-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; cursor: pointer;
    background: var(--surface);
    transition: background .12s;
    user-select: none;
}
.accordion-header:hover { background: var(--surface-alt); }
.accordion-header.is-open { background: var(--primary-soft); }

.customer-avatar {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: .5px;
}

.accordion-meta { flex: 1; min-width: 0; }
.accordion-name {
    font-size: 14px; font-weight: 600; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.accordion-phone { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }

.accordion-count-badge {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--ink-soft);
    font-size: 11.5px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
    flex-shrink: 0;
}
.accordion-header.is-open .accordion-count-badge {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: #fff;
}

.accordion-last-time {
    font-size: 11.5px; color: var(--ink-lighter);
    white-space: nowrap; flex-shrink: 0;
}

.accordion-chevron {
    font-size: 12px; color: var(--ink-lighter);
    transition: transform .2s ease; flex-shrink: 0;
}
.accordion-header.is-open .accordion-chevron { transform: rotate(180deg); }

/* Expanded body */
.accordion-body {
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
    padding: 10px 12px;
    display: flex; flex-direction: column; gap: 6px;
}

/* Individual interaction row inside accordion */
.ix-row {
    display: flex; gap: 10px; align-items: flex-start;
    background: var(--surface); border-radius: 8px;
    padding: 9px 12px;
    border-left: 3px solid var(--border);
    transition: transform .12s;
}
.ix-row:hover { transform: translateX(2px); }
.ix-row.ix-listing_view    { border-left-color: #3b82f6; }
.ix-row.ix-filter_search   { border-left-color: #10b981; }
.ix-row.ix-message         { border-left-color: #8b5cf6; }
.ix-row.ix-appointment_request { border-left-color: #ef4444; }
.ix-row.ix-menu_open       { border-left-color: #f59e0b; }
.ix-row.ix-contact_agent   { border-left-color: #6b7280; }

.ix-type-icon {
    width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; background: var(--surface-alt); color: var(--ink-soft);
}
.ix-body { flex: 1; min-width: 0; }
.ix-details { font-size: 12.5px; color: var(--ink); line-height: 1.4; word-break: break-word; }
.ix-listing-badge { font-size: 11px; color: var(--primary); font-weight: 600; margin-top: 2px; }
.ix-time { font-size: 11px; color: var(--ink-lighter); white-space: nowrap; flex-shrink: 0; padding-top: 2px; }

.accordion-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
    display: flex; justify-content: flex-end;
}

/* Interactions search bar */
.ix-search {
    width: 100%; padding: 9px 12px 9px 36px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--ink); font-size: 13.5px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.ix-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.12); }
.ix-search-wrap { position: relative; flex: 1; }
.ix-search-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--ink-soft); font-size: 14px; pointer-events: none;
}

/* ===== CUSTOMER UNIFIED TIMELINE ===== */
.timeline-feed { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 0; position: relative;
}
.timeline-item + .timeline-item { border-top: 1px solid var(--border); }
.timeline-icon {
    width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; margin-top: 1px;
}
.timeline-icon.ti-interaction { background: var(--primary-soft); color: var(--primary-dark); }
.timeline-icon.ti-appointment { background: var(--primary-soft); color: var(--primary); }
.timeline-icon.ti-rating      { background: #fffbeb; color: #b45309; }
.timeline-body { flex: 1; min-width: 0; }
.timeline-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.timeline-sub   { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.4; }
.timeline-time  { font-size: 11px; color: var(--ink-lighter); margin-top: 4px; }

/* ===== BULK ACTION BAR ===== */
h1[tabindex="-1"]:focus { outline: none; }
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"] { color-scheme: dark; }
.account-page input:-webkit-autofill,
.account-page input:-webkit-autofill:hover,
.account-page input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink);
    -webkit-box-shadow: 0 0 0 1000px var(--surface-alt) inset;
    caret-color: var(--ink);
}
.account-page input[type="checkbox"] { accent-color: var(--primary); }
.customer-status-tabs {
    display: flex; gap: 4px; flex-shrink: 0; align-items: center;
    padding: 4px; background: var(--surface-alt); border: 1px solid var(--border-color); border-radius: 10px;
}
.customer-status-tab {
    background: transparent; color: var(--ink); border: 1px solid transparent;
    border-radius: 6px; padding: 6px 16px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.customer-status-tab.is-selected { background: var(--primary); color: #142000; border-color: var(--primary); }
.customer-status-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.appointments-filter { flex-wrap: wrap; }
.appt-listing-link {
    color: var(--primary); font-weight: 650; text-decoration: none;
    display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.appt-listing-link:hover { text-decoration: underline; }
.appt-listing-state { color: var(--ink-soft); font-size: 11px; margin-top: 2px; }
.appt-listing-missing { color: var(--ink-soft); font-size: 12px; }
.bulk-bar {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--primary);
    border-radius: 14px; padding: 12px 20px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: 0 8px 28px rgba(0,0,0,.28);
    z-index: 300; min-width: 360px;
    animation: slideUp .22s cubic-bezier(.22,.68,0,1.2);
}
@keyframes slideUp {
    from { opacity:0; transform: translateX(-50%) translateY(16px); }
    to   { opacity:1; transform: translateX(-50%) translateY(0); }
}
.bulk-count { font-weight: 700; font-size: 13.5px; flex: 1; }
.bulk-btn {
    background: var(--surface-alt); border: 1px solid var(--border-color);
    color: var(--ink); border-radius: 8px; padding: 6px 14px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: background .15s;
}
.bulk-btn:hover { border-color: var(--primary); }
.bulk-btn.danger { color: var(--danger); border-color: var(--danger); }
.bulk-btn.danger:hover { background: var(--surface-alt); }

/* Checkbox column */
.check-col { width: 40px; }
input[type="checkbox"].row-check {
    width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer;
}

/* ===== DASHBOARD ACTIVITY FEED ===== */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 0;
}
.activity-row + .activity-row { border-top: 1px solid var(--border); }
.activity-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    background: var(--primary);
}
.activity-dot.message { background: #8b5cf6; }
.activity-dot.listing_view { background: #3b82f6; }
.activity-dot.filter_search { background: #10b981; }
.activity-dot.appointment_request { background: #ef4444; }
.activity-dot.menu_open { background: #f59e0b; }
.activity-text { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-soft); }
.activity-text strong { color: var(--ink); font-weight: 600; }
.activity-time { font-size: 11.5px; color: var(--ink-lighter); white-space: nowrap; font-family: var(--font-mono); }

/* channel chip on activity rows */
.ch-chip {
    font-size: 10.5px; color: var(--ink-soft); font-family: var(--font-mono);
    border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; white-space: nowrap;
}
@media (max-width: 700px) {
    .activity-row {
        display: grid;
        grid-template-columns: 8px minmax(0, 1fr) auto;
        align-items: start;
        gap: 5px 8px;
    }
    .activity-dot {
        grid-column: 1;
        grid-row: 1;
        margin-top: 6px;
    }
    .activity-text {
        grid-column: 2 / -1;
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: normal;
    }
    .activity-text strong { overflow-wrap: anywhere; }
    .ch-chip { grid-column: 2; justify-self: start; }
    .activity-time { grid-column: 3; justify-self: end; }
}
/* live pill on page headers */
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--primary); }
.live-pill .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 8px rgba(var(--primary-rgb),.6); animation: livepulse 2s infinite; }
@keyframes livepulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* lead-source bars (dashboard + analytics) */
.src-list { display: flex; flex-direction: column; gap: 14px; }
.src-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.src-top b { font-weight: 600; color: var(--ink); }
.src-top span { color: var(--ink-soft); font-family: var(--font-mono); font-size: 12px; }
.src-bar { height: 7px; border-radius: 5px; background: var(--surface-alt); overflow: hidden; border: 1px solid var(--border); }
.src-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--primary-dark), var(--primary)); }
.src-bar.chrome i { background: linear-gradient(90deg, var(--ink-lighter), var(--accent)); }

/* ===== KPI TREND INDICATOR ===== */
.stat-trend-up   { color: var(--primary); font-weight: 600; }
.stat-trend-down { color: var(--danger); }
.stat-trend-neu  { color: var(--ink-lighter); }

/* Quick action strip under dashboard header */
.quick-actions {
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px;
}
.quick-action-btn {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 9px 16px;
    font-size: 13.5px; font-weight: 600; color: var(--ink);
    cursor: pointer; text-decoration: none;
    transition: all .15s ease; box-shadow: var(--shadow);
}
.quick-action-btn:hover {
    border-color: var(--primary); background: var(--primary-soft);
    color: var(--primary-dark); transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(var(--primary-rgb),.14);
}
.quick-action-btn i { font-size: 15px; color: var(--primary); }

/* ===================================================
   DARK MODE — COMPREHENSIVE TEXT & ELEMENT FIXES
   All elements that had hardcoded or near-invisible colors
=================================================== */

/* Smooth theme transition on key elements */
html, body, .card, .sidebar, .topbar, .modal-box, .form-control, .form-select,
.table-clean td, .table-clean th, .stat-card, .plan-item {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

/* Form controls — fully visible in dark mode */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea.form-control {
    background: var(--surface-alt);
    color: var(--ink);
    border-color: var(--border);
}
[data-theme="dark"] .form-control::placeholder { color: var(--ink-lighter); }
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--ink);
}
/* Native select option styling */
[data-theme="dark"] select option {
    background: var(--surface-alt);
    color: var(--ink);
}

/* Table cells */
[data-theme="dark"] .table-clean thead th { color: var(--ink-soft); border-bottom-color: var(--border); }
[data-theme="dark"] .table-clean tbody td { color: var(--ink); border-bottom-color: var(--border); }
[data-theme="dark"] .table-clean tbody tr:hover { background: var(--surface-alt); }
[data-theme="dark"] .table-clean tbody td strong { color: var(--ink); }

/* Cards & surfaces */
[data-theme="dark"] .card         { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .card-title   { color: var(--ink); }
[data-theme="dark"] .stat-card    { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .stat-value   { color: var(--ink); }
[data-theme="dark"] .stat-label   { color: var(--ink-soft); }
[data-theme="dark"] .stat-trend   { color: var(--ink-soft); }

/* Buttons */
[data-theme="dark"] .btn-ghost {
    color: var(--ink-soft); border-color: var(--border); background: transparent;
}
[data-theme="dark"] .btn-ghost:hover { background: var(--surface-alt); color: var(--ink); }
[data-theme="dark"] .btn-outline {
    color: var(--primary); border-color: var(--primary); background: transparent;
}
[data-theme="dark"] .btn-outline:hover { background: var(--primary-soft); }

/* Modal */
[data-theme="dark"] .modal-box { background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
[data-theme="dark"] .modal-box h3 { color: var(--ink); }

/* Topbar */
[data-theme="dark"] .topbar-date { color: var(--ink-soft); }
[data-theme="dark"] .breadcrumb-area { color: var(--ink); }
[data-theme="dark"] .hamburger-btn { color: var(--ink-soft); }
[data-theme="dark"] .hamburger-btn:hover { background: var(--surface-alt); color: var(--ink); }

/* Sidebar brand */
[data-theme="dark"] .brand { border-bottom-color: rgba(255,255,255,.06); }
[data-theme="dark"] .brand-title { color: var(--ink-lighter); }
[data-theme="dark"] .sidebar-footer { border-top-color: rgba(255,255,255,.06); }
[data-theme="dark"] .user-role { color: var(--ink-lighter); }

/* Plan items */
[data-theme="dark"] .plan-item { background: var(--surface-alt); border-left-color: var(--primary); }
[data-theme="dark"] .plan-title { color: var(--ink); }
[data-theme="dark"] .plan-meta  { color: var(--ink-soft); }
[data-theme="dark"] .plan-time  { color: var(--primary); }

/* Empty state */
[data-theme="dark"] .empty-state { color: var(--ink-soft); }
[data-theme="dark"] .empty-state i { color: var(--border); }

/* Accordion interactions */
[data-theme="dark"] .accordion-header    { background: var(--surface); }
[data-theme="dark"] .accordion-header:hover { background: var(--surface-alt); }
[data-theme="dark"] .accordion-header.is-open { background: var(--primary-soft); }
[data-theme="dark"] .accordion-name      { color: var(--ink); }
[data-theme="dark"] .accordion-phone     { color: var(--ink-soft); }
[data-theme="dark"] .accordion-body      { background: var(--surface-alt); }
[data-theme="dark"] .ix-row              { background: var(--surface); }
[data-theme="dark"] .ix-details         { color: var(--ink); }

/* Timeline */
[data-theme="dark"] .timeline-title { color: var(--ink); }
[data-theme="dark"] .timeline-sub   { color: var(--ink-soft); }
[data-theme="dark"] .timeline-time  { color: var(--ink-lighter); }

/* Notification dropdown */
[data-theme="dark"] .notif-dropdown  { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .notif-title     { color: var(--ink); }
[data-theme="dark"] .notif-sub       { color: var(--ink-soft); }
[data-theme="dark"] .notif-item:hover { background: var(--surface-alt); }
[data-theme="dark"] .notif-header    { color: var(--ink); border-bottom-color: var(--border); }

/* Misc inline text fixes */
[data-theme="dark"] h1, [data-theme="dark"] h2,
[data-theme="dark"] h3, [data-theme="dark"] h4 { color: var(--ink); }
[data-theme="dark"] p  { color: var(--ink); }
[data-theme="dark"] strong { color: var(--ink); }
[data-theme="dark"] label  { color: var(--ink); }

/* Error boundary */
[data-theme="dark"] .app-shell { background: var(--bg); }

/* MusteriDetay cards */
[data-theme="dark"] .mini-stat      { background: var(--surface-alt); border-radius: 8px; }
[data-theme="dark"] .mini-label     { color: var(--ink-soft); }
[data-theme="dark"] .mini-value     { color: var(--ink); }
[data-theme="dark"] .gorusme-item   { background: var(--surface-alt); border-color: var(--border); }
[data-theme="dark"] .gorusme-kanal  { color: var(--ink-soft); }
[data-theme="dark"] .gorusme-tarih  { color: var(--ink-lighter); }
[data-theme="dark"] .gorusme-icerik { color: var(--ink); }

/* Customer detail hero */
[data-theme="dark"] .page-title    { color: var(--ink); }
[data-theme="dark"] .page-subtitle { color: var(--ink-soft); }

/* Academy Theme Overrides */
.theme-academy {
    --bg:             #F8FAFC;   /* Slate 50 - clean slate off-white */
    --surface:        #FFFFFF;   /* Pure white card surface */
    --surface-alt:    #F1F5F9;   /* Slate 100 - light gray */
    --surface-bg:     #F1F5F9;
    --border:         #E2E8F0;   /* Slate 200 - clean border gray */
    --border-color:   #E2E8F0;
    --ink:            #0F172A;   /* Slate 900 - dark navy/slate text */
    --ink-soft:       #64748B;   /* Slate 500 */
    --ink-lighter:    #94A3B8;   /* Slate 400 */
    --primary:        #3B82F6;   /* Electric/Royal Blue */
    --primary-dark:   #1D4ED8;   
    --primary-soft:   #EFF6FF;   /* Blue 50 */
    --primary-rgb:    59, 130, 246;
    --accent:         #06B6D4;   /* Cyan 500 */
    --accent-soft:    #ECFEFF;
    --warn:           #8B5CF6;   /* Violet 500 */
    --sidebar-bg:     #0F172A;   /* Slate 900 - Premium Tech Sidebar */
    --sidebar-text:   #F8FAFC;   
    --nav-item-color: #94A3B8;   
}

/* Premium KPI borders for Academy */
.theme-academy .stat-card.info::before    { background: #3B82F6; } /* Royal Blue */
.theme-academy .stat-card.warn::before    { background: #8B5CF6; } /* Violet */
.theme-academy .stat-card.accent::before  { background: #06B6D4; } /* Cyan */
.theme-academy .stat-card.success::before { background: #10B981; } /* Emerald Green */

/* Academy Badges Override */
.theme-academy .badge-yeni      { background: #EFF6FF; color: #3B82F6; }
.theme-academy .badge-sicak     { background: #F5F3FF; color: #8B5CF6; }
.theme-academy .badge-soguk     { background: #F1F5F9; color: #64748B; }
.theme-academy .badge-kazanildi { background: #D1FAE5; color: #065F46; }
.theme-academy .badge-kaybedildi { background: #FEE2E2; color: #991b1b; }
.theme-academy .badge-gorusuluyor { background: #E0F2FE; color: #0369A1; }

[data-theme="dark"] .theme-academy {
    --bg:             #090D16;   /* Deep slate-black */
    --surface:        #111827;   /* Gray 900 card */
    --surface-alt:    #1F2937;   /* Gray 800 */
    --surface-bg:     #1F2937;
    --border:         #1F2937;   
    --border-color:   #1F2937;
    --ink:            #F9FAFB;   
    --ink-soft:       #9CA3AF;   
    --ink-lighter:    #4B5563;   
    --primary:        #60A5FA;   /* Light Electric Blue */
    --primary-dark:   #3B82F6;   
    --primary-soft:   #1E3A8A;   
    --primary-rgb:    96, 165, 250;
    --accent:         #22D3EE;   
    --accent-soft:    #083344;
    --warn:           #A78BFA;   
    --sidebar-bg:     #030712;   
    --sidebar-text:   #F3F4F6;
}

/* ===== FLYE HOTEL — midnight forest + warm champagne ===== */
[data-theme="dark"] .theme-hospitality {
    --bg:             #090D0B;
    --surface:        #101713;
    --surface-alt:    #17201A;
    --surface-bg:     #17201A;
    --border:         #2A342D;
    --border-color:   #2A342D;
    --ink:            #F1EADC;
    --ink-soft:       #A7A89F;
    --ink-lighter:    #687269;
    --primary:        #CBB78A;
    --primary-dark:   #A99163;
    --primary-soft:   #2B291F;
    --primary-rgb:    203, 183, 138;
    --accent:         #899A7C;
    --accent-soft:    #1C281E;
    --warn:           #D6A15F;
    --danger:         #E68176;
    --sidebar-bg:     #0C120E;
    --sidebar-text:   #E9E2D5;
    --topbar-bg:      #101713;
    --nav-item-color: #989E96;
}
[data-theme="dark"] .theme-hospitality .sidebar { border-right-color: rgba(203,183,138,.10); }
[data-theme="dark"] .theme-hospitality .nav-item.active {
    background: rgba(203,183,138,.10);
    color: #E2D1AA;
    box-shadow: inset 2px 0 0 #CBB78A;
}
[data-theme="dark"] .theme-hospitality .nav-item.active i { color: #CBB78A; }
[data-theme="dark"] .theme-hospitality .brand-title { color: #A7A89F; }
[data-theme="dark"] .theme-hospitality .topbar { border-bottom-color: rgba(203,183,138,.10); }
.theme-hospitality .page-body {
    background:
        radial-gradient(circle at 92% 2%, rgba(203,183,138,.055), transparent 26rem),
        linear-gradient(180deg, rgba(137,154,124,.025), transparent 18rem);
}
.theme-hospitality .sector-signature {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    color: #CBB78A;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .17em;
}
.theme-hospitality .sector-signature span {
    width: 16px;
    height: 1px;
    background: #CBB78A;
}
.theme-hospitality .hotel-live-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding-left: 14px;
    margin-left: 14px;
    border-left: 1px solid rgba(203,183,138,.16);
    color: var(--ink-soft);
    font-size: 10px;
}
.theme-hospitality .hotel-live-status i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8EBB70;
    box-shadow: 0 0 0 4px rgba(142,187,112,.10);
}
@media (max-width: 680px) {
    .theme-hospitality .hotel-live-status { display: none; }
}

[data-theme="dark"] .theme-academy .badge-yeni      { background: #1E3A8A; color: #93C5FD; }
[data-theme="dark"] .theme-academy .badge-sicak     { background: #2E1065; color: #C084FC; }
[data-theme="dark"] .theme-academy .badge-soguk     { background: #374151; color: #9CA3AF; }
[data-theme="dark"] .theme-academy .badge-kazanildi { background: #064E3B; color: #34D399; }
[data-theme="dark"] .theme-academy .badge-kaybedildi { background: #7F1D1D; color: #FCA5A5; }
[data-theme="dark"] .theme-academy .badge-gorusuluyor { background: #0C4A6E; color: #7DD3FC; }

/* ===== BLAZOR AUTOMATIC RECONNECT BANNER ===== */
#components-reconnect-modal {
    position: fixed !important;
    top: 16px !important;
    right: 16px !important;
    left: auto !important;
    bottom: auto !important;
    width: auto !important;
    max-width: 380px !important;
    height: auto !important;
    padding: 12px 18px !important;
    border-radius: 12px !important;
    background: var(--surface, #ffffff) !important;
    color: var(--ink, #1e293b) !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
    z-index: 99999 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    display: none;
}
#components-reconnect-modal.components-reconnect-show {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    border-color: #ef4444 !important;
}
.customer-consultant{display:flex;flex-direction:column;gap:2px}.customer-consultant small{color:var(--ink-soft);font-size:10px}
.calendar-scope{display:inline-flex;gap:4px;padding:4px;margin:-8px 0 14px;border:1px solid var(--border);border-radius:10px;background:var(--surface)}.calendar-scope button{border:0;border-radius:7px;padding:8px 14px;background:transparent;color:var(--ink-soft);font:inherit;font-size:12px;cursor:pointer}.calendar-scope button.active{background:var(--primary-soft);color:var(--primary);font-weight:700}.calendar-scope button:disabled{opacity:.4;cursor:not-allowed}.calendar-privacy{display:flex;align-items:center;gap:7px;margin:-4px 0 14px;color:var(--ink-soft);font-size:12px}.calendar-privacy i{color:var(--primary)}
