/* ====================================================================
   ASYILDIZ APYS - PREMIUM MODERN SAAS & FINTECH CRM THEME
   Font: Inter / JetBrains Mono | Style: Clean, Compact, Glassmorphism
   ==================================================================== */

:root {
    /* 1. Ana Tema Renk Paleti (Slate & Clean Ice White) */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-subtle: #f8fafc;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-dark: #090d16;
    
    /* 2. Tipografi & Metin Renkleri */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --text-inverse: #ffffff;
    
    /* 3. Vurgular (Modern Indigo, Emerald & Warm Gold) */
    --primary: #4f46e5;             /* Modern Corporate Indigo */
    --primary-hover: #4338ca;
    --primary-dark: #3730a3;
    --primary-subtle: rgba(79, 70, 229, 0.08);
    --primary-border: rgba(79, 70, 229, 0.2);

    --gold: #d97706;                /* Warm Amber Gold */
    --gold-hover: #b45309;
    --gold-dark: #92400e;
    --gold-subtle: rgba(217, 119, 6, 0.08);
    --gold-border: rgba(217, 119, 6, 0.22);

    --success: #10b981;             /* Kar / Pozitif / Tamamlandı */
    --success-hover: #059669;
    --success-subtle: rgba(16, 185, 129, 0.09);
    --success-border: rgba(16, 185, 129, 0.24);

    --danger: #ef4444;              /* Zarar / Negatif / Risk */
    --danger-hover: #dc2626;
    --danger-subtle: rgba(239, 68, 68, 0.09);
    --danger-border: rgba(239, 68, 68, 0.22);

    --warning: #f59e0b;             /* Takip / Bekleyen */
    --warning-hover: #d97706;
    --warning-subtle: rgba(245, 158, 11, 0.1);
    --warning-border: rgba(245, 158, 11, 0.25);

    --info: #0284c7;                /* Bilgi / Süreç */
    --info-hover: #0369a1;
    --info-subtle: rgba(2, 132, 199, 0.09);
    --info-border: rgba(2, 132, 199, 0.22);

    /* 4. İnce Çizgiler ve Diffuse Katmanlı Gölgeler */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: #818cf8;

    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 10px 25px -4px rgba(15, 23, 42, 0.07), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
    --shadow-xl: 0 20px 35px -6px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.05);

    /* 5. Ölçüler, Köşe Yumuşatmaları & Boşluklar */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --bottom-nav-height: 60px;
    --top-header-height: 56px;
}

/* Temel Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.48;
    font-size: 14px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

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

/* Tipografi Hiyerarşisi */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
h4 { font-size: 13.5px; font-weight: 600; }

code, pre, .font-mono {
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, Monaco, Consolas, monospace;
}

/* Konteyner & Grid */
.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 16px;
}

.grid {
    display: grid;
    gap: 12px;
}

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

@media (max-width: 768px) {
    .container {
        padding: 12px 14px;
    }
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* Modern SaaS Kart Bileşeni */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.01em;
}

/* Segmented Control Grubu (Hızlı Filtre Tabları) */
.segmented-control-group {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.segmented-control-item {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-xs);
    text-decoration: none;
    transition: all 0.15s ease;
}

.segmented-control-item:hover {
    color: var(--text-primary);
}

.segmented-control-item.active {
    background: #ffffff;
    color: var(--primary);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Butonlar (Modern SaaS Ergonomisi) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    min-height: 36px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    user-select: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    color: #ffffff;
}

.btn-gold {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(217, 119, 6, 0.2);
}
.btn-gold:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
    color: #ffffff;
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
    background-color: var(--success-hover);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    color: #ffffff;
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
    background-color: var(--danger-hover);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    color: #ffffff;
}

.btn-outline {
    background-color: #ffffff;
    border-color: var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    min-height: 30px;
    padding: 3px 9px;
    font-size: 11.5px;
    border-radius: var(--radius-xs);
}

.btn-lg {
    min-height: 44px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

/* Formlar & Girdi Alanları */
.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.form-control, .form-select {
    width: 100%;
    min-height: 36px;
    padding: 7px 11px;
    font-size: 12.5px;
    color: var(--text-primary);
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    appearance: none;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
    background-color: #ffffff;
}

textarea.form-control {
    min-height: 68px;
    resize: vertical;
}

/* Belirgin Kutu Butonlar & Seçici Kartlar (Pill Selector) */
.pill-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    width: 100%;
}

.pill-option {
    display: block;
    position: relative;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.pill-option input[type="radio"],
.pill-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.pill-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    min-height: 42px;
}

.pill-option:hover .pill-label {
    border-color: #94a3b8;
    background: #f8fafc;
}

/* Seçili Durum - Genel */
.pill-option input:checked + .pill-label {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.18);
    font-weight: 800;
}

/* DÖVİZ ALIŞ (Yeşil Belirgin Kutu) */
.pill-option input[value="buy"]:checked + .pill-label,
.pill-option input:checked + .pill-label.pill-positive {
    border-color: #10b981 !important;
    background: #ecfdf5 !important;
    color: #065f46 !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.22) !important;
    font-weight: 800 !important;
}

/* DÖVİZ SATIŞ (Amber / Altın Belirgin Kutu) */
.pill-option input[value="sell"]:checked + .pill-label {
    border-color: #d97706 !important;
    background: #fffbeb !important;
    color: #92400e !important;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.22) !important;
    font-weight: 800 !important;
}

/* Olumsuz / İptal Kırmızı */
.pill-option input[value="negative"]:checked + .pill-label,
.pill-option input:checked + .pill-label.pill-negative {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    color: #991b1b !important;
}

/* Modern Pastel Rozetler (Badges) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2.5px 7px;
    font-size: 10.5px;
    font-weight: 600;
    border-radius: var(--radius-full);
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.badge-primary {
    background: var(--primary-subtle);
    color: var(--primary-dark);
    border: 1px solid var(--primary-border);
}

.badge-success {
    background: var(--success-subtle);
    color: #065f46;
    border: 1px solid var(--success-border);
}

.badge-emerald {
    background: #10b981;
    color: #ffffff;
}

.badge-danger {
    background: var(--danger-subtle);
    color: #991b1b;
    border: 1px solid var(--danger-border);
}

.badge-warning {
    background: var(--warning-subtle);
    color: #92400e;
    border: 1px solid var(--warning-border);
}

.badge-gold {
    background: var(--gold-subtle);
    color: #92400e;
    border: 1px solid var(--gold-border);
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.badge-dark {
    background: #0f172a;
    color: #f8fafc;
}

.badge-info {
    background: var(--info-subtle);
    color: #0369a1;
    border: 1px solid var(--info-border);
}

/* Tablolar (Modern SaaS Table) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #ffffff;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12.5px;
    text-align: left;
}

.table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 9px 11px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 9px 11px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text-primary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr {
    transition: background-color 0.12s ease;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* Uyarı ve Flash Mesajları */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
}

.alert-success { background: var(--success-subtle); color: #065f46; border: 1px solid var(--success-border); }
.alert-danger { background: var(--danger-subtle); color: #991b1b; border: 1px solid var(--danger-border); }
.alert-warning { background: var(--warning-subtle); color: #92400e; border: 1px solid var(--warning-border); }
.alert-info { background: var(--info-subtle); color: #0369a1; border: 1px solid var(--info-border); }

/* Yanıp Sönen Canlı Durum Noktası (Pulsing Dot) */
.pulse {
    display: inline-flex;
    align-items: center;
}

.pulse::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: currentColor;
    margin-right: 5px;
    animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Modal Pencere (Glassmorphic Backdrop Overlay) */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: none !important;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 768px) {
    .modal-backdrop {
        align-items: center;
    }
}

.modal-backdrop.active {
    display: flex !important;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 540px;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-xl);
    padding: 18px;
    animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
    .modal-content {
        border-radius: var(--radius-md);
        animation: scaleInModal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

@keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes scaleInModal {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Toast Bildirimleri */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 90vw;
}

.toast {
    background: #0f172a;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideInRight 0.25s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
