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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    color: #e0e0e0;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 50% 20%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
    animation: backgroundFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
    animation: slideDown 0.6s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.top-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(255, 255, 255, 0.1);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-btn:hover {
    background: rgba(42, 42, 42, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.action-btn.primary {
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    color: #0a0a0a;
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.3);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    background: rgba(26, 26, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-icon.income {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: #10b981;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.stat-icon.expense {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: #ef4444;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

.stat-icon.balance {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    color: #3b82f6;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.stat-count {
    font-size: 12px;
    color: #666;
}

.content-panels {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.filter-section {
    background: rgba(26, 26, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.filter-section:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filter-row input,
.filter-row select {
    padding: 10px 16px;
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.filter-row input:focus,
.filter-row select:focus {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(17, 17, 17, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.filter-row select option {
    background: #1a1a1a;
}

.btn-filter {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    color: #0a0a0a;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15);
}

.btn-filter:hover {
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 255, 255, 0.25);
}

.records-section {
    flex: 1;
    background: rgba(26, 26, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    overflow-y: auto;
    min-height: 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.record-item {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.record-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, var(--accent-color) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.record-item:hover::before {
    opacity: 1;
}

.record-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(6px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.record-item.income-item {
    --accent-color: #10b981;
}

.record-item.expense-item {
    --accent-color: #ef4444;
}

.record-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.record-type-badge {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.record-type-badge.income {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.record-type-badge.expense {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.record-type-badge.cash {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.05) 100%);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.record-type-badge.claim {
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.15) 0%, rgba(255, 102, 0, 0.05) 100%);
    color: #ff6600;
    border: 1px solid rgba(255, 102, 0, 0.2);
}

.record-item:hover .record-type-badge {
    transform: scale(1.05);
}

.record-info h3 {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
}

.record-info p {
    font-size: 13px;
    color: #888;
}

.record-right {
    text-align: right;
}

.record-amount {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    text-shadow: 0 2px 10px currentColor;
}

.record-amount.income {
    color: #10b981;
}

.record-amount.expense {
    color: #ef4444;
}

.record-amount.cash {
    color: #ffc107;
}

.record-amount.claim {
    color: #ff6600;
}

.record-date {
    font-size: 12px;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 14px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    position: relative;
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(10, 10, 10, 0.6);
    border-radius: 8px;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(17, 17, 17, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.type-tabs {
    display: flex;
    gap: 8px;
}

.type-tab {
    flex: 1;
    padding: 12px;
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-tab:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(20, 20, 20, 0.8);
}

.type-tab.active {
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    color: #0a0a0a;
    border-color: transparent;
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.tags-input-container {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px;
    min-height: 48px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    transition: all 0.3s ease;
}

.tags-input-container:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(17, 17, 17, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 13px;
    color: #e0e0e0;
    transition: all 0.3s ease;
    animation: tagSlideIn 0.3s ease;
}

@keyframes tagSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tag:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.tag-remove {
    cursor: pointer;
    color: #888;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s ease;
}

.tag-remove:hover {
    color: #ef4444;
    transform: scale(1.2);
}

.tag-input {
    flex: 1;
    min-width: 120px;
    padding: 8px;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
}

.tag-suggestions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-suggestion {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag-suggestion:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    color: #0a0a0a;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 255, 255, 0.25);
}

.btn-secondary {
    background: rgba(42, 42, 42, 0.8);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(51, 51, 51, 0.9);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.import-info {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.import-info p {
    font-size: 14px;
    color: #888;
    margin-bottom: 12px;
}

.import-info ul {
    list-style: none;
    padding-left: 0;
}

.import-info li {
    font-size: 13px;
    color: #e0e0e0;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.import-info li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #666;
}

#detailContent {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.detail-label {
    font-size: 13px;
    color: #888;
}

.detail-value {
    font-size: 14px;
    color: #e0e0e0;
    font-weight: 500;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 10, 10, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-row input,
    .filter-row select {
        width: 100%;
    }

    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .action-btn span {
        display: none;
    }
}
