/* ==========================================================================
   1. GENEL SAYFA VE YERLEŞİM
   ========================================================================== */
body {
    background-color: #f8f9fa; /* Diğer özel stiller buraya eklenebilir */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.totals-table th {
    text-align: left;
    font-weight: 500;
}

.totals-table td {
    text-align: right;
    font-weight: 500;
}

.totals-table .total-row th,
.totals-table .total-row td {
    font-weight: bold;
    font-size: 1.1rem;
    color: #dc3545;
}

.main-content .card .card-header h5 {
    font-size: 1rem;
    font-weight: 600;
}

/* Satis Ekle Sayfası Stilleri */
.sales-page-header {
    background: linear-gradient(to right, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sales-page-header h3 {
    margin: 0;
    font-weight: 600;
}

.sales-page-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.sales-page-card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.sales-page-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    margin-bottom: 0;
    padding: 0.75rem 1.25rem 0.3rem 1.25rem;
}

.sales-page-card .card-header.d-flex {
    padding: 0.75rem 1.25rem 0.3rem 1.25rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 1.07rem;
    letter-spacing: 0.01em;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}

.sales-page-card h5 {
    font-weight: 600;
    color: #343a40;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0d6efd;
    display: inline-block;
}

/* ==========================================================================
   2. YAN MENÜ (SIDEBAR) VE ANA İÇERİK
   ========================================================================== */
.sidebar {
    width: 280px;
    min-height: 100vh;
    background-color: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1030;
    transition: left 0.3s ease-in-out;
}

.sidebar.collapsed {
    left: -280px;
}

.main-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
}

.sidebar.collapsed + .main-content {
    margin-left: 0;
    width: 100%;
}

/* Sidebar İçeriği */
.sidebar .nav-link {
    color: #495057;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 5px;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background-color: #e9ecef;
    color: #0d6efd;
}

.sidebar .nav-link .bi {
    margin-right: 10px;
}

/* ==========================================================================
   3. ÜST BAR (TOP BAR)
   ========================================================================== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.user-info .dropdown-toggle::after {
    display: none;
}

/* ==========================================================================
   4. MÜŞTERİ BAŞLIĞI
   ========================================================================== */
.customer-header a {
    color: #6c757d;
    text-decoration: none;
    font-size: 1rem;
}
.customer-header a:hover {
    color: #343a40;
}
.note-link {
    font-size: 0.9rem;
}

/* ==========================================================================
   4. MÜŞTERİ PROFİL BAŞLIĞI
   ========================================================================== */
.customer-profile-header {
    /* BizimHesap stili: daha açık bej, ahşap doku görünür */
    background-color: #f0e2c5;
    background-image:
        linear-gradient(rgba(255,255,255,0.18), rgba(255,255,255,0.18)),
        url('https://www.transparenttextures.com/patterns/light-wood.png');
    background-repeat: repeat;
    background-position: center;
    border: 1px solid #e1cfab;
    border-radius: 12px;
    padding: 14px 20px;
    display: inline-flex; /* içeriğe göre daralsın */
    width: auto;
    max-width: 820px; /* telefon/adres için alan */
    align-items: center;
    box-shadow: 0 8px 18px rgba(0,0,0,0.14);
    overflow: hidden; /* radius dokuyu düzgün kessin */
}

.customer-profile-header .profile-picture {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.customer-profile-header .profile-picture .bi-person-fill {
    font-size: 4rem;
    color: #adb5bd;
}

.customer-profile-header .profile-name h2 {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 800;
    color: #a56f39; /* bir ton daha açık kehribar */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* Müşteri başlığı + not balonu sarmalayıcı */
.customer-header-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap; /* masaüstünde aynı satır */
}
.customer-header-wrap .note-bubble {
  align-self: center;
}

/* Responsive: küçük ekranlarda panel tam genişlik olsun */
@media (max-width: 576px) {
  .customer-profile-header {
    display: flex;
    max-width: 100%;
    width: 100%;
  }
  .customer-profile-header .profile-picture { width: 64px; height: 64px; }
  .customer-profile-header .profile-name h2 { font-size: 1.6rem; }
  .customer-header-wrap { flex-wrap: wrap; align-items: flex-start; }
  .customer-header-wrap .note-bubble { width: 100%; max-width: 100%; justify-content: center; }
}

/* ==========================================================================
   5. BİLGİ PANELLERİ
   ========================================================================== */
.states-info .panel {
    color: #fff;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.states-info .panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.16);
}
.states-info .panel-body {
    padding: 16px 18px;
}
/* Brand-like pleasant colors with subtle gradient */
.states-info .red-bg {
    background: linear-gradient(180deg, #f27d6b 0%, #ec6a58 100%);
}
.states-info .blue-bg {
    background: linear-gradient(180deg, #6bb8f0 0%, #58a6e6 100%);
}
.states-info .green-bg {
    background: linear-gradient(180deg, #6bd1a8 0%, #4fc497 100%);
}

.states-info .panel i { font-size: 2.2rem; opacity: 0.9; }

.states-info .state-title {
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
}
.states-info h4 { font-size: 1.55rem; font-weight: 800; margin: 2px 0; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.states-info h4 a {
    color: white;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.states-info h4 a:hover { opacity: 1; }
.states-info h4 .bi-arrow-right-circle { font-size: 1.1rem; }
.states-info small { color: rgba(255,255,255,0.9); font-size: 0.85rem; }

/* ==========================================================================
   6. AKSİYON LİNKLERİ
   ========================================================================== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    color: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-action-dark-gray { background-color: #495057; }
.btn-action-orange { background-color: #fdab3d; }
.btn-action-green { background-color: #4caf50; }
.btn-action-teal { background-color: #20c997; }
.btn-action-light { background-color: #f8f9fa; color: #343a40 !important; border: 1px solid #dee2e6; }
.btn-action-purple { background-color: #6f42c1; }
.btn-action-red { background-color: #dc3545; }

/* ==========================================================================
   7. VERİ KARTLARI VE TABLOLAR
   ========================================================================== */

.data-cards-row {
    display: flex;
    flex-direction: row;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}
.data-card {
    min-width: 440px;
    max-width: 100%;
    flex: 1 1 0%;
    scroll-snap-align: start;
    margin-bottom: 0;
}

@media (min-width: 992px) {
    .col-lg-7 .data-card, .col-lg-5 .data-card {
        min-width: 100%;
        max-width: 100%;
    }
}

.data-card .table-responsive {
    min-width: 420px;
}

@media (min-width: 768px) {
    .data-card .table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #f8f9fa;
        box-shadow: 0 1px 0 #e9ecef;
    }
}


.data-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    background-color: #fff;
}

.data-card .table {
    margin-bottom: 0;
}

/* Tabloyu içten kaydırmalı ve yüksekliği sınırlı yap */
.data-card .table-responsive {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #bdbdbd #f5f5f5;
}
.data-card .table-responsive::-webkit-scrollbar {
    width: 7px;
    background: #f5f5f5;
}
.data-card .table-responsive::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 6px;
}

/* İşlem sütunu için dikey bar */
.table-actions-bar {
    width: 4px;
    min-width: 4px;
    background: linear-gradient(to bottom, #e0e0e0 60%, #bdbdbd 100%);
    border-radius: 2px;
    margin-right: 8px;
    height: 28px;
    display: inline-block;
    vertical-align: middle;
}

.data-card .table tbody tr:hover {
    background-color: #f8f9fa;
}

.data-card .table td, .data-card .table th {
    vertical-align: middle;
    padding: 1rem 1.25rem;
    border-top: 1px solid #f1f1f1;
}

.data-card .table thead {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.data-card .table thead th {
    border-bottom: 2px solid #dee2e6;
    font-size: 0.9rem;
    color: #495057;
}

.data-card .table tbody tr:last-child td {
    border-bottom: none;
}

.data-card .table tbody td {
    vertical-align: middle;
}

.data-card .table .text-success {
    color: #28a745 !important;
    color: #27ae60;
    font-size: 1.2rem;
    cursor: pointer;
}

/* ==========================================================================
   8. MOBİL UYUMLULUK (RESPONSIVE)
   ========================================================================== */
@media (max-width: 992px) {
    .sidebar {
        left: -280px; /* Tablet ve altında menü başlangıçta gizli */
    }
    .sidebar.collapsed {
        left: 0; /* Butona basınca göster */
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    #menu-toggle {
        display: block !important; /* Butonu her zaman göster */
    }
}

.data-card .table thead th {
    border-bottom: 2px solid #dee2e6;
    font-size: 0.9rem;
    color: #495057;
}

.data-card .table tbody tr:last-child td {
    border-bottom: none;
}

.data-card .table tbody td {
    vertical-align: middle;
}

.data-card .table .text-success {
    color: #28a745 !important;
}

body {
    background: #f7f7f7;
    font-family: 'Segoe UI', Arial, sans-serif;
}
.table-responsive {
    margin-top: 20px;
}
.btn-primary, .btn-success, .btn-danger {
    border-radius: 25px;
    padding: 8px 22px;
    font-weight: 600;
}
.modal-content {
    border-radius: 18px;
}
@media (max-width: 576px) {
    .table {
        font-size: 13px;
    }
    .btn {
        font-size: 14px;
    }
}

/* ==========================================================================
   9. ÇÖKEBİLİR KART BAŞLIKLARI VE NOT BALONU
   ========================================================================== */
/* Kart başlıklarını tıklanabilir yap ve hover durumunu belirt */
.card-header.collapsible {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease-in-out;
}
.card-header.collapsible:hover {
    background-color: #f1f3f5;
}
/* Chevron ikonunu döndür (Bootstrap collapse, toggler'a .collapsed sınıfını ekler) */
.card-header.collapsible .bi {
    transition: transform 0.2s ease;
}
.card-header.collapsible.collapsed .bi {
    transform: rotate(-90deg);
}

/* Not balonu bileşeni — konuşma balonu stili (1. görsel) */
.note-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  background: #f7fbd3; /* soluk sarı */
  color: #495057;
  text-decoration: none;
  font-size: 0.95rem;
  border: 4px solid #6c757d; /* kalın gri çerçeve */
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  max-width: 600px;
  white-space: normal; /* çok satır destekle */
  line-height: 1.35;
}
.note-bubble .bi { color: #6c757d; }
.note-bubble:hover {
  background: #f2f8c5;
  color: #343a40;
  border-color: #5c6770;
}
/* Balon kuyruğu (sola bakan) */
.note-bubble::after {
  content: "";
  position: absolute;
  left: -16px; /* dış gri sınır */
  top: 20px;
  border-width: 10px 16px 10px 0;
  border-style: solid;
  border-color: transparent #6c757d transparent transparent;
}
.note-bubble::before {
  content: "";
  position: absolute;
  left: -12px; /* iç dolgu rengi */
  top: 22px;
  border-width: 8px 14px 8px 0;
  border-style: solid;
  border-color: transparent #f7fbd3 transparent transparent;
}

/* Not mevcutsa görsel vurgu */
.note-bubble.has-note {
  background: #fffecf;
  color: #198754; /* yeşil */
  border-color: #6c757d;
}
.note-bubble.has-note .bi { color: #198754; }
