@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* =======================================================
   1. SİBER-ENDÜSTRİYEL RENK PALETİ (SİYAH, TURUNCU, TURKUAZ)
   ======================================================= */
:root { 
    --orange: #ff6a00;            /* Koyu Canlı Turuncu */
    --orange-glow: rgba(255, 106, 0, 0.4);
    --orange-dark: #cc5200;
    
    --turquoise: #00d2ff;         /* Türk Turkuazı / Neon Camgöbeği */
    --turquoise-glow: rgba(0, 210, 255, 0.4);
    
    --bg-dark: #050505;           /* Mat Derin Siyah */
    --bg-panel: #0a0a0a;          /* Panel Siyahı */
    
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(0, 210, 255, 0.15); /* Turkuaz yansımalı cam kenarlık */
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* Tüm Elemanlar İçin Standart Sıfırlama */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

/* Özelleştirilmiş Akıcı Kaydırma Çubuğu */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #1a1a1a; border-radius: 4px; border: 1px solid rgba(0,210,255,0.2); }
::-webkit-scrollbar-thumb:hover { background: var(--turquoise); box-shadow: 0 0 10px var(--turquoise-glow); }

/* =======================================================
   2. MASKE GÖVDE (VİTRİN VE PANEL GÜVENLİK DUVARI)
   ======================================================= */
body { 
    background: var(--bg-dark); 
    background-image: radial-gradient(circle at 50% 0%, rgba(0, 210, 255, 0.05) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-main); 
    font-family: 'Inter', sans-serif; 
    margin: 0;
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ANA SİTE VE LOGİN EKRANLARINI KORUYAN ESNEK YAPI (Çakışmayı Önler) */
.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 20px; }
.full-page-center { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }

/* PANEL SAYFALARINA ÖZEL KİLİT (Sadece Sol Menü Varsa Aktif Olur) */
@media (min-width: 993px) {
    body:has(.sidebar) {
        display: flex !important;
        height: 100vh !important;
        overflow: hidden !important;
        padding-top: 75px !important;
    }
    body:has(.sidebar) .main-content {
        flex: 1 !important;
        height: calc(100vh - 75px) !important;
        overflow-y: auto !important;
        padding: 30px !important;
    }
}

/* =======================================================
   3. ÜST HEADER BAR (ÜST MENÜ)
   ======================================================= */
.main-header { 
    position: fixed; top: 0; left: 0; right: 0; z-index: 2000; 
    background: rgba(5, 5, 5, 0.85); 
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border); 
}
.main-header .container, .main-header .container-fluid { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 15px 30px; max-width: 100%; margin: 0;
}
.logo h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.5px; margin: 0; color: #fff; text-transform: uppercase; }
.logo span { color: var(--turquoise); text-shadow: 0 0 12px var(--turquoise-glow); }
.main-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.main-nav a { 
    color: var(--danger); font-weight: 600; text-decoration: none; 
    transition: 0.3s; padding: 8px 16px; border-radius: 8px; display: inline-flex; align-items: center; gap: 8px;
}
.main-nav a:hover { background: rgba(239, 68, 68, 0.08); text-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }

/* =======================================================
   4. SOL YAN PANAL MENÜ (SIDEBAR)
   ======================================================= */
.sidebar { 
    width: 260px; background: var(--bg-panel); 
    border-right: 1px solid var(--glass-border); 
    display: flex; flex-direction: column; flex-shrink: 0; z-index: 100; 
    transition: transform 0.3s ease;
}
.sidebar-logo { padding: 25px; border-bottom: 1px solid var(--glass-border); text-align: center; }
.sidebar-logo h1 { margin: 0; font-size: 2rem; color: #fff; font-weight: 800; }
.sidebar-logo span { color: var(--turquoise); }
.sidebar-menu { list-style: none; padding: 15px 10px; margin: 0; overflow-y: auto; flex: 1; }
.sidebar-menu li { margin-bottom: 5px; }
.sidebar-menu li a { 
    display: flex; align-items: center; gap: 14px; padding: 12px 18px; 
    color: var(--text-muted); text-decoration: none; border-radius: 10px; 
    transition: all 0.25s ease; font-weight: 500; font-size: 0.95rem;
}
.sidebar-menu li a:hover { background: rgba(0, 210, 255, 0.05); color: #fff; transform: translateX(5px); }
.sidebar-menu li a.active { 
    background: linear-gradient(90deg, rgba(0, 210, 255, 0.15) 0%, rgba(0, 210, 255, 0) 100%);
    color: #fff; border-left: 3px solid var(--turquoise); font-weight: 600;
}
.sidebar-menu li a i { font-size: 1.1rem; width: 22px; text-align: center; color: var(--orange); }

/* =======================================================
   5. BİLİMSEL ULTRA-MODERN KART TASARIMLARI
   ======================================================= */
.main-content { padding: 20px; width: 100%; transition: all 0.3s; }

.card, .mes-card, .login-box { 
    background: var(--glass-bg); 
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 25px; border-radius: 16px; border: 1px solid var(--glass-border); 
    margin-bottom: 25px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative; overflow: hidden; width: 100%;
}
/* Çift Renkli Üst Çizgi Efekti (Turuncu'dan Turkuaza Geçiş) */
.card::before, .mes-card::before, .login-box::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--orange), var(--turquoise)); opacity: 0.8;
}

/* Ana Sayfa Modül Grid Yapısı */
.module-grid { 
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 25px; width: 100%; max-width: 1100px; margin: 20px auto;
}
.module-btn { 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    aspect-ratio: 1; border-radius: 20px; background: var(--glass-bg); 
    border: 1px solid var(--glass-border); text-decoration: none; color: var(--text-muted); 
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.module-btn i { font-size: 3.5rem; margin-bottom: 15px; color: #fff; transition: 0.3s; text-shadow: 0 0 10px rgba(255,255,255,0.1); }
.module-btn span { font-weight: 700; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.5px; text-align: center; padding: 0 10px;}
.module-btn:hover { 
    transform: translateY(-8px); border-color: var(--orange); 
    box-shadow: 0 12px 35px var(--orange-glow); color: #fff; 
}
.module-btn:hover i { color: var(--orange); transform: scale(1.1); text-shadow: 0 0 15px var(--orange-glow); }

/* =======================================================
   6. YÜKSEK KAPASİTELİ ENDÜSTRİYEL TABLOLAR
   ======================================================= */
.table-container { 
    background: var(--glass-bg); backdrop-filter: blur(12px); border-radius: 16px; 
    border: 1px solid var(--glass-border); margin-bottom: 25px; overflow-x: auto; overflow-y: auto; 
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); width: 100%;
}
.inventory-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.inventory-table th { 
    background: #0d0d0d; padding: 18px 16px; text-align: left; 
    color: var(--turquoise); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; 
    letter-spacing: 0.75px; border-bottom: 2px solid var(--glass-border); 
    position: sticky; top: 0; z-index: 10; 
}
.inventory-table td { padding: 16px; border-bottom: 1px solid rgba(0, 210, 255, 0.05); vertical-align: middle; transition: 0.2s; white-space: nowrap; }
.inventory-table tbody tr:hover td { background: rgba(0, 210, 255, 0.03); }

/* Link Renkleri */
.product-link, .stok-kodu-link { color: var(--turquoise); text-decoration: none; font-weight: bold; cursor: pointer; transition: 0.2s; border-bottom: 1px dashed transparent; }
.product-link:hover, .stok-kodu-link:hover { color: var(--orange); text-shadow: 0 0 8px var(--orange-glow); border-bottom-color: var(--orange); }

/* =======================================================
   7. GELİŞMİŞ FORMLAR VE SİBER BUTONLAR
   ======================================================= */
.search-bar, .form-control { 
    width: 100%; padding: 14px 18px; margin-bottom: 15px; 
    background: rgba(0,0,0,0.6); border: 1px solid var(--glass-border); 
    color: #fff; border-radius: 10px; outline: none; transition: all 0.3s ease; font-family: inherit;
    font-size: 0.95rem;
}
.search-bar:focus, .form-control:focus { 
    border-color: var(--turquoise); box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.15); background: rgba(0,0,0,0.8);
}
select.form-control option { background: var(--bg-panel); color: #fff; }

.btn-premium, .btn-login { 
    background: var(--orange); color: #fff; padding: 12px 24px; border: none; 
    font-weight: 700; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; 
    justify-content: center; gap: 8px; text-decoration:none; transition: all 0.3s ease; 
    white-space: nowrap; font-size: 0.9rem; letter-spacing: 0.5px;
}
.btn-login { width: 100%; padding: 15px; font-size: 1.05rem; margin-top: 10px; }
.btn-premium:hover, .btn-login:hover { background: var(--orange-dark); transform: translateY(-2px); box-shadow: 0 6px 20px var(--orange-glow); }
.btn-premium:active, .btn-login:active { transform: translateY(0); }
.btn-premium:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* İkinci Buton Stili (Mavi/Turkuaz gerektiren yerler için) */
.btn-premium[style*="background:#3b82f6"], 
.btn-premium[style*="background: #3b82f6"] {
    background: var(--turquoise) !important; color: #000 !important;
}
.btn-premium[style*="background:#3b82f6"]:hover { box-shadow: 0 6px 20px var(--turquoise-glow) !important; }

.btn-sq { 
    width: 38px; height: 38px; border-radius: 10px; border: none; color: #fff; cursor: pointer; 
    display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s ease; text-decoration: none; 
}
.btn-sq:hover { transform: scale(1.08) translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }

/* =======================================================
   8. ETİKETLER (ROZETLER) VE ARAMA KUTULARI
   ======================================================= */
.tag-pill { 
    padding: 5px 12px; border-radius: 6px; border: 1px solid var(--glass-border); 
    display: inline-block; font-size: 0.75rem; font-weight: 600; background: rgba(0,0,0,0.6); 
    color: var(--text-muted); margin-bottom: 4px; margin-right: 4px; white-space: nowrap; 
}
.tag-pill b { color: #fff; }
.badge { padding: 6px 14px; border-radius: 8px; font-size: 0.8rem; font-weight: 700; display: inline-block; text-align: center; }

.search-dropdown { position: absolute; width: 100%; background: #0a0a0a; border: 1px solid var(--turquoise); border-radius: 10px; max-height: 280px; overflow-y: auto; z-index: 1050; display: none; box-shadow: 0 15px 40px rgba(0,0,0,0.7); margin-top: 5px; }
.search-item { padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.03); color: #cbd5e1; cursor: pointer; display:flex; justify-content:space-between; align-items:center; transition: 0.2s; }
.search-item:hover { background: rgba(0, 210, 255, 0.08); color: #fff; padding-left: 24px; }
.search-item b { color: var(--turquoise); font-size: 1.1rem; }

.login-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; 
    z-index: 9999; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease; padding: 20px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =======================================================
   9. KUSURSUZ MOBİL UYUM (TABLO -> KART SİHİRBAZI)
   ======================================================= */
@media (max-width: 992px) {
    /* Gövde Esnetme */
    body { display: flex !important; flex-direction: column !important; height: auto !important; min-height: 100vh !important; overflow-y: auto !important; padding-top: 70px !important; padding-bottom: 85px !important; }
    .main-content { padding: 15px !important; width: 100% !important; overflow: visible !important; }
    .main-header .container, .main-header .container-fluid { padding: 12px 15px !important; }
    
    .full-page-center { padding-bottom: 85px !important; min-height: calc(100vh - 70px) !important; }
    .module-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 15px !important; }
    
    /* Mobil App Tarzı Alt Menü */
    .sidebar { 
        position: fixed !important; bottom: 0 !important; top: auto !important; left: 0 !important; width: 100% !important; height: 75px !important; 
        flex-direction: row !important; background: rgba(5,5,5,0.98) !important; backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
        border-top: 1px solid var(--glass-border) !important; border-right: none !important; z-index: 9999 !important; padding: 0 !important;
    }
    .sidebar-logo { display: none !important; }
    .sidebar-menu { display: flex !important; flex-direction: row !important; width: 100% !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; padding:0 !important; margin:0 !important; }
    .sidebar-menu li { flex: 1 1 auto !important; min-width: 75px !important; margin:0 !important; }
    .sidebar-menu li a { 
        flex-direction: column !important; justify-content: center !important; padding: 8px 3px !important; gap: 4px !important; 
        font-size: 0.65rem !important; border-radius:0 !important; border-left:none !important; border-bottom: 3px solid transparent !important; height: 100% !important; text-align: center !important;
    }
    .sidebar-menu li a i { font-size: 1.35rem !important; width: auto !important; margin: 0 !important; color: var(--turquoise) !important; }
    .sidebar-menu li a.active { background: rgba(0, 210, 255, 0.05) !important; border-bottom-color: var(--turquoise) !important; color: #fff !important; }

    /* Kart Taşıma Düzeltmeleri */
    .card[style*="display:flex"], .card { display: block !important; }
    .card > div[style*="display:flex"] { flex-direction: column !important; align-items: stretch !important; gap: 15px !important; }
    .selected-card { flex-direction: column !important; text-align: center !important; gap: 15px !important; }
    .selected-card div[style*="width:100px"] { margin: 0 auto !important; }
    .search-bar, .form-control, .btn-premium { width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; }

    /* TABLOLARI ŞIK MOBİL KARTLARA ÇEVİRME */
    .table-container { background: transparent !important; border: none !important; padding: 0 !important; box-shadow: none !important; overflow: visible !important; min-height: auto !important; max-height: none !important; }
    .inventory-table, .inventory-table tbody { display: block !important; width: 100% !important; }
    .inventory-table thead { display: none !important; } 
    
    .inventory-table tr { 
        display: flex !important; flex-direction: column !important; background: var(--glass-bg) !important; 
        backdrop-filter: blur(10px) !important; -webkit-backdrop-filter: blur(10px) !important;
        margin-bottom: 18px !important; border-radius: 16px !important; border: 1px solid var(--glass-border) !important; 
        padding: 16px !important; width: 100% !important; box-sizing: border-box !important; box-shadow: 0 6px 18px rgba(0,0,0,0.4) !important;
    }
    
    .inventory-table td { 
        display: flex !important; flex-direction: column !important; align-items: center !important; text-align: center !important; 
        padding: 12px 0 !important; border-bottom: 1px dashed rgba(255,255,255,0.08) !important; width: 100% !important; 
        word-wrap: break-word !important; white-space: normal !important; overflow: hidden !important; box-sizing: border-box !important;
    }
    .inventory-table td * { max-width: 100% !important; word-wrap: break-word !important; }
    .inventory-table td:last-child { border-bottom: none !important; flex-direction: row !important; justify-content: center !important; gap: 12px !important; padding-bottom: 0 !important; margin-top: 8px !important; }
}

@media (max-width: 480px) {
    .module-grid { grid-template-columns: 1fr !important; }
    .module-btn { flex-direction: row !important; height: 90px !important; aspect-ratio: auto !important; justify-content: flex-start !important; padding-left: 25px !important; gap: 20px !important; border-radius: 14px !important; }
    .module-btn i { margin-bottom: 0 !important; font-size: 2.2rem !important; }
}