@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Bright Premium Blue Palette */
    --primary-color: #2563eb; 
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --bg-color: #f4f7fe;
    --surface-color: #ffffff; 
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px rgba(37, 99, 235, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
    --glow-primary: 0 0 15px rgba(37, 99, 235, 0.3);
    
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Tüm elemanlarda Urbanist fontunu zorla */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Urbanist', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.05), transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.05), transparent 40%);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s;
}

a:hover {
    color: var(--primary-hover);
}

/* Split Auth Layout */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--surface-color);
}

@media (max-width: 768px) {
    .auth-wrapper {
        flex-direction: column;
    }
    .auth-image-side {
        display: none;
    }
    .auth-form-side {
        padding: 2rem 1.5rem;
    }
}

.auth-image-side {
    flex: 1.2;
    background: linear-gradient(135deg, rgba(37,99,235,0.9), rgba(30,58,138,0.9)), url('https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&q=80') center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}

.auth-image-side::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-image-side h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.auth-image-side p {
    font-size: 1.2rem;
    text-align: center;
    max-width: 400px;
    opacity: 0.9;
}

.auth-form-side {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    background: var(--surface-color);
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: left;
    margin-bottom: 2.5rem;
}

.auth-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #f8fafc;
    color: var(--text-primary);
    font-family: 'Urbanist', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.btn {
    display: inline-block;
    font-family: 'Urbanist', sans-serif;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease-in-out;
    width: 100%;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.btn-primary {
    color: #fff !important;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
    border: none;
}

.btn-primary:hover {
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.text-center { text-align: center; }
.mt-3 { margin-top: 1rem; }
.text-sm { font-size: 0.9rem; }

/* Dashboard Layout */
.layout { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar { 
    width: 260px; 
    min-width: 260px; /* Genişliği kilitle */
    flex-shrink: 0;   /* İçeriğin sidebar'ı daraltmasını engelle */
    background: var(--surface-color); 
    border-right: 1px solid var(--border-color); 
    padding: 2rem 1rem; 
    display: flex; 
    flex-direction: column; 
    z-index: 10; 
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-logo { 
    height: 60px; 
    margin-bottom: 2.5rem; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 1.5rem; 
    font-weight: 900; 
    color: var(--primary-color);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-logo img { 
    max-height: 100%; 
    max-width: 100%; 
    object-fit: contain; 
}

.nav-item { 
    padding: 0 1rem; /* Yatay padding sabit */
    margin-bottom: 0.25rem; 
    border-radius: 12px; 
    color: var(--text-secondary); 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    border: 1px solid transparent; 
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    height: 48px; /* Yükseklik tam sabit */
    flex-shrink: 0;
}

.nav-item i { width: 20px; text-align: center; font-size: 1.1rem; }

.nav-item:hover {
    background: #f8fafc;
    color: var(--primary-color);
    border-color: #f1f5f9;
}

.nav-item.active { 
    background: var(--primary-light); 
    color: var(--primary-color); 
    border-color: rgba(37, 99, 235, 0.1);
}

.main-content { 
    flex: 1; 
    padding: 2.5rem; 
    background: var(--bg-color); 
    min-width: 0; 
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #fff;
    border-top: 1px solid var(--border-color);
    z-index: 1001;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}

.nav-link-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    gap: 4px;
    width: 20%;
}

.nav-link-mobile i {
    font-size: 1.2rem;
}

.nav-link-mobile.active {
    color: var(--primary-color);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 2000;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 30px 30px 0 0;
    padding: 2rem;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
    max-height: 85vh;
    overflow-y: auto;
}

.mobile-menu-overlay.active {
    bottom: 0;
}

.overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 1999;
    display: none;
}

.overlay-backdrop.active {
    display: block;
}

.mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.menu-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.8rem;
    text-align: center;
}

.menu-grid-item i {
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { padding: 0.75rem; padding-bottom: 100px; }
    .header { margin-bottom: 1.5rem; flex-direction: row; justify-content: space-between; align-items: center; height: auto; padding-bottom: 1rem; }
    .header h2 { font-size: 1.3rem; }
    #currency-widget, #header-full-date { display: none !important; }
    /* Global Mobil Kart Dönüşümü (Dashboard & Listeler) */
    .stats-grid, .stats-container, .contract-stats { 
        grid-template-columns: 1fr !important; 
        gap: 1rem !important; 
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .dash-card {
        padding: 1.25rem !important;
        border-radius: 20px !important;
    }

    .dash-card .card-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }

    .dash-card .card-value {
        font-size: 1.2rem !important;
    }

    .dash-card .card-label {
        font-size: 0.65rem !important;
    }

    .dash-card .card-sub {
        font-size: 0.7rem !important;
        display: none; /* Mobilde alt metni gizle ki yer açılsın */
    }

    .grid-2, .bottom-grid { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
    
    .mobile-bottom-nav { display: flex; }
    .mobile-hide-name { display: none !important; }
    
    .card, .panel, .stat-card { border-radius: var(--radius-lg) !important; width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; margin-bottom: 1rem !important; }
    
    /* Layout fix for mobile */
    .layout { display: block; }
    .main-content { margin-left: 0; width: 100%; }
    
    .action-flex {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
        align-items: center;
    }
    
    /* Table to Card Transformation */
    .table-responsive { overflow-x: visible; padding: 0; }
    .table-responsive table, 
    .table-responsive thead, 
    .table-responsive tbody, 
    .table-responsive th, 
    .table-responsive td, 
    .table-responsive tr { display: block; width: 100%; }
    .table-responsive thead { display: none; }
    .table-responsive tr { 
        margin-bottom: 1rem; 
        border: 1px solid var(--border-color); 
        border-radius: var(--radius-lg); 
        background: #fff; 
        padding: 1rem; 
        box-shadow: var(--shadow-sm);
    }
    .table-responsive td { 
        border: none !important; 
        padding: 0.5rem 0 !important; 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        text-align: right;
        min-height: 40px;
        border-bottom: 1px solid #f8fafc !important;
    }
    .table-responsive td:last-child { border-bottom: none !important; }
    .table-responsive td:before {
        content: attr(data-label);
        font-weight: 800;
        text-align: left;
        color: var(--text-secondary);
        font-size: 0.7rem;
        text-transform: uppercase;
        margin-right: 1rem;
    }
    
    body { overflow-x: hidden; }
}

.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 2.5rem; 
    padding-bottom: 1.5rem; 
    border-bottom: 1px solid var(--border-color);
    height: 60px; 
    flex-shrink: 0;
}

.header h2 { 
    font-weight: 800; 
    color: var(--text-primary); 
    font-size: 1.8rem; 
    letter-spacing: -0.5px; 
    line-height: 1; /* Dikey kaymayı önler */
    margin: 0;
}

.user-menu { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    font-weight: 700; 
    color: var(--text-primary); 
    height: 40px; 
}

.user-menu img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Grid & Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface-color); padding: 1.8rem; border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); border: 1px solid rgba(255,255,255,0.8); position: relative; overflow: hidden; transition: transform 0.3s ease; }
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.stat-card::after { content: ''; position: absolute; right: -20px; top: -20px; width: 100px; height: 100px; background: var(--primary-light); border-radius: 50%; filter: blur(20px); z-index: 0; }
.stat-card .title { color: var(--text-secondary); font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; position: relative; z-index: 1;}
.stat-card .value { font-size: 2.4rem; font-weight: 800; color: var(--text-primary); margin-top: 0.5rem; position: relative; z-index: 1;}

.card { background: var(--surface-color); border-radius: var(--radius-xl); border: 1px solid rgba(255,255,255,0.8); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 2rem; }
.card-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); font-weight: 700; font-size: 1.2rem; display: flex; justify-content: space-between; align-items: center; background: #fff; }

/* Tables */
.table-responsive { overflow-x: auto; padding: 0 1.5rem 1.5rem 1.5rem; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 1rem 0; text-align: left; border-bottom: 1px solid var(--border-color); }
th { color: var(--text-secondary); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; padding-top: 1.5rem; }
tr:hover td { background: #f8fafc; }

/* Badges & Helpers */
.badge { padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-success { background: #ecfdf5; color: var(--success-color); border: 1px solid #d1fae5; }
.badge-warning { background: #fffbeb; color: var(--warning-color); border: 1px solid #fef3c7; }
.badge-danger { background: #fef2f2; color: var(--danger-color); border: 1px solid #fee2e2; }
.badge-info { background: var(--primary-light); color: var(--primary-color); border: 1px solid #dbeafe; }

.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; border-radius: var(--radius-md); }
.btn-danger { background-color: #fef2f2; color: var(--danger-color); border: 1px solid var(--danger-color); box-shadow: none; }
.btn-danger:hover { background-color: var(--danger-color); color: #fff; }
.btn-outline { background: #fff; border: 2px solid var(--border-color); color: var(--text-primary); font-weight: 600;}
.btn-outline:hover { background: #f8fafc; border-color: var(--primary-color); color: var(--primary-color); }
.mb-3 { margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
