:root {
    /* Renk Paleti - Premium Indigo & Slate */
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #10b981;
    --info: #3b82f6;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --sidebar: #1e293b;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-on-dark: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Loader */
.loader-wrapper {
    position: fixed;
    inset: 0;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Login Page */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-box {
    background: var(--surface);
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-muted);
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-logo {
    color: var(--primary-light);
}

.sidebar-nav {
    padding: 20px 0;
    flex-grow: 1;
}

.nav-item {
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
    margin: 4px 15px;
    border-radius: 10px;
}

.nav-item i {
    width: 20px;
    font-size: 18px;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info div {
    font-weight: 600;
    font-size: 14px;
}

.user-info small {
    color: #94a3b8;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 30px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.top-bar h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--background);
    border-color: var(--secondary);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.income .stat-icon {
    background: #dcfce7;
    color: var(--success);
}

.expense .stat-icon {
    background: #fee2e2;
    color: var(--danger);
}

.balance .stat-icon {
    background: #e0e7ff;
    color: var(--primary);
}

.accounts .stat-icon,
.warning .stat-icon {
    background: #fef3c7;
    color: var(--warning);
}

.info .stat-icon {
    background: #e0f2fe;
    color: var(--info);
}

.stat-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
}

/* Dashboard Content */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.dashboard-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.quick-actions {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    text-align: left;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--background);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.action-btn:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

/* Tables */
.table-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 15px 20px;
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    font-size: 13px;
    text-transform: uppercase;
}

.data-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-main);
}

.data-table tr:hover {
    background-color: #f1f5f9;
    cursor: default;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #e0e7ff;
    color: #3730a3;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.full-width {
    grid-column: span 2;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
    font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.readonly {
    background-color: #f1f5f9;
    cursor: not-allowed;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.small {
    max-width: 400px;
}

.modal-content.large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.close-modal {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 10px;
    background: var(--sidebar);
    color: white;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideLeft 0.3s ease;
}

@keyframes slideLeft {
    from {
        transform: translateX(50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Accounts List */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.account-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    border-left: 5px solid var(--primary);
    box-shadow: var(--shadow);
}

.account-card h4 {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 5px;
}

.account-card .balance {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
}

/* Payment History Summary */
.payment-summary-bar {
    display: flex;
    gap: 30px;
    background: #f8fafc;
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.summary-item span {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
}

.summary-item strong {
    font-size: 18px;
}

.history-actions {
    margin-bottom: 20px;
}

/* Participant List Styles */
.modal-content.extra-large {
    max-width: 1200px;
}

.participant-summary-bar {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.clickable {
    cursor: pointer;
    color: var(--primary);
    text-decoration: underline;
}

.clickable:hover {
    color: var(--primary-dark);
}

/* Filter Panel */
.filter-panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    animation: slideDown 0.3s ease;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    background: var(--background);
    transition: all 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-end;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding: 15px 0;
    border-top: 1px solid var(--border);
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Analytics & Dashboard Upgrades */
.date-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.date-presets .btn.active {
    background: var(--primary);
    color: white;
}

.stat-trend {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.chart-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.chart-card.large {
    grid-column: span 2;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 1rem;
    color: var(--text-dark);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.toggle-group {
    background: var(--background);
    padding: 4px;
    border-radius: 8px;
    display: flex;
    gap: 4px;
}

.toggle-group .btn {
    padding: 4px 12px;
    font-size: 0.75rem;
}

.toggle-group .btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

@media (max-width: 992px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .chart-card.large {
        grid-column: span 1;
    }
}

/* Quick Payment Search Results */
.search-results-container {
    position: absolute;
    width: 100%;
    max-height: 250px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    overflow-y: auto;
    margin-top: 5px;
}

.search-results-container.hidden {
    display: none;
}

.list-group-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background: #f1f5f9;
}

.list-group-item .item-title {
    font-weight: 600;
    display: block;
    color: var(--text-dark);
}

.list-group-item .item-sub {
    font-size: 0.85em;
    color: var(--text-muted);
}