﻿/* ============================================================
   AMBULANS ÖN MUHASEBE – ANA STİL DOSYASI
   Dark theme, glassmorphism, professional design
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Değişkenleri ---- */
:root {
    --bg-app:       #0b0f1a;
    --bg-surface:   #111827;
    --bg-card:      #1a2035;
    --bg-card-h:    #1f2845;
    --bg-input:     #0f1623;
    --bg-hover:     #252f46;

    --accent:       #6366f1;
    --accent-h:     #818cf8;
    --accent-dark:  #4338ca;
    --accent-glow:  rgba(99,102,241,0.25);

    --success:      #10b981;
    --success-bg:   rgba(16,185,129,0.12);
    --danger:       #ef4444;
    --danger-bg:    rgba(239,68,68,0.12);
    --warning:      #f59e0b;
    --warning-bg:   rgba(245,158,11,0.12);
    --info:         #3b82f6;
    --info-bg:      rgba(59,130,246,0.12);
    --purple:       #8b5cf6;
    --purple-bg:    rgba(139,92,246,0.12);
    --orange:       #f97316;
    --orange-bg:    rgba(249,115,22,0.12);

    --text-1:       #f1f5f9;
    --text-2:       #94a3b8;
    --text-3:       #64748b;
    --text-4:       #475569;

    --border:       rgba(255,255,255,0.07);
    --border-h:     rgba(255,255,255,0.12);

    --sidebar-w:    240px;
    --topbar-h:     64px;
    --radius:       12px;
    --radius-sm:    8px;
    --radius-lg:    16px;
    --radius-xl:    20px;

    --shadow-sm:    0 2px 8px rgba(0,0,0,0.3);
    --shadow:       0 4px 24px rgba(0,0,0,0.45);
    --shadow-lg:    0 8px 40px rgba(0,0,0,0.6);
    --shadow-glow:  0 0 30px rgba(99,102,241,0.2);

    --trans:        all 0.2s ease;
    --trans-fast:   all 0.15s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-app);
    color: var(--text-1);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 0.9rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   AUTH SCREENS
   ============================================================ */
.auth-screen {
    position: fixed; inset: 0;
    z-index: 100;
}
.auth-bg {
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at 20% 50%, #1a1040 0%, #0b0f1a 50%, #0a1628 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    position: relative; overflow: hidden;
}
.auth-bg::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    top: -100px; left: -100px;
    animation: pulse 6s ease-in-out infinite alternate;
}
.auth-bg::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(239,68,68,0.1) 0%, transparent 70%);
    bottom: -50px; right: -50px;
    animation: pulse 8s ease-in-out infinite alternate-reverse;
}
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.3); } }

.auth-card {
    background: rgba(26,32,53,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-h);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative; z-index: 1;
    animation: slideUp 0.4s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-logo { text-align: center; margin-bottom: 32px; }
.logo-badge {
    width: 68px; height: 68px;
    background: linear-gradient(135deg, var(--accent), var(--danger));
    border-radius: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}
.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f1f5f9, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-logo p { color: var(--text-3); font-size: 0.875rem; margin-top: 4px; }

.auth-switch { text-align: center; margin-top: 20px; color: var(--text-3); font-size: 0.875rem; }
.auth-switch .btn-link {
    color: var(--accent-h); font-weight: 500; margin-left: 6px;
    text-decoration: underline; cursor: pointer;
    transition: var(--trans-fast);
}
.auth-switch .btn-link:hover { color: white; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 50;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
.app-layout.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}
.app-layout.sidebar-collapsed .content-wrapper {
    margin-left: 0;
}
.sidebar-header {
    padding: 20px 16px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
}
.sidebar-brand.brand-vertical {
    flex-direction: column; align-items: center; gap: 6px; flex:1;
}
.brand-icon { font-size: 28px; }
.brand-icon img { display: block; }
.brand-text { display: flex; flex-direction: column; }
.brand-vertical .brand-text { align-items: center; }
.brand-name { font-size: 0.95rem; font-weight: 700; color: var(--text-1); }
.brand-vertical .brand-name { font-size: 0.8rem; text-align: center; line-height: 1.3; }
.brand-sub  { font-size: 0.7rem; color: var(--text-3); font-weight: 400; }
.brand-vertical .brand-sub { font-size: 0.65rem; text-align: center; }
.sidebar-close-btn {
    color: var(--text-3); font-size: 1rem; padding: 4px 8px; border-radius: 6px;
    transition: var(--trans-fast); display: none;
}
.sidebar-close-btn:hover { background: var(--bg-hover); color: var(--text-1); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 8px; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.nav-section-label {
    font-size: 0.65rem; font-weight: 600; letter-spacing: 0.08em;
    color: var(--text-4); padding: 12px 8px 6px; text-transform: uppercase;
}
.sidebar-nav ul { list-style: none; }
.sidebar-nav li { margin-bottom: 2px; }

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 0.875rem; font-weight: 500;
    transition: var(--trans-fast);
    position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-1); }
.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-h);
    font-weight: 600;
}
.nav-item.active::before {
    content: '';
    position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; background: var(--accent); border-radius: 2px;
}
.nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.nav-label { flex: 1; }

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sidebar-footer-user {
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-card { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.875rem; flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--text-3); }
.logout-btn { padding: 6px; border-radius: var(--radius-sm); color: var(--text-3); transition: var(--trans-fast); font-size: 1.1rem; }
.logout-btn:hover { background: var(--danger-bg); color: var(--danger); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    z-index: 49; backdrop-filter: blur(2px);
}

/* ---- Content Wrapper ---- */
.content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.28s ease;
}

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.menu-btn {
    color: var(--text-2); font-size: 1.2rem; padding: 6px 10px;
    border-radius: var(--radius-sm); transition: var(--trans-fast);
    display: flex;
}
.menu-btn:hover { background: var(--bg-hover); color: var(--text-1); }

.breadcrumb { display: flex; align-items: center; gap: 8px; }
.breadcrumb-home { color: var(--text-3); font-size: 0.9rem; }
.breadcrumb-sep  { color: var(--text-4); }
.breadcrumb-current { font-weight: 600; font-size: 0.95rem; }

.topbar-date { font-size: 0.8rem; color: var(--text-3); display: none; }

/* ---- Page Content ---- */
.page-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* ============================================================
   LOADING / ERRORS
   ============================================================ */
.loading-state, .loading-spinner {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 300px; gap: 16px; color: var(--text-3);
}
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-state {
    background: var(--danger-bg); border: 1px solid var(--danger);
    border-radius: var(--radius); padding: 24px; margin: 20px 0;
}
.error-state pre { font-size: 0.8rem; margin-top: 8px; color: var(--danger); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--trans);
}
.card:hover { border-color: var(--border-h); }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border);
}
.card-title { font-size: 0.95rem; font-weight: 600; }
.card-subtitle { font-size: 0.78rem; color: var(--text-3); }

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stats-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex; align-items: center; gap: 16px;
    transition: var(--trans);
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card.stat-green::before  { background: linear-gradient(90deg, var(--success), #34d399); }
.stat-card.stat-red::before    { background: linear-gradient(90deg, var(--danger), #f87171); }
.stat-card.stat-blue::before   { background: linear-gradient(90deg, var(--info), #60a5fa); }
.stat-card.stat-purple::before { background: linear-gradient(90deg, var(--purple), #a78bfa); }
.stat-card.stat-orange::before { background: linear-gradient(90deg, var(--orange), #fb923c); }

.stat-icon-wrap { font-size: 1.8rem; }
.stat-body { flex: 1; min-width: 0; }
.stat-label { font-size: 0.78rem; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 1.3rem; font-weight: 700; margin: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub   { font-size: 0.75rem; color: var(--text-3); }

/* Mini stats */
.mini-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    border-left: 3px solid;
}
.mini-stat.blue   { border-left-color: var(--info); }
.mini-stat.green  { border-left-color: var(--success); }
.mini-stat.red    { border-left-color: var(--danger); }
.mini-stat.purple { border-left-color: var(--purple); }
.mini-stat.orange { border-left-color: var(--orange); }
.mini-stat.gray   { border-left-color: var(--text-3); }
.ms-val { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }
.ms-lbl { font-size: 0.78rem; color: var(--text-3); }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-page { display: flex; flex-direction: column; gap: 20px; }
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.chart-container { height: 260px; padding: 16px; }

.recent-list { padding: 8px 0; }
.recent-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--trans-fast);
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: var(--bg-hover); }
.recent-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--success); box-shadow: 0 0 6px var(--success); }
.dot-red   { background: var(--danger);  box-shadow: 0 0 6px var(--danger);  }
.recent-info { flex: 1; min-width: 0; }
.recent-desc { display: block; font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-date { font-size: 0.75rem; color: var(--text-3); }
.recent-amt  { font-size: 0.875rem; font-weight: 600; white-space: nowrap; }

.kasa-mini-list { padding: 8px 20px; }
.kasa-mini-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.kasa-mini-item:last-child { border-bottom: none; }
.kasa-type-icon { font-size: 1.1rem; }
.kasa-mini-name { flex: 1; font-size: 0.875rem; font-weight: 500; }
.kasa-mini-bal  { font-size: 0.875rem; font-weight: 600; }

.cari-mini-list { padding: 4px 20px 8px; }
.cari-tip-badge {
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.cari-tip-badge.badge-blue   { background: var(--info-bg);   color: var(--info); }
.cari-tip-badge.badge-purple { background: var(--purple-bg); color: var(--purple); }

.ozet-list { padding: 8px 20px; display: flex; flex-direction: column; gap: 2px; }
.ozet-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--border);
}
.ozet-item:last-child { border-bottom: none; }
.ozet-icon  { font-size: 1rem; }
.ozet-label { flex: 1; font-size: 0.85rem; color: var(--text-2); }
.ozet-value { font-size: 0.85rem; font-weight: 600; }

/* ============================================================
   MODULE PAGES
   ============================================================ */
.module-page { display: flex; flex-direction: column; gap: 20px; }
.module-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-title { font-size: 1rem; font-weight: 600; }
.year-badge {
    background: var(--accent-glow); color: var(--accent-h);
    padding: 4px 14px; border-radius: 20px; font-weight: 600; font-size: 0.9rem;
}

.search-box {
    position: relative;
    display: flex; align-items: center;
}
.search-box input {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 8px 12px 8px 34px;
    color: var(--text-1); width: 260px;
    transition: var(--trans-fast);
}
.search-box input:focus { border-color: var(--accent); outline: none; }
.search-box input::placeholder { color: var(--text-4); }
.search-icon {
    position: absolute; left: 10px; font-size: 0.9rem;
    pointer-events: none; color: var(--text-3);
}

.filter-tabs { display: flex; gap: 4px; }
.ftab {
    padding: 7px 14px; border-radius: var(--radius-sm);
    font-size: 0.83rem; font-weight: 500;
    color: var(--text-3); background: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--trans-fast);
}
.ftab:hover { border-color: var(--border-h); color: var(--text-1); }
.ftab.active {
    background: var(--accent-glow); color: var(--accent-h);
    border-color: var(--accent);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; }
.data-table {
    width: 100%; border-collapse: collapse; font-size: 0.875rem;
}
.data-table th {
    padding: 12px 16px; text-align: left;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-3);
    background: var(--bg-app); border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }

.cell-main { font-weight: 500; }
.cell-sub  { font-size: 0.78rem; color: var(--text-3); margin-top: 1px; }
.empty-row { text-align: center; padding: 40px 16px; color: var(--text-3); }

tfoot .total-row td {
    padding: 12px 16px; font-weight: 600;
    background: var(--bg-app); border-top: 2px solid var(--border);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 500;
    cursor: pointer; transition: var(--trans-fast);
    white-space: nowrap; border: 1px solid transparent;
}
.btn-primary {
    background: var(--accent); color: white; border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); box-shadow: 0 4px 14px var(--accent-glow); }
.btn-secondary {
    background: var(--bg-card); color: var(--text-1); border-color: var(--border-h);
}
.btn-secondary:hover { background: var(--bg-hover); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger  { background: var(--danger);  color: white; border-color: var(--danger);  }
.btn-danger:hover  { filter: brightness(1.1); }
.btn-ghost   { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-1); border-color: var(--border-h); }
.btn-sm  { padding: 6px 12px; font-size: 0.8rem; }
.btn-xs  { padding: 4px 8px;  font-size: 0.78rem; }
.btn-lg  { padding: 12px 24px; font-size: 0.95rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-link { color: var(--accent-h); cursor: pointer; font-size: inherit; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); color: var(--text-2); transition: var(--trans-fast); }
.btn-icon:hover { background: var(--bg-hover); color: var(--text-1); }
.btn-icon-mini { padding: 3px 5px; border-radius: 4px; color: var(--text-3); font-size: 0.8rem; transition: var(--trans-fast); }
.btn-icon-mini:hover { background: var(--danger-bg); color: var(--danger); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ============================================================
   FORMS
   ============================================================ */
.auth-form, .modal-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-group label {
    font-size: 0.8rem; font-weight: 500; color: var(--text-2);
}
.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 14px;
    color: var(--text-1); transition: var(--trans-fast);
    width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent); outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group input::placeholder { color: var(--text-4); }
.form-group select { cursor: pointer; }
.form-group select option { background: var(--bg-surface); }
.form-group textarea { resize: vertical; min-height: 70px; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper input { padding-left: 36px; padding-right: 40px; }
.input-icon { position: absolute; left: 12px; font-size: 0.9rem; pointer-events: none; }
.toggle-pw {
    position: absolute; right: 10px; color: var(--text-3);
    font-size: 1rem; transition: var(--trans-fast);
}
.toggle-pw:hover { color: var(--text-1); }
.input-display {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 14px;
    font-weight: 600; font-size: 0.9rem;
}

.form-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-h);
    border-radius: var(--radius-lg);
    width: 100%; max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }

.modal-md { max-width: 520px; }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1140px; width: 95vw; }
.modal-full { width: 100vw !important; height: 100vh !important; max-width: 100vw !important; max-height: 100vh !important; border-radius: 0 !important; margin: 0 !important; border: none !important; }
.modal-overlay:has(.modal-full) { padding: 0 !important; }

.modal-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close {
    color: var(--text-3); font-size: 1rem;
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: var(--trans-fast);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
}
.badge-blue   { background: var(--info-bg);    color: var(--info);    }
.badge-green  { background: var(--success-bg); color: var(--success); }
.badge-red    { background: var(--danger-bg);  color: var(--danger);  }
.badge-purple { background: var(--purple-bg);  color: var(--purple);  }
.badge-gray   { background: rgba(100,116,139,0.15); color: var(--text-3); }
.badge-orange { background: var(--orange-bg);  color: var(--orange);  }

/* ============================================================
   ALERT
   ============================================================ */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.875rem; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }

/* ============================================================
   ACTION BUTTONS
   ============================================================ */
.action-btns { display: flex; gap: 4px; }

/* ============================================================
   KASA MODULE
   ============================================================ */
.kasa-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: start;
}
.kasa-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.kasa-sb-header {
    padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 0.9rem;
}
.kasa-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.kasa-card {
    background: var(--bg-app); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px;
    cursor: pointer; transition: var(--trans-fast);
}
.kasa-card { user-select: none; }
.kasa-card:hover { border-color: var(--border-h); background: var(--bg-hover); }
.kasa-card.kasa-active { border-color: var(--accent); background: var(--accent-glow); }
.kasa-card.kasa-drag-over {
    border-color: #f59e0b !important;
    border-top: 3px solid #f59e0b !important;
    background: rgba(245,158,11,0.07) !important;
    transform: scale(1.01);
}
.kasa-drag-handle {
    cursor: grab;
    color: var(--text-4);
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.kasa-drag-handle:hover {
    color: var(--text-2);
    background: var(--bg-hover);
}
.kasa-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kasa-card-name { flex: 1; font-size: 0.875rem; font-weight: 500; }
.kasa-card-bal  { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.kasa-card-stats { display: flex; gap: 12px; font-size: 0.78rem; font-weight: 500; }
.kasa-main { display: flex; flex-direction: column; gap: 16px; }
.kasa-main-header {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
}
.kasa-main-header h3 { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kasa-tip-badge { font-size: 0.8rem; color: var(--text-3); }
.kasa-bakiye    { font-size: 0.85rem; font-weight: 600; }
.kasa-action-btns { display: flex; gap: 8px; }
.kasa-filter-row {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.kasa-filter-row input[type="month"],
.kasa-filter-row select {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 7px 12px;
    color: var(--text-1); font-size: 0.875rem;
}
.kasa-empty-state {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 60px 20px;
    text-align: center; color: var(--text-3);
}
.kasa-empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.kasa-empty-state h3 { color: var(--text-1); margin-bottom: 8px; }
.kasa-empty-state p  { margin-bottom: 20px; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bar-wrap {
    display: flex; align-items: center; gap: 8px;
    width: 120px;
}
.progress-bar {
    height: 6px; border-radius: 3px; flex: 1; max-width: 80px;
    transition: width 0.5s ease;
}
.bar-green  { background: var(--success); }
.bar-orange { background: var(--warning); }
.bar-red    { background: var(--danger);  }
.progress-label { font-size: 0.75rem; color: var(--text-3); white-space: nowrap; min-width: 38px; }


/* Ekstre */
.ekstre-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.ekstre-info { display: flex; flex-direction: column; gap: 4px; font-size: 0.875rem; color: var(--text-2); }
.ekstre-info strong { color: var(--text-1); }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
    position: fixed; bottom: 24px; right: 24px;
    z-index: 999; display: flex; flex-direction: column; gap: 10px;
}
.toast {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-card); border: 1px solid var(--border-h);
    border-radius: var(--radius-sm); padding: 12px 16px;
    box-shadow: var(--shadow);
    font-size: 0.875rem; font-weight: 500;
    transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    max-width: 340px;
}
.toast.show { transform: translateX(0); }
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger);  }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid var(--info);    }
.toast-icon    { font-size: 1rem; }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden  { display: none !important; }
.fade-in { animation: fadeIn 0.3s ease; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger);  }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-3);  }
.fw-500  { font-weight: 500; }
.fw-600  { font-weight: 600; }
.fw-700  { font-weight: 700; }
.empty-state {
    text-align: center; padding: 30px 20px;
    color: var(--text-3); font-size: 0.875rem;
}

/* ============================================================
   LEAFLET MAP OVERRIDES
   ============================================================ */
/* ─── Şube Sekme Çubuğu ─────────────────────────────── */
.sube-tabbar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-bottom: 2px solid var(--border);
    padding: 0 16px;
    gap: 0;
    flex-shrink: 0;
    min-height: 64px;
}
.sube-tabs-scroll {
    display: flex;
    align-items: stretch;
    gap: 2px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
    padding: 8px 0;
}
.sube-tabs-scroll::-webkit-scrollbar { display: none; }
.sube-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
    white-space: nowrap;
    position: relative;
}
.sube-tab:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}
.sube-tab-active {
    background: var(--accent-glow) !important;
    border-color: var(--accent) !important;
}
.sube-tab .st-icon { font-size: 1.15rem; flex-shrink: 0; }
.sube-tab .st-body { display: flex; flex-direction: column; align-items: flex-start; }
.sube-tab .st-name { font-size: 0.82rem; font-weight: 600; color: var(--text-1); }
.sube-tab .st-meta { font-size: 0.68rem; color: var(--text-3); }
.sube-tab-active .st-name { color: var(--accent-h); }
.sube-tab-active .st-meta { color: var(--accent); }
.st-badge {
    font-size: 0.58rem; font-weight: 700; letter-spacing: 0.04em;
    padding: 1px 5px; border-radius: 4px; text-transform: uppercase;
}
.badge-merkez  { background: rgba(99,102,241,0.12); color: var(--accent); }
.badge-readonly { background: rgba(148,163,184,0.15); color: var(--text-3); }
.sube-tabbar-right {
    display: flex; align-items: center; gap: 8px;
    padding-left: 16px; border-left: 1px solid var(--border); flex-shrink: 0;
}
.sube-total-badge {
    font-size: 0.78rem; color: var(--text-2);
    white-space: nowrap;
}
.sube-total-badge strong { color: var(--success); font-weight: 700; }
/* Overflow dropdown */
.sube-overflow-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 200;
    background: var(--bg-card); border: 1px solid var(--border-h);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    min-width: 220px; overflow: hidden;
}
.sube-overflow-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 10px 14px;
    font-size: 0.82rem; font-family: inherit;
    background: none; border: none; cursor: pointer;
    color: var(--text-1); transition: background 0.15s;
}
.sube-overflow-item:hover { background: var(--bg-hover); }
.sube-overflow-item.active { background: var(--accent-glow); color: var(--accent-h); }
/* Readonly badge */
.readonly-badge {
    font-size: 0.62rem; background: rgba(148,163,184,0.15);
    color: var(--text-3); padding: 1px 5px; border-radius: 4px; white-space: nowrap;
}

#leafletMap { z-index: 0; }

.leaflet-container {
    font-family: 'Inter', sans-serif;
    background: var(--bg-input);
}
.harita-tooltip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-h) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-1) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.82rem !important;
    padding: 6px 10px !important;
    box-shadow: var(--shadow) !important;
}
.harita-tooltip::before { display: none !important; }
.harita-tooltip-rich {
    background: rgba(10, 15, 30, 0.94) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(99,102,241,0.28) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    box-shadow: 0 16px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04) !important;
    max-width: 320px !important;
    font-family: 'Inter', sans-serif !important;
}
.harita-tooltip-rich::before { display: none !important; }
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-h) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-1) !important;
    box-shadow: var(--shadow) !important;
}
.leaflet-popup-tip { background: var(--bg-card) !important; }
.leaflet-control-zoom a {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    color: var(--text-1) !important;
}
.leaflet-control-zoom a:hover {
    background: var(--bg-hover) !important;
    color: var(--accent-h) !important;
}
.leaflet-control-attribution {
    background: rgba(0,0,0,0.4) !important;
    color: var(--text-4) !important;
    font-size: 0.65rem !important;
}
.leaflet-control-attribution a { color: var(--text-3) !important; }

/* Dark modda harita – tüm container'ı karart, overlay'leri geri döndür */
html[data-theme="dark"] #leafletMap {
    filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.85);
}
/* Marker/tooltip/popup'ları çift-invert ile orijinal renge getir */
html[data-theme="dark"] #leafletMap .leaflet-overlay-pane,
html[data-theme="dark"] #leafletMap .leaflet-marker-pane,
html[data-theme="dark"] #leafletMap .leaflet-shadow-pane,
html[data-theme="dark"] #leafletMap .leaflet-tooltip-pane,
html[data-theme="dark"] #leafletMap .leaflet-popup-pane {
    filter: invert(1) hue-rotate(180deg);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .dash-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .dash-grid-2 { grid-template-columns: 1fr; }
    .dash-grid-3 { grid-template-columns: 1fr; }
    .kasa-layout { grid-template-columns: 1fr; }
    .kasa-sidebar { max-height: 300px; overflow-y: auto; }
}
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 51;
        width: 260px;
    }
    .sidebar.sidebar-open { transform: translateX(0); }
    .sidebar-close-btn { display: flex; }
    .content-wrapper { margin-left: 0; }
    .menu-btn { display: flex; }
    .topbar-date { display: none; }
    .topbar { padding: 0 16px; }
    .page-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .search-box input { width: 100%; }
    .module-toolbar { flex-direction: column; align-items: flex-start; }
    .toolbar-right { width: 100%; justify-content: flex-end; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stats-grid-3 { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 20px; }
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-box { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 95vh; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .sidebar, .topbar, .module-toolbar .btn-primary, .action-btns, .topbar-right { display: none !important; }
    .content-wrapper { margin-left: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    body { background: white; color: black; }
    .data-table th, .data-table td { color: black; }
}

/* ============================================================
   TAM EKRAN VE TOPLU İŞLEM
   ============================================================ */
.card.card-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 24px !important;
    box-sizing: border-box !important;
    background: var(--bg-card) !important;
    overflow: hidden !important;
}
.card.card-fullscreen .table-wrapper {
    flex: 1 !important;
    max-height: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
}
.btn-fullscreen {
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    cursor: pointer;
    transition: var(--trans-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-fullscreen:hover {
    border-color: var(--border-h);
    background: var(--bg-input);
    color: var(--text-1);
}
.batch-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 12px;
    animation: batchSlideDown 0.18s ease-out;
}
@keyframes batchSlideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ---- Personel File Upload Areas ---- */
.file-upload-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
    margin-top: 8px;
}
.file-upload-card {
    background: var(--bg-input);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    text-align: center;
    position: relative;
    transition: var(--trans-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    width: 100%;
    overflow: hidden;
}
.file-upload-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}
.file-upload-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 4px;
    border: 1.5px solid var(--border-h);
}
.file-upload-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
    color: var(--text-3);
    line-height: 1;
}
.file-upload-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 4px;
    text-align: center;
    width: 100%;
}
.file-upload-name {
    font-size: 0.72rem;
    color: var(--success);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    width: 100%;
    text-align: center;
    display: block;
    margin-bottom: 6px;
}
.file-upload-btn-group {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}
.file-upload-btn {
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 500;
    border-radius: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    transition: var(--trans-fast);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.file-upload-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-h);
    color: var(--text-1);
}
.file-upload-btn.btn-remove {
    color: var(--danger);
}
.file-upload-btn.btn-remove:hover {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.3);
}
.file-upload-btn.btn-select {
    color: var(--accent-h);
}
.file-upload-btn.btn-select:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .file-upload-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Professional Tree Branch UI ---- */
.tree-branch {
    position: relative;
    margin: -12px -16px;
    padding: 12px 16px 12px 40px;
    display: flex;
    align-items: center;
    min-height: 44px;
}
.tree-line-v {
    position: absolute;
    left: 22px;
    top: 0;
    bottom: 0;
    width: 2px;
    border-left: 1.5px dashed rgba(99, 102, 241, 0.45);
    pointer-events: none;
}
.tree-branch.is-last .tree-line-v {
    bottom: 50%; /* terminate in the middle of this row */
}
.tree-line-h {
    position: absolute;
    left: 22px;
    top: 50%;
    width: 10px;
    height: 0;
    border-top: 1.5px dashed rgba(99, 102, 241, 0.45);
    pointer-events: none;
}
.tree-icon {
    margin-right: 8px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
}
.tree-info-text {
    display: flex;
    flex-direction: column;
}
.tree-title {
    font-weight: 500;
}

/* ---- Maliyet Analizi Modülü ---- */
.maliyet-progress-bar {
    background: rgba(255, 255, 255, 0.05);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
    width: 100%;
}
.maliyet-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: var(--trans);
}
.maliyet-progress-fill.positive {
    background: var(--success);
}
.maliyet-progress-fill.negative {
    background: var(--danger);
}
.maliyet-detail-panel {
    background: rgba(15, 22, 35, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 8px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    text-align: left;
}
@media (max-width: 900px) {
    .maliyet-detail-panel {
        grid-template-columns: 1fr;
    }
}
.maliyet-detail-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.maliyet-detail-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1.5px solid var(--border);
    padding-bottom: 4px;
    margin-bottom: 4px;
}
.maliyet-detail-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
}
.maliyet-detail-item {
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-1);
    background: rgba(255, 255, 255, 0.02);
    padding: 6px 8px;
    border-radius: 4px;
}
.maliyet-detail-item-sub {
    font-size: 0.72rem;
    color: var(--text-3);
}

/* ============================================================
   LIGHT THEME OVERRIDES
   ============================================================ */
[data-theme="light"] {
    --bg-app:       #f1f5f9;
    --bg-surface:   #ffffff;
    --bg-card:      #ffffff;
    --bg-card-h:    #f8fafc;
    --bg-input:     #f8fafc;
    --bg-hover:     #f1f5f9;

    --accent:       #4f46e5;
    --accent-h:     #6366f1;
    --accent-dark:  #3730a3;
    --accent-glow:  rgba(79, 70, 229, 0.1);

    --text-1:       #0f172a;
    --text-2:       #475569;
    --text-3:       #64748b;
    --text-4:       #94a3b8;

    --border:       #e2e8f0;
    --border-h:     #cbd5e1;

    --shadow-sm:    0 1px 3px rgba(0,0,0,0.05);
    --shadow:       0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg:    0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
    --shadow-glow:  0 0 20px rgba(79, 70, 229, 0.05);
}

[data-theme="light"] .auth-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] .auth-logo h1 {
    background: linear-gradient(135deg, #0f172a, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .auth-bg {
    background: radial-gradient(ellipse at 20% 50%, #e2e8f0 0%, #f1f5f9 50%, #f8fafc 100%);
}

[data-theme="light"] .auth-bg::before {
    background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
}

[data-theme="light"] .auth-bg::after {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.05) 0%, transparent 70%);
}

[data-theme="light"] .project-header-row {
    background: rgba(79, 70, 229, 0.08) !important;
}

[data-theme="light"] .project-parent-row {
    background: rgba(79, 70, 229, 0.06) !important;
}

[data-theme="light"] .newProjeIcon, 
[data-theme="light"] #newProjeFormContainer {
    background: rgba(79, 70, 229, 0.04) !important;
}

[data-theme="light"] .maliyet-detail-panel {
    background: var(--bg-hover) !important;
    border-color: var(--border-h) !important;
}

[data-theme="light"] .maliyet-detail-item {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border) !important;
}

[data-theme="light"] .maliyet-progress-bar {
    background: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .maliyet-drawer-body {
    background: var(--bg-hover) !important;
}

/* ---- Maliyet Side Drawer ---- */
.maliyet-drawer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    transition: opacity 0.3s ease;
}
.maliyet-drawer.hidden {
    display: none !important;
}
.maliyet-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}
.maliyet-drawer-content {
    position: relative;
    width: 480px;
    max-width: 90vw;
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border-h);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25);
    transform: translateX(0);
    animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
.maliyet-drawer-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.maliyet-drawer-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-1);
}
.maliyet-drawer-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    font-size: 1.1rem;
    transition: var(--trans-fast);
    cursor: pointer;
}
.maliyet-drawer-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
}
.maliyet-drawer-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.maliyet-drawer-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.maliyet-chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .maliyet-chart-container {
    background: var(--bg-surface) !important;
    border-color: var(--border) !important;
}


/* ============================================================
   AY SONU FİNANSAL TAHMİN BİLEŞENİ
   ============================================================ */
.estimation-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--trans);
    position: relative;
    overflow: hidden;
}
.estimation-card:hover {
    box-shadow: var(--shadow-lg);
}
.est-body-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: center;
    margin-bottom: 20px;
}
@media (max-width: 992px) {
    .est-body-grid {
        grid-template-columns: 1fr;
    }
}
.est-visual-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    text-align: center;
    min-height: 180px;
}
.est-status-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.1));
}
.est-status-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.est-status-desc {
    font-size: 0.82rem;
    color: var(--text-3);
    line-height: 1.4;
}

.est-numbers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.est-num-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: var(--trans);
}
.est-num-card:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-1px);
}
.est-num-label {
    font-size: 0.72rem;
    color: var(--text-3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.est-num-val {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.est-num-sub {
    font-size: 0.75rem;
    color: var(--text-3);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.est-num-card.est-result {
    border-width: 2px;
}
.est-num-card.est-result.healthy {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.03);
}
.est-num-card.est-result.caution {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.03);
}
.est-num-card.est-result.critical {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.03);
    animation: estPulse 2s infinite;
}

.est-banner {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border-left: 4px solid;
    font-size: 0.88rem;
    line-height: 1.5;
    margin-top: 10px;
}
.est-banner.healthy {
    background: rgba(16, 185, 129, 0.08);
    border-left-color: var(--success);
    color: #a7f3d0;
}
[data-theme="light"] .est-banner.healthy {
    color: #065f46;
}
.est-banner.caution {
    background: rgba(245, 158, 11, 0.08);
    border-left-color: var(--orange);
    color: #fde68a;
}
[data-theme="light"] .est-banner.caution {
    color: #92400e;
}
.est-banner.critical {
    background: rgba(239, 68, 68, 0.08);
    border-left-color: var(--danger);
    color: #fecaca;
}
[data-theme="light"] .est-banner.critical {
    color: #991b1b;
}

.est-details-panel {
    transition: max-height 0.3s ease-out;
    overflow: hidden;
}
.est-details-panel.hidden {
    display: none;
}
.est-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 992px) {
    .est-details-grid {
        grid-template-columns: 1fr;
    }
}
.est-detail-section {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}
.est-detail-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    color: var(--text-2);
}
.est-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.est-detail-table th {
    text-align: left;
    color: var(--text-3);
    font-weight: 500;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}
.est-detail-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}
[data-theme="light"] .est-detail-table td {
    border-bottom-color: rgba(0, 0, 0, 0.03);
}

@keyframes estPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ═══════════════════════════════════════════════════════════
   KULLANICI DEĞİŞTİRME SİSTEMİ – Drawer + Bar
   ═══════════════════════════════════════════════════════════ */

/* ── Üst Şerit (sadece impersonation aktifken) ── */
.imp-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 2000;
    background: linear-gradient(90deg, #d97706, #ea580c);
    color: #1c1917;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 3px 16px rgba(234,88,12,0.45);
    animation: impBarPulse 3s ease-in-out infinite;
}
.imp-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    max-width: 100%;
}
@keyframes impBarPulse {
    0%, 100% { box-shadow: 0 3px 16px rgba(234,88,12,0.45); }
    50%       { box-shadow: 0 3px 28px rgba(234,88,12,0.75); }
}
.imp-bar-eye { font-size: 1.1rem; flex-shrink: 0; }
.imp-bar-text { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.imp-bar-text strong { font-weight: 800; }
.imp-bar-badge {
    background: rgba(0,0,0,0.2);
    padding: 1px 9px;
    border-radius: 20px;
    font-size: 0.73rem;
    font-weight: 700;
}
.imp-bar-exitbtn,
.imp-bar-switchbtn {
    background: rgba(0,0,0,0.22);
    color: #1c1917;
    border: 1.5px solid rgba(0,0,0,0.25);
    border-radius: 8px;
    padding: 5px 13px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    flex-shrink: 0;
}
.imp-bar-exitbtn:hover,
.imp-bar-switchbtn:hover {
    background: rgba(0,0,0,0.38);
    transform: translateY(-1px);
}
/* Şerit açıkken sayfayı aşağı it */
body:has(#impersonationBar:not(.hidden)) .app-layout {
    padding-top: 42px;
}


/* ── Sidebar İçi Kullanıcı Değiştir Butonu ── */
#userSwitcherTrigger:not(.hidden) {
    display: flex;
}

/* ── Overlay ── */
.us-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    z-index: 1900;
    transition: opacity 0.25s;
}

/* ── Drawer ── */
.us-drawer {
    position: fixed;
    top: 0; right: 0;
    width: 340px;
    max-width: 95vw;
    height: 100vh;
    z-index: 1950;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 40px rgba(0,0,0,0.35);
    transform: translateX(110%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.us-drawer.open {
    transform: translateX(0);
}

/* Drawer Header */
.us-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(109,40,217,0.06));
    flex-shrink: 0;
}
.us-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
}
.us-close {
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-2);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.us-close:hover { background: var(--bg-hover); color: var(--text-1); }

/* Arama */
.us-search-wrap { padding: 14px 16px 8px; flex-shrink: 0; }
.us-search {
    width: 100%;
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-1);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.us-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* Bölüm Etiketleri */
.us-current-label,
.us-list-label {
    padding: 8px 16px 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-3);
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Şu anki kullanıcı */
.us-current-card { padding: 0 12px 4px; flex-shrink: 0; }

/* Kullanıcı Listesi */
.us-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 8px;
}
.us-list::-webkit-scrollbar { width: 5px; }
.us-list::-webkit-scrollbar-track { background: transparent; }
.us-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Kullanıcı Kartları */
.us-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    transition: all 0.18s;
    position: relative;
}
.us-user-card.us-active {
    background: rgba(99,102,241,0.1);
    border-color: rgba(99,102,241,0.25);
}
.us-user-card.us-clickable {
    cursor: pointer;
    background: var(--bg-input);
}
.us-user-card.us-clickable:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    transform: translateX(-2px);
}
.us-user-card.us-clickable:hover .us-switch-btn {
    opacity: 1;
    transform: translateX(0);
}
.us-user-card.us-real-admin {
    border-color: rgba(167,139,250,0.3);
}

/* Avatar */
.us-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Kullanıcı Bilgileri */
.us-user-info { flex: 1; min-width: 0; }
.us-user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}
.us-user-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 3px;
}
.us-username {
    font-size: 0.72rem;
    background: var(--bg-hover);
    padding: 1px 6px;
    border-radius: 5px;
    color: var(--text-3);
    font-family: monospace;
}
.us-role-pill,
.us-branch-pill {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 20px;
}
.us-branch-pill {
    background: rgba(16,185,129,0.12);
    color: #34d399;
}
.us-real-tag {
    font-size: 0.62rem;
    background: rgba(167,139,250,0.2);
    color: #a78bfa;
    padding: 0 5px;
    border-radius: 4px;
    font-weight: 700;
}

/* Bak butonu */
.us-switch-btn {
    font-size: 0.73rem;
    font-weight: 700;
    background: rgba(99,102,241,0.15);
    color: var(--accent);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 8px;
    padding: 4px 9px;
    cursor: pointer;
    opacity: 0;
    transform: translateX(6px);
    transition: all 0.18s;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Badge'lar */
.us-viewing-badge,
.us-you-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}
.us-viewing-badge {
    background: rgba(251,146,60,0.2);
    color: #fb923c;
}
.us-you-badge {
    background: rgba(167,139,250,0.2);
    color: #a78bfa;
}

/* Footer */
.us-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    display: none;
}
.us-admin-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.us-admin-btn:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(124,58,237,0.4);
}

/* Boş durum */
.us-empty {
    text-align: center;
    padding: 30px 16px;
    font-size: 0.85rem;
    color: var(--text-3);
}

/* Responsive */
@media (max-width: 480px) {
    .us-drawer { width: 100vw; }
    .imp-bar-inner { flex-wrap: wrap; gap: 8px; }
}

/* Çevrimiçi Kullanıcı - Titreşimli Yeşil Nokta */
.online-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    display: block;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    animation: onlinePulse 1.8s ease-in-out infinite;
}
@keyframes onlinePulse {
    0%   { box-shadow: 0 0 0 0   rgba(34,197,94, 0.6); }
    60%  { box-shadow: 0 0 0 6px rgba(34,197,94, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(34,197,94, 0);   }
}

/* ═══════════════════════════════════════════════════════════════
   CHAT — WhatsApp Benzeri Mesajlaşma Stilleri
   ══════════════════════════════════════════════════════════════ */

/* Animasyonlar */
@keyframes chatSlideUp {
    from { opacity:0; transform:translateY(20px) scale(0.97); }
    to   { opacity:1; transform:translateY(0)    scale(1);    }
}
@keyframes chatSlideDown {
    from { opacity:1; transform:translateY(0)    scale(1);    }
    to   { opacity:0; transform:translateY(20px) scale(0.97); }
}
@keyframes chatPulse {
    0%,100% { box-shadow:0 8px 24px rgba(99,102,241,0.45); }
    50%      { box-shadow:0 8px 32px rgba(99,102,241,0.75); transform:scale(1.05); }
}
@keyframes chatMsgIn {
    from { opacity:0; transform:translateY(6px); }
    to   { opacity:1; transform:translateY(0); }
}

/* Sidebar header */
.chat-sidebar-header {
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 2;
}

/* Bölüm etiketi */
.chat-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 10px 14px 4px;
}

/* Kullanıcı item */
.chat-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.15s;
    position: relative;
}
.chat-user-item:hover { background: var(--bg-hover); }
.chat-user-item.active { background: rgba(99,102,241,0.12); border-right:2px solid var(--accent); }

/* Avatar */
.chat-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    position: relative;
    user-select: none;
}
.chat-avatar-sm {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: #6366f1;
    align-self: flex-end;
    margin-bottom: 2px;
}

/* Online nokta */
.chat-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}

/* Kullanıcı bilgisi */
.chat-user-info {
    flex: 1;
    min-width: 0;
}
.chat-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-user-preview {
    font-size: 0.7rem;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* Okunmamış badge */
.chat-unread-badge {
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    flex-shrink: 0;
}

/* Mesaj satırı */
.chat-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: chatMsgIn 0.18s ease;
    margin-bottom: 2px;
}
.chat-msg-row.sent  { justify-content: flex-end; }
.chat-msg-row.recv  { justify-content: flex-start; }

/* Baloncuklar */
.chat-bubble {
    max-width: 72%;
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
}
.chat-bubble.sent {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-bubble.recv {
    background: var(--bg-card);
    color: var(--text-1);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

/* Gönderici ismi (grup) */
.chat-sender-name {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 3px;
}

/* Baloncuk alt bilgi */
.chat-bubble-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
}
.chat-time {
    font-size: 0.62rem;
    opacity: 0.65;
}
.chat-status {
    font-size: 0.65rem;
    opacity: 0.7;
}
.chat-status.read {
    color: #60a5fa;
    opacity: 1;
}

/* Tarih ayracı */
.chat-date-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}
.chat-date-divider::before,
.chat-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.chat-date-divider span {
    font-size: 0.67rem;
    color: var(--text-3);
    padding: 2px 10px;
    background: var(--bg-app);
    border-radius: 20px;
    white-space: nowrap;
}

/* Textarea scroll boyutu ayarı */
#chatInput::-webkit-scrollbar { width: 4px; }
#chatInput::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Mobil uyum */
@media (max-width: 680px) {
    #chatPanel { width: calc(100vw - 20px) !important; right: 10px !important; }
    #chatSidebar { width: 170px !important; min-width: 170px !important; }
}

/* Chat panel - topbar'dan aşağı açılış animasyonu (override) */
@keyframes chatSlideDown {
    from { opacity:0; transform:translateY(-12px) scale(0.97); }
    to   { opacity:1; transform:translateY(0)     scale(1);    }
}
@keyframes chatFadeOut {
    from { opacity:1; transform:translateY(0)     scale(1);    }
    to   { opacity:0; transform:translateY(-8px)  scale(0.97); }
}

/* ============================================================
   MALİYET EKSTRESİ – TAM EKRAN MODAL
   Dark & Light tema uyumu
   ============================================================ */

/* Animasyon */
@keyframes mextIn {
    from { opacity: 0; transform: scale(.98); }
    to   { opacity: 1; transform: scale(1); }
}

/* Kök konteyner */
#mext-fs {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    background: var(--bg-app);
    overflow: hidden;
    animation: mextIn .2s ease;
}

/* Header çizgisi */
#mext-fs .mext-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--bg-card);
    border-bottom: 2px solid var(--accent);
}

/* KPI çubuğu */
#mext-fs .mext-kpi-bar {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    padding: 12px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

/* Sekme çubuğu */
#mext-fs .mext-tabs {
    flex-shrink: 0;
    display: flex;
    padding: 0 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

/* İçerik alanı */
#mext-fs .mext-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-app);
}

/* Sekme butonları */
.mext-tab-btn {
    padding: 10px 18px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-3);
    transition: all .15s;
    white-space: nowrap;
}
.mext-tab-btn:hover  { color: var(--text-1); background: var(--bg-hover); }
.mext-tab-btn.active { color: var(--accent) !important; border-bottom-color: var(--accent) !important; }

/* İçerik panelleri */
.mext-pane         { display: none; }
.mext-pane.active  { display: block; }

/* 2 kolonlu ızgara */
.mext-g2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 768px) {
    .mext-g2 { grid-template-columns: 1fr; }
}

/* KPI kart */
.mext-kpi-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 160px;
    flex-shrink: 0;
}
.mext-kpi-icon  { font-size: 1.5rem; }
.mext-kpi-label { font-size: 0.68rem; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.mext-kpi-val   { font-size: 1.0rem; font-weight: 800; }
.mext-kpi-sub   { font-size: 0.7rem; color: var(--text-3); }

/* Light tema özellikleri */
[data-theme="light"] #mext-fs {
    background: var(--bg-app);
}
[data-theme="light"] .mext-tab-btn {
    color: var(--text-3);
}
[data-theme="light"] .mext-tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-1);
}
[data-theme="light"] .mext-kpi-card {
    box-shadow: var(--shadow-sm);
}


/* Context Menu (Shared - Personel/Cari/Arac) */
@keyframes ctxFadeIn { from{opacity:0;transform:scale(0.95)} to{opacity:1;transform:scale(1)} }
.ctx-item { padding:8px 14px; border-radius:7px; cursor:pointer; display:flex; align-items:center; gap:10px; transition:background 0.12s; color:var(--text-1); white-space:nowrap; }
.ctx-item:hover { background:var(--bg-hover,rgba(255,255,255,0.07)); }
.ctx-item.ctx-danger { color:#ef4444; }
.ctx-item.ctx-danger:hover { background:rgba(239,68,68,0.1); }
.ctx-sep { height:1px; background:var(--border,rgba(255,255,255,0.08)); margin:4px 8px; }
.ctx-head { padding:8px 14px 4px; color:var(--text-3); font-size:0.76rem; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; }
