/* Admin & Firma Ortak Stilleri */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

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

:root {
    --bg: #070b14;
    --bg-2: #0d1526;
    --bg-card: #111827;
    --bg-card-hover: #1a2540;
    --accent: #3b82f6;
    --accent-2: #8b5cf6;
    --accent-glow: rgba(59,130,246,0.2);
    --gold: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --text: #f1f5f9;
    --text-2: #94a3b8;
    --text-muted: #475569;
    --border: rgba(59,130,246,0.12);
    --border-h: rgba(59,130,246,0.35);
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 24px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --font: 'Inter', sans-serif;
    --font-d: 'Space Grotesk', sans-serif;
    --tr: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* === LOGIN SAYFASI === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(59,130,246,0.07) 0%, transparent 60%),
        radial-gradient(ellipse 50% 70% at 80% 60%, rgba(139,92,246,0.05) 0%, transparent 60%),
        var(--bg);
    position: relative;
    overflow: hidden;
}

.login-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(59,130,246,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent);
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: var(--shadow), 0 0 60px rgba(59,130,246,0.08);
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-img {
    max-height: 56px;
    max-width: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.login-logo-yazi {
    font-family: var(--font-d);
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 8px;
}

.login-badge-firma {
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    color: #60a5fa;
}

.login-badge-admin {
    background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.3);
    color: var(--gold);
}

.login-title {
    font-family: var(--font-d);
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.4rem;
}

.login-subtitle {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-2);
    margin-bottom: 2rem;
}

.form-grup {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1rem;
}

.form-grup label {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.3px;
}

.form-grup input, .form-grup select, .form-grup textarea {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px 14px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    width: 100%;
    transition: var(--tr);
    outline: none;
}

.form-grup input:focus, .form-grup select:focus, .form-grup textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.form-grup select option { background: var(--bg-2); color: var(--text); }
.form-grup textarea { min-height: 100px; resize: vertical; }

.btn-full {
    width: 100%;
    padding: 13px;
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--tr);
    font-family: var(--font);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
}

.btn-accent:hover {
    opacity: 0.88;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--accent-glow);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), #d97706);
    color: white;
}

.btn-gold:hover {
    opacity: 0.88;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(245,158,11,0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--border-h);
    color: var(--text);
    background: var(--accent-glow);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: var(--r-sm);
}

.btn-danger {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.3);
}

.btn-danger:hover {
    background: rgba(239,68,68,0.25);
    border-color: rgba(239,68,68,0.5);
}

.btn-success {
    background: rgba(16,185,129,0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16,185,129,0.3);
}

.btn-success:hover {
    background: rgba(16,185,129,0.25);
}

.login-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
    border-radius: var(--r-md);
    padding: 10px 14px;
    font-size: 0.88rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-back {
    text-align: center;
    margin-top: 1.5rem;
}

.login-back a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--tr);
}

.login-back a:hover { color: var(--accent); }

/* === PANEL LAYOUT === */
.panel-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    text-decoration: none;
}

.sidebar-logo-img {
    max-height: 40px;
    max-width: 130px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sidebar-logo-yazi {
    font-family: var(--font-d);
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-nav li a, .sidebar-nav li button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--r-md);
    color: var(--text-2);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    font-family: var(--font);
    transition: var(--tr);
    border: 1px solid transparent;
}

.sidebar-nav li a:hover, .sidebar-nav li button:hover {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border);
}

.sidebar-nav li a.active {
    background: rgba(59,130,246,0.12);
    color: var(--accent);
    border-color: rgba(59,130,246,0.25);
    font-weight: 600;
}

.sidebar-nav .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    margin-top: auto;
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.75rem; color: var(--text-muted); }

/* === PANEL CONTENT === */
.panel-content {
    padding: 2rem;
    overflow-x: hidden;
    background: var(--bg);
}

.panel-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.panel-title {
    font-family: var(--font-d);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.panel-title span { color: var(--accent); }

/* === STAT KARTLAR === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--tr);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.stat-card-mavi::after { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.stat-card-yesil::after { background: linear-gradient(90deg, var(--success), #34d399); }
.stat-card-sari::after { background: linear-gradient(90deg, var(--warning), #fcd34d); }
.stat-card-kirmizi::after { background: linear-gradient(90deg, var(--danger), #f87171); }

.stat-card:hover {
    border-color: var(--border-h);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.stat-card-ikon {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.stat-card-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-deger {
    font-family: var(--font-d);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.stat-card-alt {
    font-size: 0.8rem;
    color: var(--text-2);
}

/* === TABLO === */
.tablo-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
    margin-bottom: 2rem;
}

.tablo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
}

.tablo-baslik {
    font-family: var(--font-d);
    font-size: 1rem;
    font-weight: 700;
}

.tablo-overflow { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

thead tr {
    background: rgba(59,130,246,0.05);
    border-bottom: 1px solid var(--border);
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid rgba(59,130,246,0.06);
    transition: var(--tr);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(59,130,246,0.04); }

tbody td {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: var(--text-2);
    vertical-align: middle;
}

.td-firma {
    font-weight: 600;
    color: var(--text);
}

/* === ÖDEME DURUM BADGE === */
.durum-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
}

.durum-odendi {
    background: rgba(16,185,129,0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16,185,129,0.3);
}

.durum-bekliyor {
    background: rgba(245,158,11,0.12);
    color: #fcd34d;
    border: 1px solid rgba(245,158,11,0.3);
}

.durum-gecikti {
    background: rgba(239,68,68,0.12);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.3);
}

.durum-iptal {
    background: rgba(107,114,128,0.15);
    color: #9ca3af;
    border: 1px solid rgba(107,114,128,0.3);
}

/* === TUTAR KUTUSU === */
.tutar-alindi {
    font-weight: 700;
    color: var(--success);
    font-family: var(--font-d);
}

.tutar-bekliyor {
    font-weight: 700;
    color: var(--warning);
    font-family: var(--font-d);
}

.tutar-total {
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-d);
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 80px rgba(0,0,0,0.6);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-family: var(--font-d);
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--tr);
}

.modal-close:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
    color: #fca5a5;
}

/* === ÖDEME DETAY KART === */
.odeme-detay-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.odeme-detay-item {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px;
}

.odeme-detay-etiket {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.odeme-detay-deger {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-d);
}

/* === PANEL HAMBURGERİ === */
.panel-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.panel-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* === ALERT === */
.alert {
    padding: 12px 16px;
    border-radius: var(--r-md);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    color: #6ee7b7;
}

.alert-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.3);
    color: #fcd34d;
}

/* === CARD === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-family: var(--font-d);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === ÇİZGİ GRAFIK (ÖDEME ÇUBUĞU) === */
.odeme-cubuk-wrap { margin: 1.5rem 0; }

.odeme-cubuk-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.odeme-cubuk {
    height: 10px;
    background: var(--bg-2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.odeme-cubuk-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--success), #34d399);
    transition: width 1s cubic-bezier(0.4,0,0.2,1);
    position: relative;
}

.odeme-cubuk-fill::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}

/* === MOBİL UYUM PANEL === */
@media (max-width: 900px) {
    .panel-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 260px;
        height: 100vh;
        z-index: 500;
        transition: left 0.35s cubic-bezier(0.4,0,0.2,1);
    }

    .sidebar.open {
        left: 0;
        box-shadow: 10px 0 40px rgba(0,0,0,0.5);
    }

    .panel-hamburger {
        display: flex;
    }

    .panel-content {
        padding: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .odeme-detay-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .panel-topbar {
        gap: 0.75rem;
    }
}
