* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    margin: 0;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    animation: slideDown 0.3s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: #666;
    font-size: 0.95rem;
}

.login-error {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid #fcc;
}

.btn-login {
    width: 100%;
    margin-top: 10px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    color: white;
    margin-bottom: 40px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content > div {
    flex: 1;
    min-width: 200px;
}

header h1 {
    text-align: left;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    font-size: 0.9rem;
    width: auto;
    margin: 0;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.money-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.money-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.money-box:hover {
    transform: translateY(-5px);
}

.box-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.box-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.balance {
    text-align: right;
}

.balance-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.balance-amount {
    display: block;
    font-size: 2rem;
    font-weight: bold;
}

.box-content {
    padding: 25px;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.filter-controls label {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.filter-controls select {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-controls select:focus {
    outline: none;
    border-color: #667eea;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-info label {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.pagination-info select {
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.pagination-info select:focus {
    outline: none;
    border-color: #667eea;
}

.pagination-text {
    font-size: 0.9rem;
    color: #666;
    margin-left: 5px;
}

.pagination-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.btn-pagination {
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 40px;
    width: auto;
    margin: 0;
}

.btn-pagination:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-pagination-active {
    background: #667eea !important;
    color: white !important;
    border-color: #667eea !important;
}

.pagination-ellipsis {
    padding: 0 5px;
    color: #666;
}

.filter-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-around;
    border: 2px solid #e0e0e0;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.summary-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: bold;
}

.summary-value.income {
    color: #27ae60;
}

.summary-value.expense {
    color: #e74c3c;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-edit {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    font-size: 0.9rem;
    width: auto;
    margin: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    font-size: 0.9rem;
    width: auto;
    margin: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-danger:hover {
    background: #c0392b;
}

.transactions-list {
    max-height: 500px;
    overflow-y: auto;
}

.transaction-item {
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    gap: 12px;
}

.transaction-item:hover {
    background: #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.transaction-item.income {
    border-left-color: #27ae60;
}

.transaction-item.expense {
    border-left-color: #e74c3c;
}

.transaction-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.transaction-amount {
    font-size: 1.1rem;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 90px;
    text-align: right;
}

.transaction-amount.income {
    color: #27ae60;
}

.transaction-amount.expense {
    color: #e74c3c;
}

.transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-description {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-meta {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.transaction-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.meta-date {
    font-weight: 500;
}

.meta-source,
.meta-dest {
    font-size: 0.75rem;
    opacity: 0.8;
}

.transaction-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.close:hover {
    transform: scale(1.2);
}

form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.form-actions .btn {
    flex: 1;
    margin: 0;
}

/* Scrollbar Styling */
.transactions-list::-webkit-scrollbar {
    width: 8px;
}

.transactions-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.transactions-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.transactions-list::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .money-boxes {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    header h1 {
        text-align: center;
    }

    .login-box {
        padding: 30px 20px;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-controls label {
        margin-bottom: 5px;
    }

    .filter-summary {
        flex-direction: column;
        gap: 10px;
    }

    .summary-item {
        flex-direction: row;
        justify-content: space-between;
    }

    .transaction-item {
        flex-wrap: wrap;
        padding: 8px 10px;
    }

    .transaction-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    .transaction-amount {
        min-width: auto;
        text-align: left;
        font-size: 1rem;
    }

    .transaction-info {
        width: 100%;
    }

    .transaction-meta {
        font-size: 0.75rem;
        gap: 8px;
    }

    .transaction-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 4px;
    }

    .pagination-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-info {
        justify-content: space-between;
        width: 100%;
    }

    .pagination-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .btn-pagination {
        font-size: 0.85rem;
        padding: 5px 10px;
        min-width: 35px;
    }
}

