/* FinansApp - Design System */

:root {
    /* Colors - Clean Modern Bright White Theme (Ferah ve Beyaz) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #8a8a8a;

    --accent-primary: #5a6fd6;
    --accent-primary-rgb: 90, 111, 214;
    --accent-secondary: #7b8ae0;
    --accent-gradient: linear-gradient(135deg, #5a6fd6, #7b8ae0);

    --success: #3d9970;
    --warning: #d4a34a;
    --danger: #c75050;

    --border-color: #e5e7eb;
    --border-radius: 12px;
    --border-radius-sm: 8px;

    /* Spacing */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --tab-height: 70px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ===== GLOBAL ANIMATION KILL SWITCH (v6.5.3) ===== */
/* This aggressively disables ALL animations, transitions, and transforms */
*,
*::before,
*::after {
    animation: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    -webkit-animation: none !important;
    -webkit-animation-duration: 0s !important;
    -webkit-transition: none !important;
    -webkit-transition-duration: 0s !important;
}

/* Disable scroll behavior animations */
html,
body {
    scroll-behavior: auto !important;
}

/* Disable iOS specific animations */
select,
input,
button,
a,
div,
span {
    -webkit-appearance: none;
    -webkit-transform: none !important;
}

input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    appearance: checkbox !important;
}

/* Disable modal/overlay animations */
.modal,
.overlay,
[class*="modal"],
[class*="overlay"] {
    animation: none !important;
    transition: none !important;
}

/* ===== END ANIMATION KILL SWITCH ===== */


body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 0;
    padding-bottom: calc(var(--tab-height) + var(--safe-bottom));
}

/* Header with Absolute Safe Area Protection */
.header {
    height: auto;
    /* Reduced padding to minimize whitespace */
    padding-top: calc(env(safe-area-inset-top, 0px) + 15px);
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    padding: 0;
}

/* Main Content */
.content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--tab-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    cursor: pointer;
}

.tab-btn.active {
    color: var(--accent-primary);
}

.tab-icon {
    font-size: 1.5rem;
}

.tab-icon-svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

.tab-label {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.card-accent {
    border-left: 4px solid var(--accent-primary);
}

.insight-card {
    background: var(--bg-secondary);
    border: 1px dashed var(--accent-primary);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-top: 16px;
}

/* .card:active removed */

/* Pro UI Components */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.pro-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 24px 0 12px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pro-section-title::before {
    content: '';
    display: block;
    width: 3px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar-fill {
    height: 100%;
}

/* Glassmorphism for dashboard global balance */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Cleaned up duplicate card-header */

/* Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

/* Ensure inputs don't overflow their containers */
.form-group input,
.form-group select {
    min-width: 0;
    /* Important for flex/grid items */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group select {
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Specific fix for date inputs to ensure they don't shift or overflow */
input[type="date"] {
    position: relative;
    -webkit-appearance: none;
    appearance: none;
    min-height: 38px;
    display: flex;
    align-items: center;
}

/* Ensure placeholder/value is centered/left-aligned properly */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 2px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-primary);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.primary-btn:active {
    opacity: 0.9;
}

.add-btn {
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--accent-primary);
    border-radius: var(--border-radius-sm);
    color: var(--accent-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

/* Toggle Buttons */
.view-toggle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.toggle-btn {
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    cursor: pointer;
}

.toggle-btn.active {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
    color: white;
}

/* Result Box */
.result-box {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-top: 16px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.result-row:last-child {
    border-bottom: none;
}

.result-row.highlight {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 1rem;
}

.result-row.success {
    color: var(--success);
}

.result-row.danger {
    color: var(--danger);
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.summary-item {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.summary-item .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.summary-item .value {
    font-size: 1.1rem;
    font-weight: 600;
}

.summary-item.highlight {
    background: var(--accent-gradient);
}

.summary-item.highlight .label {
    color: rgba(255, 255, 255, 0.8);
}

/* Tables */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.data-table th,
.data-table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table th {
    background: none;
    color: var(--text-secondary);
    font-weight: 500;
    position: sticky;
    top: 0;
}

.data-table th:first-child,
.data-table td:first-child {
    text-align: left;
}

.data-table tbody tr:hover {
    background: var(--bg-input);
}

/* Year Selector */
.year-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.year-select {
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.vs-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Calc Type Selector */
.calc-type-selector {
    margin-bottom: 16px;
}

.calc-select {
    width: 100%;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

/* Portfolio Tabs (Harmonized with Budget Tabs) */
.portfolio-tabs {
    display: flex;
    gap: 3px;
    background: white;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 14px;
}

.portfolio-tab {
    flex: 1;
    padding: 8px 2px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.68rem;
    white-space: nowrap;
    text-align: center;
}

.portfolio-tab.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(var(--accent-primary-rgb), 0.2);
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.section-header h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Budget Page Modernization */
.budget-category-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
}

.budget-category-info {
    flex: 1;
}

.budget-category-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.budget-category-amounts {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.budget-category-status {
    text-align: right;
    min-width: 80px;
}

.budget-category-percent {
    font-weight: bold;
    font-size: 0.9rem;
}

.budget-category-diff {
    font-size: 0.7rem;
    margin-top: 2px;
}

.budget-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 768px) {
    .budget-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Budget Items */
.items-list {
    margin: 8px 0;
}

.budget-header-row {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.budget-item-row {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    font-size: 0.85rem;
}

.budget-item-row .item-name {
    color: var(--text-primary);
    font-size: 0.8rem;
}

.budget-item-row input {
    padding: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.8rem;
    text-align: right;
    width: 100%;
}

.budget-item-row .percent-input {
    width: 60px;
    text-align: center;
}

.budget-item {
    display: grid;
    grid-template-columns: 1fr 100px 60px 100px;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    font-size: 0.85rem;
}

.budget-item .item-name {
    color: var(--text-primary);
}

.budget-item input {
    padding: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-align: right;
}

.budget-item .delta {
    text-align: center;
    font-size: 0.75rem;
}

.delta.positive {
    color: var(--danger);
}

.delta.negative {
    color: var(--success);
}

/* Section Totals */
.section-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-weight: 600;
    border-top: 2px solid var(--border-color);
}

.net-result {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--border-radius);
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.net-result.positive {
    border-left: 4px solid var(--success);
}

.net-result.negative {
    border-left: 4px solid var(--danger);
}

/* Records List */
.records-list {
    max-height: 300px;
    overflow-y: auto;
}

.record-item {
    display: grid;
    grid-template-columns: 80px 1fr 80px 80px;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    align-items: center;
}

/* Filter Row */
.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.filter-row select {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* Chart Container */
canvas {
    width: 100% !important;
    max-height: 250px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    /* Center for desktop, mobile uses 100% height */
    justify-content: center;
    z-index: 2000;
    padding: 0;
    overflow: hidden;
    /* Prevent overlay scroll - crucial for iOS stability */
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Modal Base Structure - iOS Safe Area Protected */
.modal {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    height: 100%;
    /* Use env with hard fallback for iOS devices if env is not working */
    padding: calc(env(safe-area-inset-top, 44px) + 20px) 16px 20px 16px;
    position: relative;
    box-shadow: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.modal h3 {
    margin: 0;
    padding: 0 0 15px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
}

@media (min-width: 500px) {
    .modal {
        border-radius: var(--border-radius);
        margin: auto;
        height: auto;
        max-height: 90vh;
        padding: 30px 24px 24px 24px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    }
}

.modal-body {
    flex: 1;
    min-height: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-right: 4px;
    margin-bottom: 10px;
}

.modal-body * {
    box-sizing: border-box;
}

/* Removed redundant modal h3 rules */

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-cancel {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-confirm {
    background: var(--accent-gradient);
    border: none;
    color: white;
}

/* Modal Özel Stil (Madde 9 Fix) */
.modal-field {
    margin-bottom: 24px;
    /* Kutu arası boşluk artırıldı */
}

.modal-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    /* Daha kalın etiket */
}

.modal-field input,
.modal-field textarea {
    display: block;
    /* Inline boşluk sorununu çözer */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* Padding dahil genişlik hesabı */
    margin: 0;
    /* Default margin sıfırlama */
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-input);
    font-size: 1rem;
    color: var(--text-primary);

    /* iOS Safari Reset */
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
    /* Flexbox taşmalarını önler */
}

.modal-field input:focus,
.modal-field textarea:focus {
    border-color: var(--accent-primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(90, 111, 214, 0.1);
}

/* Removed redundant modal h3 rules */

/* Utilities */
.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Page Transitions removed */

/* Responsive */
@media (max-width: 480px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
    }
}

@media (max-width: 380px) {
    .budget-item {
        grid-template-columns: 1fr 80px 50px 80px;
    }
}

/* FAB - Floating Action Button */
.fab-btn {
    position: fixed;
    right: 20px;
    bottom: calc(var(--tab-height) + var(--safe-bottom) + 20px);
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: var(--accent-gradient);
    color: white;
    font-size: 2rem;
    border: none;
    box-shadow: 0 4px 15px rgba(90, 111, 214, 0.4);
    z-index: 1000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* .fab-btn:active removed */

/* Timeline & Pulse Animations removed */

/* =============================================
   MODERN DETAIL PAGE STYLES (Portfolio-inspired)
   ============================================= */

/* Detail Page Container */
.detail-page {
    background: var(--bg-primary);
    min-height: 100%;
}

/* Detail Page Header */
.detail-header {
    font-size: 1.4rem;
    font-weight: 800;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

/* Modern Card with Left Accent Border (Harmonized with Account Card) */
.detail-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    border-left-color: var(--accent-primary);
}

.detail-card.no-accent {
    border-left: none;
}

/* Label & Value Styles */
.detail-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 6px;
}

.detail-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.detail-value.negative {
    color: var(--danger);
}

.detail-value.positive {
    color: var(--success);
}

/* Modern Input Fields */
.detail-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-input);
    font-size: 1rem;
    color: var(--text-primary);
    box-sizing: border-box;
    cursor: pointer;
}

.detail-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(90, 111, 214, 0.1);
    outline: none;
}

/* Two Column Grid for Form Fields */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Single Form Group in Detail View */
.detail-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Modern Month/Date Selector */
.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 16px;
    margin: 16px 0;
}

.month-selector-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: var(--bg-card);
    color: var(--accent-primary);
    font-weight: 900;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* month-selector-btn:active removed */

.month-selector-label {
    padding: 10px 24px;
    background: var(--bg-card);
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    min-width: 120px;
    text-align: center;
}

/* Action Links (Birleştir, Bu Yıldan Kaldır, etc.) */
.action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    padding: 8px 0;
}

.action-link.primary {
    color: var(--accent-primary);
}

.action-link.danger {
    color: var(--danger);
}

/* Footer Buttons Row */
.btn-footer {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    margin-top: auto;
}

/* Outline Button */
.btn-outline {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    cursor: pointer;
}

.btn-outline:active {
    background: var(--bg-secondary);
}

/* Primary Modern Button */
.btn-primary-modern {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--accent-primary);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    z-index: 1000;
}

.btn-primary-modern:active {
    opacity: 0.9;
}

/* Delete Button (Full Width Outline) */
.delete-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--danger);
    border-radius: 12px;
    background: none;
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    cursor: pointer;
}

.delete-btn:active {
    background: rgba(239, 68, 68, 0.1);
}

/* Info Box for Limit/Balance Display - Clean Portfolio Style */
.info-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    margin-top: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.info-row .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.info-row .value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.info-row.highlight {
    margin-top: 8px;
    padding-top: 15px;
    border-top: 2px solid var(--border-color) !important;
    border-bottom: none;
}

.info-row.highlight .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--accent-primary);
}

.info-row.highlight .value {
    font-size: 1.1rem;
    color: var(--success);
}



/* Accrued Interest Banner (Yellow/Warning Style) */
.accrual-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0;
}

.accrual-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.accrual-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #92400e;
    text-transform: uppercase;
}

.accrual-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #b45309;
}

.accrual-btn {
    padding: 10px 18px;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Modern Transaction Item */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Reduced gap */
    padding-bottom: 20px;
}

/* Date Header for Grouping */
.tx-group-header {
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 800;
    margin-top: 16px;
    margin-bottom: 6px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    letter-spacing: 0.3px;
}

.tx-group-header>div:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tx-group-header>div:first-child span:last-child {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    /* Slightly reduced padding */
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;

}

/* transaction-item:active removed */

.tx-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border-radius: 12px;
    flex-shrink: 0;
}

.tx-date-day {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.tx-date-month {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 2px;
}

.tx-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tx-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.tx-amount {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

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

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

.tx-amount.transfer {
    color: #3b82f6;
    /* Beautiful Blue */
}



/* Modern Account Card */
.account-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    cursor: pointer;
}

.account-card:active {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    background: #fafafa;
}

.account-card .label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.account-card .value {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Account Card Grid Layout */
.acc-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 1.4fr);
    grid-template-rows: auto auto;
    width: 100%;
    align-items: center;
    gap: 3px 0;
}

.acc-card-grid div {
    display: flex;
    align-items: center;
}

.acc-card-grid .grid-tl {
    grid-column: 1;
    justify-content: flex-start;
    min-width: 0;
}

.acc-card-grid .grid-mt {
    grid-column: 2;
    justify-content: center;
    white-space: nowrap;
}

.acc-card-grid .grid-tr {
    grid-column: 3;
    justify-content: flex-end;
    white-space: nowrap;
    text-align: right;
}

.acc-card-grid .grid-bl {
    grid-column: 1;
    justify-content: flex-start;
}

.acc-card-grid .grid-mb {
    grid-column: 2;
    justify-content: center;
    white-space: nowrap;
}

.acc-card-grid .grid-br {
    grid-column: 3;
    justify-content: flex-end;
    white-space: nowrap;
}

.acc-card-grid .acc-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
}

.acc-card-grid .acc-limit {
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-left: 4px;
    font-weight: 500;
}

.acc-card-grid .acc-status {
    font-size: 0.55rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    background: rgba(var(--accent-primary-rgb), 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.acc-card-grid .acc-balance {
    font-size: 0.88rem;
    font-weight: 800;
}

.acc-card-grid .acc-rate {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-muted);
    opacity: 0.7;
}

.acc-card-grid .acc-details {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
    opacity: 0.7;
}

.acc-card-grid .acc-grace {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--success);
    text-transform: uppercase;
    font-style: italic;
}

.acc-card-grid .acc-btn {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 800;
    cursor: pointer;
}

.acc-card-grid .acc-btn:active {
    opacity: 0.8;
}

/* Liability Card (Mini Account Card for Summary) */
.liability-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    align-items: center;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    border-left-style: solid;
    position: relative;
}

.liability-card .l-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.liability-card .l-action {
    font-size: 0.7rem;
    color: var(--accent-primary);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.liability-card .l-value-group {
    text-align: right;
}

.liability-card .l-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
}

.liability-card .l-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Empty State for Transaction List */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Modern Transaction List Styles */
.tx-list-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
}

.tx-group-header-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 2px 6px 2px;
}

.tx-group-date {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: -0.01em;
}

.tx-group-day {
    font-size: 0.70rem;
    font-weight: 600;
    color: var(--text-muted);
}

.tx-group-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border-color), transparent);
    opacity: 0.3;
}

/* Centered Search Clear Button (Immune to animation kill switch) */
.search-clear-btn {
    position: absolute;
    right: 8px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 22px;
    text-align: center;
    z-index: 2;
}

.search-clear-btn:active {
    background: rgba(0, 0, 0, 0.16);
}

.transaction-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    cursor: pointer;
}

.transaction-card:active {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    background: #fafafa;
}

.tx-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: hidden;
}

.tx-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.tx-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.tx-amount {
    font-size: 0.88rem;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
    margin-left: 10px;
    letter-spacing: -0.01em;
}

/* Premium Account Details (Harmonized with Account Cards) */
.detail-label-main {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}

.detail-value-main {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

.inner-info-box {
    background: #ffffff;
    border-radius: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.info-row .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.info-row .value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.info-row.highlight {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-color);
}

.info-row.highlight .label {
    font-weight: 800;
    color: var(--accent-primary);
    font-size: 0.65rem;
}

.info-row.highlight .value {
    font-size: 0.88rem;
    color: var(--success);
    font-weight: 800;
}

/* SortableJS Styles */
.sortable-ghost {
    opacity: 0.4;
    background: var(--bg-secondary) !important;
}

.sortable-fallback {
    opacity: 0.9;
    background: var(--bg-card);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.drag-handle {
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

/* account-row removed */

.account-row:active {
    background: var(--bg-input);
}