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

:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Renk Paleti (Premium Indigo/Purple Temalı) */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --secondary: #475569;
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --info: #06b6d4;
    --info-light: rgba(6, 182, 212, 0.1);
    
    /* Tema Renkleri (Açık Tema Temelli, Modern Koyu Detaylar) */
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a; /* Şık Koyu Sidebar */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-white: #ffffff;
    --border-color: #f1f5f9;
    
    /* Gölgeler ve Köşeler */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 20px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow-x: hidden;
}

html,
body {
    max-width: 100%;
}

body.sidebar-open {
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6, .display-font {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Scrollbar Tasarımı */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Giriş ve Kayıt Ekranı Tasarımı */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, rgba(245, 158, 11, 0.05) 90.2%);
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    transition: var(--transition);
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.15);
}

.form-control-custom {
    background-color: rgba(248, 250, 252, 0.8);
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-control-custom:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    outline: none;
}

.btn-custom {
    background-color: var(--primary);
    color: var(--text-white);
    font-weight: 500;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    transition: var(--transition);
}

.btn-custom:hover {
    background-color: var(--primary-hover);
    color: var(--text-white);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

/* Ana Sayfa Düzeni (Layout) */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

/* Sidebar Tasarımı */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.35rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    margin: 0;
    flex-grow: 1;
}

.sidebar-item {
    margin-bottom: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-link i {
    font-size: 1.2rem;
    transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
}

.sidebar-link.active {
    background-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Ana İçerik Alanı */
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    min-height: 100vh;
    padding: 40px;
    transition: var(--transition);
    width: auto;
    max-width: 100%;
    overflow-x: clip;
}

/* Mobil Hamburger Menü Butonu */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1100;
}

.mobile-sidebar-backdrop {
    display: none;
}

/* Dashboard Kartları (Widgets) */
.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.stat-card.income .stat-icon {
    background-color: var(--success-light);
    color: var(--success);
}

.stat-card.expense .stat-icon {
    background-color: var(--danger-light);
    color: var(--danger);
}

.stat-card.balance .stat-icon {
    background-color: var(--primary-light);
    color: var(--primary);
}

.stat-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 4px;
    font-family: var(--font-heading);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

/* Tablolar ve Listeler */
.card-custom {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.card-title-custom {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.transaction-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.transaction-list-item:last-child {
    border-bottom: none;
}

.transaction-list-item:hover {
    padding-left: 4px;
    padding-right: 4px;
    background-color: var(--bg-app);
}

.transaction-icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.transaction-amount {
    font-weight: 600;
    font-family: var(--font-heading);
}

.transaction-amount.income {
    color: var(--success);
}

.transaction-amount.expense {
    color: var(--danger);
}

/* Modallar */
.modal-content-custom {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-card);
}

.modal-header-custom {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-body-custom {
    padding: 24px;
}

/* Badge'ler */
.badge-custom {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Animasyonlar */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-section {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Mobil Cihazlar ve Duyarlılık (Responsive) */
@media (max-width: 991.98px) {
    .sidebar {
        left: -280px;
        width: min(260px, 78vw);
        z-index: 1200;
    }
    
    .sidebar.show {
        left: 0;
        box-shadow: 10px 0 30px rgba(0,0,0,0.15);
    }
    
    .main-content {
        margin-left: 0;
        padding: 80px 20px 20px 20px;
        width: 100%;
    }
    
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        z-index: 999;
    }

    .mobile-header .sidebar-logo {
        max-width: calc(100vw - 90px);
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-size: 1.1rem;
    }
    
    .mobile-toggle {
        display: block;
    }

    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.42);
        backdrop-filter: blur(1px);
        -webkit-backdrop-filter: blur(1px);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
        z-index: 1100;
        display: block;
    }

    .mobile-sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding: 76px 14px 16px 14px;
        width: 100%;
    }

    .mobile-header {
        height: 56px;
        padding: 0 14px;
    }

    .mobile-header .sidebar-logo {
        font-size: 0.95rem;
        gap: 8px;
    }

    .card-custom,
    .stat-card,
    .auth-card {
        padding: 16px;
    }

    .card-title-custom {
        font-size: 1rem;
        margin-bottom: 14px;
        align-items: flex-start;
        gap: 8px;
        flex-direction: column;
    }

    .stat-value {
        font-size: 1.35rem;
    }

    .stat-title {
        font-size: 0.75rem;
    }

    .transaction-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .transaction-amount {
        width: 100%;
        text-align: left;
        padding-left: 52px;
    }

    .table {
        font-size: 0.88rem;
        min-width: 680px;
    }

    .table td,
    .table th {
        white-space: nowrap;
        vertical-align: middle;
    }

    .badge-custom {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .modal-header-custom,
    .modal-body-custom {
        padding: 16px;
    }

    .sidebar-menu {
        padding: 16px 12px;
    }

    .sidebar-header,
    .sidebar-footer {
        padding: 18px 16px;
    }

    .sidebar-link {
        padding: 11px 14px;
        font-size: 0.92rem;
    }

    .nav-tabs {
        gap: 6px;
        flex-wrap: wrap;
    }

    .nav-tabs .nav-link {
        width: 100%;
        text-align: left;
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    .main-content .row {
        --bs-gutter-x: 0.75rem;
        margin-left: 0;
        margin-right: 0;
    }

    .main-content .row > * {
        max-width: 100%;
        padding-left: calc(var(--bs-gutter-x) * 0.5);
        padding-right: calc(var(--bs-gutter-x) * 0.5);
    }

    .main-content > *,
    .card-custom,
    .stat-card,
    .page-toolbar,
    .search-toolbar,
    .table-responsive,
    .modal-content,
    .mobile-header {
        max-width: 100%;
    }

    .page-actions > *,
    .search-toolbar > *,
    .table-action-group > * {
        min-width: 0;
    }

    .page-actions,
    .search-toolbar,
    .table-action-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
    }

    .page-actions .btn,
    .page-primary-action,
    .search-toolbar .btn,
    .table-action-group .btn,
    .table-inline-action {
        width: 100%;
        min-width: 0;
        flex: 1 1 auto;
    }

    .mobile-header,
    .mobile-header .sidebar-logo {
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 72px 12px 14px 12px;
        width: 100%;
    }

    .auth-card {
        padding: 24px 18px;
    }

    .sidebar {
        width: min(248px, 76vw);
    }

    .btn,
    .btn-sm,
    .btn-custom {
        font-size: 0.92rem;
    }

    .table {
        min-width: 620px;
    }

    .transaction-icon-box {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .transaction-amount {
        padding-left: 46px;
    }

    .stat-card::after {
        width: 72px;
        height: 72px;
    }
}

.page-toolbar {
    width: 100%;
}

.page-actions {
    flex-wrap: wrap;
}

.page-primary-action {
    min-width: 168px;
}

.search-toolbar .position-relative,
.table-action-group {
    min-width: 0;
}

.table-inline-action {
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .page-actions {
        width: 100%;
        gap: 12px !important;
    }

    .page-actions .btn {
        flex: 1 1 calc(50% - 12px);
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    .page-toolbar {
        gap: 14px !important;
    }

    .page-toolbar > div:first-child,
    .search-toolbar > div:first-child {
        width: 100%;
    }

    .page-toolbar .btn,
    .page-primary-action {
        width: 100%;
    }

    .search-toolbar .position-relative {
        max-width: 100% !important;
    }

    .transaction-list-item > .d-flex:first-child,
    .transaction-list-item > .d-flex.flex-column {
        width: 100%;
    }

    .transaction-list-item .badge {
        max-width: 100%;
        white-space: normal;
    }

    .table-action-group {
        width: 100%;
        justify-content: flex-start !important;
    }

    .table-action-group .btn,
    .table-inline-action {
        flex: 1 1 100%;
        width: 100%;
        justify-content: center;
    }

    .summary-badge-wrap,
    .summary-badge-wrap .badge {
        width: 100%;
    }

    .summary-badge-wrap .badge {
        white-space: normal;
        justify-content: center;
        line-height: 1.45;
    }

    .modal-footer {
        padding-top: 0.75rem;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .profile-tabs-wrap {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

@media (max-width: 575.98px) {
    .page-toolbar h1 {
        font-size: 1.9rem;
    }

    .page-actions .btn,
    .page-primary-action {
        min-height: 44px;
    }

    .card-title-custom small {
        width: 100%;
    }
}
