:root {
    --primary-color: #3b5998;
    --secondary-color: #4a6a9a;
    --accent-color: #e67e22; /* Usta turuncusu! */
    --success-color: #27ae60;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --bg-color: #eef2f5;
    --text-color: #2c3e50;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Responsive tablo sarmalayıcı */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1px; /* collapse margin koruma */
}
.table-responsive table { min-width: 500px; }
@media (max-width: 480px) {
    .table-responsive table { min-width: 400px; }
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #2c3e50 0%, #4a6a9a 100%);
    color: white;
    padding: 0.9rem 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.navbar .container { display: flex; justify-content: space-between; align-items: center; }

.brand { font-size: 1.5rem; font-weight: bold; color: white; text-decoration: none; }

.nav-links { list-style: none; display: flex; gap: 20px; align-items: center; }

.nav-links a { color: #bdc3c7; text-decoration: none; transition: 0.3s; font-size: 0.95rem; padding: 6px 12px; border-radius: 4px; }
.nav-links a:hover, .nav-links a.active { color: white; background: rgba(255,255,255,0.1); }

.btn-new { 
    background-color: var(--accent-color); 
    color: white !important; 
    padding: 8px 16px; 
    border-radius: 5px; 
}

/* Main Content */
.content { padding: 40px 0; min-height: calc(100vh - 160px); }

.welcome-section { margin-bottom: 30px; text-align: center; }
.welcome-section h1 { color: var(--primary-color); font-size: 2rem; margin-bottom: 10px; }
.welcome-section p { color: #7f8c8d; }

/* Cards & Tables */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 25px;
}

.table-card { padding: 0; overflow: hidden; }

.data-table { width: 100%; border-collapse: collapse; text-align: left; }

.data-table th {
    background-color: #ecf0f1;
    padding: 15px;
    font-weight: 600;
    color: var(--secondary-color);
}

.data-table td { padding: 15px; border-bottom: 1px solid #eee; }

/* Row styling based on status */
.row-beklemede { border-left: 5px solid var(--warning-color); }
.row-tamirde { border-left: 5px solid var(--accent-color); }
.row-teslim-edildi { border-left: 5px solid var(--success-color); opacity: 0.8; }

/* Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.badge-beklemede { background: #fef9e7; color: #f39c12; }
.badge-tamirde { background: #fdf2e9; color: #e67e22; }
.badge-teslim-edildi { background: #eafaf1; color: #27ae60; }
.badge-parca-bekliyor { background: #fdedec; color: #e74c3c; }

/* Info Blocks in Table */
.customer-info { display: flex; flex-direction: column; }
.customer-info .name { font-weight: 600; }
.customer-info .phone { font-size: 0.85rem; color: #7f8c8d; }

.device-info { display: flex; flex-direction: column; }
.device-info .model { font-weight: 600; }
.device-info .type { font-size: 0.8rem; color: #95a5a6; text-transform: uppercase; }

.btn-detail { color: var(--primary-color); font-size: 1.2rem; }

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full-width { grid-column: 1 / -1; }

label { font-weight: 600; font-size: 0.9rem; color: var(--secondary-color); }

input, select, textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(230, 126, 34, 0.2);
}

.form-actions { margin-top: 30px; text-align: right; }
.btn-submit {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}
.btn-submit:hover { background-color: #219150; }

/* Footer */
.footer {
    background: var(--primary-color);
    color: #bdc3c7;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* ============================================
   KARŞILAMA SAYFASI - HERO & STATS
   ============================================ */

.welcome-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-align: center;
    padding: 60px 20px;
    border-radius: 12px;
    margin-bottom: 35px;
    box-shadow: var(--card-shadow);
}

.hero-content h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    color: white;
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.hero-location {
    font-size: 1rem;
    opacity: 0.7;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-3px); }

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.stat-total .stat-icon { background: #eaf2f8; color: var(--primary-color); }
.stat-waiting .stat-icon { background: #fef9e7; color: #f39c12; }
.stat-repairing .stat-icon { background: #fdf2e9; color: #e67e22; }
.stat-parts .stat-icon { background: #fdedec; color: #e74c3c; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.action-new {
    background: var(--success-color);
    color: white;
}

.action-new:hover { background: #219150; }

.action-list {
    background: var(--primary-color);
    color: white;
}

.action-list:hover { background: var(--secondary-color); }

/* ============================================
   SON EKLENENLER - KART LİSTESİ
   ============================================ */

.recent-section h2 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.cards-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ariza-card {
    background: white;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ariza-card:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.12); }

.status-beklemede { border-left: 5px solid var(--warning-color); }
.status-tamirde { border-left: 5px solid var(--accent-color); }
.status-parca-bekliyor { border-left: 5px solid var(--danger-color); }
.status-teslim-edildi { border-left: 5px solid var(--success-color); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.card-id { font-weight: bold; color: var(--primary-color); }

.card-body {
    padding: 18px 20px;
}

.card-body h3 {
    margin-bottom: 6px;
    color: var(--secondary-color);
}

.device-name { font-weight: 500; margin-bottom: 8px; }
.complaint { font-size: 0.9rem; color: #7f8c8d; }

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.date-stamp { font-size: 0.85rem; color: #95a5a6; }

.btn-detail-small {
    padding: 6px 14px;
    background: var(--primary-color);
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85rem;
}

.btn-detail-small:hover { background: var(--secondary-color); }

.btn-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-fis-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--success-color);
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
}

.btn-fis-small:hover {
    background: #27ae60;
    transform: scale(1.08);
}

.btn-print-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #e67e22;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
}

.btn-print-small:hover {
    background: #d35400;
    transform: scale(1.08);
}

/* ============================================
   TÜM KAYITLAR - DİKEY KART LİSTESİ
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 { color: var(--primary-color); font-size: 1.8rem; }

.btn-new-float {
    padding: 12px 24px;
    background: var(--success-color);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
}

.btn-new-float:hover { background: #219150; }

.cards-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ariza-card-full {
    background: white;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ariza-card-full:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.13); }

.card-left-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}

.status-beklemede .card-left-bar { background: var(--warning-color); }
.status-tamirde .card-left-bar { background: var(--accent-color); }
.status-parca-bekliyor .card-left-bar { background: var(--danger-color); }
.status-teslim-edildi .card-left-bar { background: var(--success-color); }

.card-main {
    padding: 25px;
}

.card-top-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.card-id-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.card-date { margin-left: auto; font-size: 0.85rem; color: #95a5a6; }

.card-content-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 18px;
}

.customer-block h3 { font-size: 1.2rem; color: var(--secondary-color); margin-bottom: 4px; }
.phone { font-size: 0.9rem; color: #7f8c8d; }

.device-block h4 { font-size: 1.05rem; margin-bottom: 6px; }

.type-tag {
    display: inline-block;
    background: #ecf0f1;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-transform: uppercase;
}

.serial { font-size: 0.85rem; color: #95a5a6; margin-top: 4px; }

.complaint-block {
    background: #fef9e7;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.complaint-block strong { color: #f39c12; }

.card-action-btn {
    display: block;
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-top: 1px solid #eee;
    transition: 0.2s;
}

.card-action-btn:hover { background: #ecf0f1; }

/* Düzenle butonu */
.card-action-btn.btn-edit {
    color: var(--accent-color);
}
.card-action-btn.btn-edit:hover {
    background: #fdf2e9;
}

/* Sil butonu */
.card-action-btn.btn-delete {
    color: var(--danger-color);
}
.card-action-btn.btn-delete:hover {
    background: #fdedec;
}

/* Detay sayfası düzenle/sil butonları */
.action-edit {
    background: var(--accent-color);
    color: white;
}
.action-edit:hover { background: #d35400; }

.action-delete {
    background: var(--danger-color);
    color: white;
}
.action-delete:hover { background: #c0392b; }

/* Arama Çubuğu */
.search-bar {
    margin-bottom: 25px;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap input[type="text"] {
    width: 100%;
    padding: 14px 45px 14px 45px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.05rem;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-wrap input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(230, 126, 34, 0.25);
}

.search-icon {
    position: absolute;
    left: 16px;
    color: #95a5a6;
    font-size: 1rem;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 14px;
    color: #95a5a6;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: none;
}

.search-clear:hover {
    color: var(--danger-color);
}

.search-info {
    margin-bottom: 15px;
    padding: 10px 16px;
    background: #eaf2f8;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--secondary-color);
}

/* Arama Çubuğu */
.search-bar {
    margin-bottom: 25px;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap input[type="text"] {
    width: 100%;
    padding: 14px 45px 14px 45px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.05rem;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-wrap input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(230, 126, 34, 0.25);
}

.search-icon {
    position: absolute;
    left: 16px;
    color: #95a5a6;
    font-size: 1rem;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 14px;
    color: #95a5a6;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: none;
}

.search-clear:hover {
    color: var(--danger-color);
}

.search-info {
    margin-bottom: 15px;
    padding: 10px 16px;
    background: #eaf2f8;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--secondary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state i { font-size: 4rem; color: #bdc3c7; margin-bottom: 20px; }
.empty-state h2 { color: var(--primary-color); margin-bottom: 10px; }
.empty-state p { color: #7f8c8d; margin-bottom: 25px; }

/* ============================================
   MOBİL UYUMLULUK
   ============================================ */

/* Telefon - 768px altı */
@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .content { padding: 16px 0; }
    
    /* Navbar */
    .navbar .container { flex-direction: column; gap: 6px; padding: 8px 12px; }
    .brand { font-size: 1.05rem; }
    .nav-links { flex-wrap: wrap; gap: 3px; justify-content: center; }
    .nav-links a { font-size: 0.72rem; padding: 4px 7px; }
    .nav-links .btn-new { padding: 4px 9px; font-size: 0.72rem; }
    
    /* Form elemanları */
    .form-grid { grid-template-columns: 1fr; }
    .form-actions { text-align: center; }
    .form-actions .btn-submit { width: 100%; }
    
    /* Tablolar - yatay kaydırılabilir */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-responsive table { min-width: 600px; }
    .data-table { font-size: 0.78rem; }
    .data-table th, .data-table td { padding: 6px 5px; }
    
    /* Muhasebe tablosu */
    .hareket-tablo { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .hareket-tablo table { min-width: 500px; }
    
    /* Stats grid - 2 sütun */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px 14px; gap: 10px; }
    .stat-icon { font-size: 1.3rem; width: 36px; height: 36px; }
    .stat-number { font-size: 1.2rem; }
    .stat-label { font-size: 0.68rem; }
    
    /* Stat kartları tam genişlik */
    .quick-actions { flex-direction: column; align-items: stretch; }
    .quick-actions .action-btn { justify-content: center; padding: 11px 16px; font-size: 0.85rem; }
    .export-group { justify-content: center; }
    
    /* Hero */
    .welcome-hero { padding: 20px 14px !important; }
    .welcome-hero img[alt*="TEKNİK"] { width: 50px !important; height: 50px !important; }
    .hero-content h1 { font-size: 1.3rem; }
    .hero-subtitle { font-size: 0.9rem !important; }
    
    /* Page header */
    .page-header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .page-header h1 { font-size: 1.1rem; }
    .page-header .action-btn, .page-header .btn-new-float { width: 100%; text-align: center; }
    
    /* Kartlar */
    .card { padding: 14px; }
    .card-content-row { grid-template-columns: 1fr !important; }
    .detail-grid { grid-template-columns: 1fr; gap: 10px; }
    
    /* Kart yapısı */
    .card-body { padding: 10px 12px; }
    .card-header { padding: 8px 12px; flex-wrap: wrap; gap: 4px; }
    .card-footer { flex-direction: column; gap: 6px; padding: 8px 12px; }
    .card-top-row { flex-wrap: wrap; gap: 8px; }
    .card-date { margin-left: 0 !important; }
    
    /* Arama */
    .search-input-wrap input[type="text"] { padding: 10px 35px 10px 35px; font-size: 0.9rem; }
    
    /* Buton grupları */
    .btn-group { flex-wrap: wrap; gap: 4px; }
    
    /* Müşteri profili */
    .profile-top { flex-direction: column; align-items: center; text-align: center; }
    .profile-contact { justify-content: center; flex-wrap: wrap; }
    .profile-vergi { justify-content: center; flex-wrap: wrap; }
    .profile-avatar i { font-size: 3rem; }
    
    /* Tablolar */
    table { font-size: 0.78rem; }
    table td, table th { padding: 5px 6px !important; }
    
    /* Empty state */
    .empty-state { padding: 30px 14px; }
    .empty-state i { font-size: 2.2rem; }
    .empty-state h2 { font-size: 1.1rem; }
    
    /* Detay sayfası - buton satırı */
    .detail-btn-row { flex-direction: column; gap: 6px; }
    .detail-btn-row .action-btn { width: 100%; text-align: center; justify-content: center; }
    
    /* Durum butonları - detay sayfası */
    .durum-btn-row { flex-direction: column; gap: 4px; }
    .durum-btn-row .durum-btn { width: 100%; text-align: center; }
    
    /* Resim grid */
    .resim-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important; gap: 8px !important; }
    .resim-grid img { height: 90px !important; }
    
    /* Fatura detay sayfası - tablo */
    .fatura-detay-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .fatura-detay-table table { min-width: 350px; }
    
    /* Tedarikçi detay sayfası */
    .gider-tablo { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .gider-tablo table { min-width: 400px; }
    
    /* İş takibi - filtreler */
    .is-filtre-row { gap: 4px; }
    .is-filtre-row .btn-filtre { font-size: 0.75rem; padding: 5px 10px; }
    
    /* Kasa kartları - ana sayfa */
    .kasa-grid { grid-template-columns: 1fr !important; }
    
    /* Modal */
    .modal-content { width: 95% !important; max-height: 85vh !important; padding: 16px !important; }
    
    /* Hızlı aksiyon grid - sadece simge + tooltip */
    .aksiyon-grid { grid-template-columns: 1fr 1fr !important; gap: 6px !important; }
    .aksiyon-grid .action-btn { 
        padding: 12px 8px !important; 
        font-size: 0 !important; 
        justify-content: center !important;
        min-height: 44px;
    }
    .aksiyon-grid .action-btn i { 
        font-size: 1.3rem !important; 
        margin: 0 !important;
    }
    .aksiyon-grid .action-btn[title]:before {
        font-size: 0.7rem;
        display: none;
    }
    
    /* Müşteri listesindeki info alanı */
    .musteri-card-info { gap: 6px !important; font-size: 0.78rem !important; }
}

/* Küçük telefon - 400px altı */
@media (max-width: 400px) {
    .nav-links a { font-size: 0.6rem; padding: 3px 5px; }
    .nav-links .btn-new { font-size: 0.6rem; padding: 3px 7px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 5px; }
    .stat-card { padding: 8px 10px; }
    .stat-number { font-size: 1rem; }
    .stat-icon { font-size: 1.1rem; width: 30px; height: 30px; }
    .stat-label { font-size: 0.62rem; }
    .action-btn { padding: 9px 12px; font-size: 0.78rem; }
    .card { padding: 10px; }
    .hero-content h1 { font-size: 1.1rem; }
    .brand { font-size: 0.95rem; }
    
    /* Çok küçük ekranda butonlar */
    .btn-fis-small, .btn-print-small { width: 28px; height: 28px; font-size: 0.75rem; }
    .btn-detail-small { padding: 4px 10px; font-size: 0.75rem; }
    
    /* Tablo hücreleri */
    table td, table th { padding: 4px 4px !important; }
    
    /* Hızlı aksiyon grid - 400px altı tek sütun */
    .aksiyon-grid { grid-template-columns: 1fr !important; }
    .aksiyon-grid .action-btn { min-height: 40px; }
}

/* ============================================
   ACTION BUTTONS - RENKLİ
   ============================================ */

.action-excel {
    background: #217346 !important;
    color: white !important;
}
.action-excel:hover {
    background: #1a5e38 !important;
}

.action-pdf {
    background: #c0392b !important;
    color: white !important;
}
.action-pdf:hover {
    background: #a93226 !important;
}

/* ============================================
   EXPORT GROUP - inline
   ============================================ */

.export-group {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}