/* ==========================================================================
   1. Tema Değişkenleri (Renk Paleti ve Ölçüler)
   ========================================================================== */
:root {
    --bg-main: #f5f6f8;
    --bg-white: #ffffff;
    --primary-blue: #0073e6;
    --primary-orange: #f07b3f;
    --text-dark: #333333;
    --text-muted: #828a9e;
    --border-color: #e5e7eb;
    
    /* Soft Renkler */
    --soft-green-bg: #eafaf1;
    --soft-green-text: #27ae60;
    --soft-blue-bg: #ebf5ff;
    --soft-blue-text: #2980b9;
    
    /* Ölçüler */
    --sidebar-width: 250px;
    --topbar-height: 60px;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* ==========================================================================
   2. Geneller (Reset & Body)
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    display: flex;
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ==========================================================================
   3. Ana İskelet (Sidebar & Topbar)
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width); background-color: var(--bg-white);
    border-right: 1px solid var(--border-color); display: flex;
    flex-direction: column; z-index: 10;
}
.sidebar .logo {
    height: var(--topbar-height); display: flex; align-items: center;
    padding: 0 20px; font-size: 24px; font-weight: 800;
    color: var(--primary-blue); border-bottom: 1px solid var(--border-color);
}
.menu { padding: 20px 0; overflow-y: auto; }
.menu-item {
    display: flex; align-items: center; padding: 12px 20px;
    color: var(--text-muted); font-weight: 500; transition: var(--transition);
}
.menu-item:hover { color: var(--text-dark); background-color: #f9fafb; }
.menu-item.active {
    color: var(--text-dark); background-color: #f4f6f9;
    border-left: 4px solid var(--primary-blue); font-weight: 600;
}

.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow-x: hidden; }
.topbar {
    height: var(--topbar-height); background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color); display: flex;
    justify-content: space-between; align-items: center; padding: 0 24px;
}
.topbar-right { display: flex; align-items: center; gap: 20px; color: var(--text-muted); }
.user-profile { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text-dark); }

/* ==========================================================================
   4. İçerik ve Grid Düzeni (Bento Grid)
   ========================================================================== */
.content-area {
    padding: 24px; overflow-y: auto; height: calc(100vh - var(--topbar-height));
}
.page-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
.page-header h2 { font-size: 20px; font-weight: 600; }
.dashboard-grid {
    display: grid; grid-template-columns: 1fr 1fr 320px; gap: 20px; align-items: start;
}
.card {
    background-color: var(--bg-white); border-radius: var(--border-radius);
    padding: 20px; border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.card-right-sidebar { grid-row: span 2; height: 100%; }
.card-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.card-title { font-size: 16px; font-weight: 600; }
.card-filter { color: var(--text-muted); font-size: 13px; cursor: pointer; }

/* ==========================================================================
   5. Form Elemanları ve Butonlar
   ========================================================================== */
.btn-orange {
    background-color: var(--primary-orange); color: var(--bg-white); border: none;
    padding: 10px 16px; border-radius: var(--border-radius); font-weight: 600;
    transition: var(--transition); display: inline-flex; align-items: center; gap: 8px;
}
.btn-orange:hover { background-color: #d96930; }
.btn-gray { background-color: #f4f6f9; color: var(--text-dark); border: none; transition: var(--transition); }
.btn-gray:hover { background-color: #e5e7eb; }
.btn-red {
    background-color: #e74c3c; color: #fff; border: none;
    padding: 10px 16px; border-radius: var(--border-radius); font-weight: 600; transition: var(--transition);
}
.btn-red:hover { background-color: #c0392b; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; }
.form-group.full-width { grid-column: span 2; }
.form-label { display: block; font-weight: 500; margin-bottom: 8px; font-size: 13px; }
.form-control {
    width: 100%; padding: 10px 15px; border: 1px solid var(--border-color);
    border-radius: var(--border-radius); font-size: 14px; background-color: #fff; transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary-blue); }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ==========================================================================
   6. Tablo Yapısı ve Aksiyonlar
   ========================================================================== */
.table-responsive { width: 100%; overflow-x: auto; }
.custom-table { width: 100%; border-collapse: collapse; text-align: left; }
.custom-table th, .custom-table td { padding: 12px 15px; border-bottom: 1px solid var(--border-color); }
.custom-table th { background-color: #f9fafb; color: var(--text-muted); font-weight: 600; font-size: 13px; }
.custom-table tr:hover { background-color: #fcfcfd; }

.action-btn {
    padding: 6px 12px; border-radius: 4px; font-size: 12px; font-weight: 600; border: none; margin-right: 5px;
}
.btn-edit { background-color: var(--soft-blue-bg); color: var(--primary-blue); }
.btn-edit:hover { background-color: #d6eaf8; }
.btn-delete { background-color: #fdedec; color: #e74c3c; }
.btn-delete:hover { background-color: #fadbd8; }

/* ==========================================================================
   7. Listeleme Araçları (Arama, Sayfalama, Rozetler)
   ========================================================================== */
.search-bar-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.search-form { display: flex; gap: 10px; align-items: center; }
.search-input { width: 300px; padding: 10px 15px; border: 1px solid var(--border-color); border-radius: var(--border-radius); font-size: 14px; }
.search-input:focus { outline: none; border-color: var(--primary-blue); }
.btn-search { background-color: var(--text-dark); color: #fff; border: none; padding: 10px 15px; border-radius: var(--border-radius); font-weight: 600; }

.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.page-link {
    display: inline-flex; align-items: center; justify-content: center; min-width: 35px; height: 35px;
    border: 1px solid var(--border-color); background: #fff; border-radius: 4px; font-weight: 500;
}
.page-link:hover { background: var(--soft-blue-bg); color: var(--primary-blue); border-color: var(--primary-blue); }
.page-link.active { background: var(--primary-blue); color: #fff; border-color: var(--primary-blue); }

.badge { padding: 5px 10px; border-radius: 4px; font-size: 12px; font-weight: bold; }
.badge-success { background: var(--soft-green-bg); color: #27ae60; }
.badge-warning { background: #fef5e7; color: #d35400; }
.badge-danger { background: #fdedec; color: #e74c3c; }
.badge-gray { background: #f4f6f9; color: var(--text-muted); }

/* ==========================================================================
   8. Dashboard İstatistik ve Zaman Çizelgesi (Anasayfa Özel)
   ========================================================================== */
.amount-large { font-size: 32px; font-weight: 700; margin-bottom: 4px; }
.amount-large small { font-size: 18px; color: var(--text-muted); }
.amount-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }

.list-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border-color); font-size: 14px; }
.list-row:last-child { border-bottom: none; }
.list-row-label { color: var(--text-muted); }
.list-row-value { font-weight: 600; }

/* e-Belge Kutucukları */
.stats-boxes { display: flex; gap: 15px; margin-bottom: 20px; }
.stat-box { flex: 1; padding: 16px; border-radius: var(--border-radius); }
.stat-box.green { background-color: var(--soft-green-bg); }
.stat-box.blue { background-color: var(--soft-blue-bg); }
.stat-label { font-weight: 600; margin-bottom: 8px; font-size: 13px; }
.stat-box.green .stat-label { color: var(--soft-green-text); }
.stat-box.blue .stat-label { color: var(--soft-blue-text); }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-box.green .stat-value { color: #1e8449; }
.stat-box.blue .stat-value { color: #1f618d; }
.stat-unit { font-size: 12px; font-weight: 500; }

.sub-stats { display: flex; border-top: 1px solid var(--border-color); padding-top: 15px; }
.sub-stat-item { flex: 1; }
.sub-stat-title { color: var(--text-muted); font-size: 13px; margin-bottom: 4px; }
.sub-stat-number { font-size: 15px; font-weight: 600; }

/* Zaman Çizelgesi (Geciken İşlemler) */
.timeline-date { font-size: 13px; font-weight: 600; color: var(--text-dark); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.timeline-item { position: relative; padding-left: 20px; margin-bottom: 20px; }
.timeline-item::before {
    content: ''; position: absolute; left: 0; top: 6px; width: 8px; height: 8px;
    background-color: var(--border-color); border-radius: 50%;
}
.timeline-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.timeline-desc { color: var(--text-muted); font-size: 13px; }

/* ==========================================================================
   9. Fatura Ekleme Özel Stiller (Kalemler, Toplamlar, Autocomplete)
   ========================================================================== */
.table-inputs input, .table-inputs select {
    width: 100%; padding: 8px; border: 1px solid var(--border-color); border-radius: 4px; font-size: 13px; margin-bottom: 5px;
}
.table-inputs input:focus, .table-inputs select:focus { border-color: var(--primary-blue); }

.totals-box { background: #f9fafb; padding: 20px; border-radius: var(--border-radius); border: 1px solid var(--border-color); }
.totals-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; }
.totals-row.grand-total { font-size: 18px; font-weight: 700; border-top: 1px solid var(--border-color); padding-top: 10px; margin-top: 10px; }

.autocomplete-items {
    position: absolute; border: 1px solid var(--border-color); border-top: none; z-index: 99;
    top: 100%; left: 0; right: 0; background-color: #fff; max-height: 150px; overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); border-radius: 0 0 4px 4px;
}
.autocomplete-items div { padding: 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #eee; }
.autocomplete-items div:hover { background-color: var(--soft-blue-bg); }

.btn-toggle-desc {
    background: var(--soft-blue-bg); color: var(--primary-blue); border: 1px solid var(--border-color);
    border-radius: 4px; cursor: pointer; padding: 0 12px; font-weight: bold; font-size: 16px; height: 35px;
}
.btn-toggle-desc:hover { background: #d6eaf8; }

/* ==========================================================================
   10. Responsive Ayarları (Mobil Uyum)
   ========================================================================== */
@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .card-right-sidebar { grid-row: auto; grid-column: span 2; }
}
@media (max-width: 768px) {
    .dashboard-grid, .form-grid { grid-template-columns: 1fr; }
    .card-right-sidebar, .form-group.full-width { grid-column: span 1; }
    .sidebar { position: absolute; left: -250px; }
}