@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* --- RENK PALETİ --- */
    --bg-body: #020617;       /* Derin Uzay Mavisi */
    --bg-glass: rgba(30, 41, 59, 0.4); /* Cam Efekti */
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --primary: #6366f1;       /* İndigo */
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #ec4899;     /* Neon Pembe */
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --font-main: 'Outfit', sans-serif;
    --radius-xl: 24px;
    --radius-md: 16px;
}

/* --- TEMEL AYARLAR --- */
* { 
    box-sizing: border-box; 
    outline: none; 
    -webkit-tap-highlight-color: transparent; /* Mobilde tıklama gölgesini kaldırır */
}

body {
    background-color: var(--bg-body);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 40%);
    color: var(--text-main);
    font-family: var(--font-main);
    margin: 0; padding: 0;
    min-height: 100vh;
    overflow-x: hidden; /* SAĞA SOLA KAYMAYI ENGELLER */
    width: 100%;
}

/* Scrollbar Tasarımı */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* --- LAYOUT (MASAÜSTÜ) --- */
.app-container { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    display: flex; flex-direction: column;
    padding: 30px; flex-shrink: 0; z-index: 50;
    box-shadow: 10px 0 30px rgba(0,0,0,0.2);
}

.brand {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
    margin-bottom: 40px;
    font-size: 1.8rem;
    display: flex; align-items: center; gap: 12px;
    font-weight: 700; color: white;
}
.brand span {
    background: linear-gradient(to right, #fff, #cbd5e1); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.nav-menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }

.nav-link {
    display: flex; align-items: center; gap: 14px; padding: 14px 18px;
    border-radius: 14px; color: var(--text-muted); text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); font-weight: 500; font-size: 0.95rem;
    border: 1px solid transparent; position: relative; overflow: hidden;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05); color: #f8fafc;
    transform: translateX(3px);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(99,102,241,0.15) 0%, rgba(99,102,241,0.05) 100%);
    color: #fff; border-color: rgba(99,102,241,0.4);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}
.nav-link.active i { color: #818cf8; filter: drop-shadow(0 0 5px rgba(99,102,241,0.6)); }
.nav-link i { width: 24px; text-align: center; transition: 0.3s; }
.nav-link.logout { color: #ef4444; opacity: 0.8; margin-top: auto; }
.nav-link.logout:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); opacity: 1; }

/* Main Content */
.main-content { flex: 1; padding: 40px; overflow-y: auto; position: relative; width: 100%; }

.header {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 40px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
}
.header h1 { margin: 0; font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; }

/* --- COMPONENTS --- */
.card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 30px; margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.card:hover { border-color: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }

.btn {
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white; padding: 14px 24px; border: none; border-radius: 12px;
    font-weight: 600; cursor: pointer; transition: all 0.3s ease;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 0.95rem; box-shadow: 0 4px 15px var(--primary-glow);
    text-decoration: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px var(--primary-glow); filter: brightness(1.1); }

.form-input {
    width: 100%; padding: 14px 18px;
    background: rgba(0, 0, 0, 0.2); border: 1px solid var(--border-glass);
    color: white; border-radius: 12px; font-family: var(--font-main); transition: 0.3s;
}
.form-input:focus { border-color: var(--primary); background: rgba(0, 0, 0, 0.4); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); }

/* Standart Tablolar (Masaüstü) */
table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
th { text-align: left; color: var(--text-muted); padding: 10px 20px; font-weight: 500; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }
td { background: rgba(255, 255, 255, 0.02); padding: 16px 20px; border: 1px solid transparent; transition: 0.2s; }
td:first-child { border-radius: 12px 0 0 12px; }
td:last-child { border-radius: 0 12px 12px 0; }
tr:hover td { background: rgba(255, 255, 255, 0.05); border-color: var(--border-glass); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }

/* Dashboard Hero */
.hero-card {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 40px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 50px -10px rgba(49, 46, 129, 0.5);
}
.hero-card::after {
    content: ''; position: absolute; top: -50%; right: -20%; width: 400px; height: 400px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.4; filter: blur(60px); pointer-events: none;
}

/* =========================================
   MOBILE APP MODU (Responsive & PWA)
   ========================================= */
@media (max-width: 900px) {
    /* 1. Masaüstü Sidebar'ı Tamamen Gizle */
    .sidebar { display: none !important; }

    /* 2. Layout Düzeni */
    .app-container { flex-direction: column; height: auto; overflow: visible; }
    .main-content { 
        padding: 20px;
        padding-bottom: 120px; /* Alt menü payı */
        height: auto; 
        overflow-y: visible;
        width: 100%;
    }

    /* 3. Header Küçültme */
    .header { flex-direction: column; align-items: flex-start; gap: 15px; margin-bottom: 25px; }
    .header div:last-child { align-self: flex-end; width: 100%; text-align: right; background: rgba(255,255,255,0.05); padding: 15px; border-radius: 16px; }
    .header h1 { font-size: 1.5rem; }

    /* 4. Grid Yapısını Tek Kolona Düşür */
    .grid { grid-template-columns: 1fr !important; gap: 20px; }
    .dashboard-layout { grid-template-columns: 1fr !important; display: flex; flex-direction: column; }
    
    /* 5. Sağ Paneli (HUD) İçeriğin Altına Al */
    .right-hud { display: block; border-left: none; border-top: 1px solid var(--border-glass); padding-top: 20px; }
    .left-stack { border-right: none; border-bottom: 1px solid var(--border-glass); padding-bottom: 20px; }

    /* 6. TABLOLARI LİSTEYE DÖNÜŞTÜRME (SCROLL YOK, LİSTE VAR) */
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { position: absolute; top: -9999px; left: -9999px; } /* Başlıkları gizle */
    
    tr { 
        margin-bottom: 15px; 
        border-bottom: 1px solid rgba(255,255,255,0.1); 
        padding-bottom: 10px; 
        display: flex; 
        align-items: center; 
        justify-content: space-between; 
        flex-wrap: nowrap; /* Satır kırılmasın */
    }
    
    td { 
        border: none !important; 
        padding: 5px 0 !important; 
        background: transparent !important; 
        width: auto; 
    }
    td:first-child { width: 40px; margin-right: 10px; border-radius: 0; }
    td:last-child { text-align: right; font-weight: 800; font-size: 1rem; border-radius: 0; }
    td:nth-child(2) { flex: 1; font-weight: 600; font-size: 0.9rem; } /* İsim/Açıklama alanı */

    /* Hover iptal */
    tr:hover td { background: transparent !important; }

    /* 7. KART DÜZENİ */
    .card { padding: 20px; border-radius: 20px; width: 100%; }
    .login-box { 
        width: 100% !important; 
        max-width: 100% !important; 
        padding: 0 !important; 
        border: none !important; 
        background: transparent !important; 
        box-shadow: none !important;
    }
    .card-tilt-wrapper { max-width: 100%; transform: none !important; }

    /* 8. BOTTOM NAVIGATION (Alt Menü) */
    .mobile-nav {
        display: flex !important; 
        position: fixed; bottom: 0; left: 0; width: 100%;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255,255,255,0.1);
        padding: 10px 10px 30px 10px; /* iPhone home bar için extra padding */
        justify-content: space-around;
        align-items: flex-end;
        z-index: 990;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    }
    
    .mobile-nav-item {
        display: flex; flex-direction: column; align-items: center; gap: 5px;
        color: #64748b; text-decoration: none; font-size: 0.7rem; font-weight: 500;
        width: 60px; transition: 0.3s; cursor: pointer;
    }
    
    .mobile-nav-item i { font-size: 1.4rem; margin-bottom: 2px; transition: 0.3s; }
    
    .mobile-nav-item.active { color: #6366f1; }
    .mobile-nav-item.active i { transform: translateY(-5px); filter: drop-shadow(0 0 8px rgba(99,102,241,0.6)); }

    /* 9. ORTA QR BUTONU (FAB) */
    .center-fab { position: relative; top: -35px; }
    .fab-btn {
        width: 65px; height: 65px;
        background: linear-gradient(135deg, #6366f1, #a855f7);
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        color: white; font-size: 1.8rem;
        box-shadow: 0 10px 25px rgba(99,102,241,0.5);
        border: 5px solid #0f172a; /* Arka plan rengiyle aynı çerçeve */
        transition: transform 0.2s;
    }
    .fab-btn:active { transform: scale(0.9); }

    /* 10. MENÜ OVERLAY (Açılır Pencere) */
    .mobile-menu-overlay {
        position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
        z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
        /* Varsayılan gizli, JS ile flex yapılacak */
    }
    .menu-content {
        background: #1e293b; width: 100%; border-radius: 30px 30px 0 0;
        padding: 30px; padding-bottom: 50px; /* iPhone Safe Area */
        border-top: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 -10px 50px rgba(0,0,0,0.5);
        animation: slideUp 0.3s ease-out;
    }
    @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

    .mobile-grid-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 30px; }
    
    .m-item {
        background: rgba(255,255,255,0.05); padding: 15px; border-radius: 15px;
        text-decoration: none; color: white; font-weight: 600; display: flex; align-items: center; gap: 10px;
        font-size: 0.9rem; transition: 0.2s; border: 1px solid transparent;
    }
    .m-item:active { background: rgba(255,255,255,0.1); transform: scale(0.98); }
    .m-item.admin { background: rgba(251, 191, 36, 0.1); color: #fbbf24; border-color: rgba(251, 191, 36, 0.2); }
    
    .mobile-logout-btn {
        display: block; width: 100%; padding: 15px; text-align: center;
        background: rgba(239, 68, 68, 0.1); color: #ef4444; border-radius: 15px;
        text-decoration: none; font-weight: bold; border: 1px solid rgba(239, 68, 68, 0.2);
    }
}

/* Masaüstünde mobil elementleri gizle */
@media (min-width: 901px) {
    .mobile-nav, .mobile-menu-overlay { display: none !important; }
}